From a54140970540a23c7441d88ae6f5fdbee14b542a Mon Sep 17 00:00:00 2001 From: santipalenque Date: Wed, 3 Dec 2014 13:39:24 -0300 Subject: [PATCH] [spalenque] - #7812 *WIP --- .../frontend/EventRegistrationRequestPage.php | 2 ++ .../code/model/consultants/IConsultant.php | 3 +- openstack/code/FeedbackForm.php | 35 ++++++++++--------- openstack/code/HomePage.php | 2 +- openstack/code/Page.php | 4 +-- registration/css/registration.page.css | 1 - registration/javascript/edit.profile.page.js | 4 +-- registration/javascript/registration.page.js | 4 +-- .../templates/Layout/Includes/FeedbackForm.ss | 16 +++++---- themes/openstack/templates/Page.ss | 10 ++---- 10 files changed, 40 insertions(+), 41 deletions(-) diff --git a/events/code/ui/frontend/EventRegistrationRequestPage.php b/events/code/ui/frontend/EventRegistrationRequestPage.php index 7a3ae7d..411ec7e 100644 --- a/events/code/ui/frontend/EventRegistrationRequestPage.php +++ b/events/code/ui/frontend/EventRegistrationRequestPage.php @@ -92,6 +92,7 @@ final class EventRegistrationRequestPage_Controller extends Page_Controller { if(class_exists('SpamProtectorManager')) { SpamProtectorManager::update_form($form); } + return $form; } @@ -106,6 +107,7 @@ final class EventRegistrationRequestPage_Controller extends Page_Controller { try{ $this->event_registration_request_manager->registerEventRegistrationRequest($data); Session::clear("FormInfo.Form_EventRegistrationRequestForm.data"); + $form->clearMessage(); return $this->redirect($this->Link('?saved=1')); } catch(EntityValidationException $ex1){ diff --git a/marketplace/code/model/consultants/IConsultant.php b/marketplace/code/model/consultants/IConsultant.php index 3379d4a..0d4104e 100644 --- a/marketplace/code/model/consultants/IConsultant.php +++ b/marketplace/code/model/consultants/IConsultant.php @@ -1,4 +1,5 @@ -addExtraClass('button'); - + $actions = new FieldList( $tellUsButton ); - + parent::__construct($controller, $name, $fields, $actions); } - - function forTemplate() { - return $this->renderWith(array( - $this->class, - 'Form' - )); - } - - function submitFeedback($data, $form) { + + function submitFeedback(array $data, Form $form) { // TRUE if the submission contains a link. Crude spam mitigation. $ContainsLink = strpos($data['Content'], "http://") !== false; @@ -52,6 +45,7 @@ class FeedbackForm extends Form { // Tie the URL of the current page to the feedback submission $page = Director::get_current_page(); $FeedbackSubmission->Page = $page->Link(); + //$FeedbackSubmission->write(); //Send email alert about submission $Subject = "New Website Feedback Submission"; @@ -63,7 +57,7 @@ class FeedbackForm extends Form { // Redirect back to the page with a success message $form->controller->setMessage('Success', 'Thanks for providing feedback to improve the OpenStack website!'); $form->controller->redirectBack(); - + } else { $form->controller->setMessage('Error', "Oops! It doesn't look like you provided any feedback. Please check the form and try again."); @@ -71,4 +65,11 @@ class FeedbackForm extends Form { } } + function forTemplate() { + return $this->renderWith(array( + $this->class, + 'Form' + )); + } + } \ No newline at end of file diff --git a/openstack/code/HomePage.php b/openstack/code/HomePage.php index 139cf02..5fecca4 100644 --- a/openstack/code/HomePage.php +++ b/openstack/code/HomePage.php @@ -122,7 +122,7 @@ class HomePage_Controller extends Page_Controller { $item->pubDate = date("D, M jS Y", strtotime($item->pubDate)); } - return $result->limit(0,$limit); + return $result->limit($limit,0); } function PastEvents($num=1) { diff --git a/openstack/code/Page.php b/openstack/code/Page.php index 7fd9b05..7bda762 100644 --- a/openstack/code/Page.php +++ b/openstack/code/Page.php @@ -202,7 +202,7 @@ class Page_Controller extends ContentController { */ private static $allowed_actions = array ( 'logout', - 'FeedbackForm' + 'FeedbackForm', ); @@ -326,7 +326,7 @@ class Page_Controller extends ContentController { )); } - public function getMessage() { + public function getMessage() { if($message = Session::get('Message')){ Session::clear('Message'); $array = new ArrayData($message); diff --git a/registration/css/registration.page.css b/registration/css/registration.page.css index d267e80..27b8504 100644 --- a/registration/css/registration.page.css +++ b/registration/css/registration.page.css @@ -5,7 +5,6 @@ label.error, .recaptcha .message.validation color: #fff; padding: 5px; margin: 0; - width: 100%; -webkit-border-radius: 05px; -moz-border-radius: 05px; border-radius: 05px; diff --git a/registration/javascript/edit.profile.page.js b/registration/javascript/edit.profile.page.js index 2223a77..2dfdbf7 100755 --- a/registration/javascript/edit.profile.page.js +++ b/registration/javascript/edit.profile.page.js @@ -120,8 +120,8 @@ jQuery(document).ready(function($) { GenderField.on('change',function(){ var value = $(this).val(); if(value == 'Specify'){ - $('#GenderSpecify').fadeIn(); - GenderSpecify.fadeIn(); + $('#GenderSpecify').removeClass('hide').fadeIn(); + GenderSpecify.removeClass('hide').fadeIn(); } else { $('#GenderSpecify').fadeOut(); GenderSpecify.fadeOut(); diff --git a/registration/javascript/registration.page.js b/registration/javascript/registration.page.js index bd3a497..724e809 100755 --- a/registration/javascript/registration.page.js +++ b/registration/javascript/registration.page.js @@ -113,8 +113,8 @@ jQuery(document).ready(function($) { GenderField.on('change',function(){ var value = $(this).val(); if(value == 'Specify'){ - $('#GenderSpecify').fadeIn(); - GenderSpecify.fadeIn(); + $('#GenderSpecify').removeClass('hide').fadeIn(); + GenderSpecify.removeClass('hide').fadeIn(); } else { $('#GenderSpecify').fadeOut(); GenderSpecify.fadeOut(); diff --git a/themes/openstack/templates/Layout/Includes/FeedbackForm.ss b/themes/openstack/templates/Layout/Includes/FeedbackForm.ss index e26d81f..f3b2f67 100644 --- a/themes/openstack/templates/Layout/Includes/FeedbackForm.ss +++ b/themes/openstack/templates/Layout/Includes/FeedbackForm.ss @@ -1,9 +1,11 @@
-
-
- - $dataFieldByName(SecurityID) - +
+
+
+ + $Fields.dataFieldByName(SecurityID) + +
+
-
- \ No newline at end of file + \ No newline at end of file diff --git a/themes/openstack/templates/Page.ss b/themes/openstack/templates/Page.ss index 300b2df..085edbf 100644 --- a/themes/openstack/templates/Page.ss +++ b/themes/openstack/templates/Page.ss @@ -50,14 +50,8 @@ <% include Navigation %> - <% if BootstrapConverted %> - $Message - $Layout - <% else %> -
- $Layout -
- <% end_if %> + $Message + $Layout <% include Footer %>