Minor improvements to the election system. Mostly, replacing hardcoded dates with dynamic ones and adding a field to specify the date that a candidate application must be accepted.
Conflicts: registration/code/EditProfilePage.php
This commit is contained in:
parent
00b077eb8f
commit
a568fe0a32
@ -22,7 +22,7 @@ class CandidateApplicationForm extends HoneyPotForm {
|
||||
new TextAreaField('RelationshipToOpenStack',"What is your relationship to OpenStack, and why is its success important to you? What would you say is your biggest contribution to OpenStack's success to date?"),
|
||||
new TextAreaField('Experience',"Describe your experience with other non profits or serving as a board member. How does your experience prepare you for the role of a board member?"),
|
||||
new TextAreaField('BoardsRole',"What do you see as the Board's role in OpenStack's success?"),
|
||||
new TextAreaField('TopPriority',"What do you think the top priority of the Board should be in 2014?")
|
||||
new TextAreaField('TopPriority',"What do you think the top priority of the Board should be in 2015?")
|
||||
);
|
||||
|
||||
$actionButton = new FormAction('save', 'Save Candidate Application');
|
||||
|
@ -48,6 +48,12 @@
|
||||
$NominationsCloseField->setConfig('showdropdown', true);
|
||||
$fields->addFieldToTab('Root.Main', $NominationsCloseField, 'Content');
|
||||
|
||||
// Nomination App Deadline
|
||||
$NominationAppDeadlineField = new DateField('NominationAppDeadline','Date candidates must have completed the application in order to be listed (11:59PM this day)');
|
||||
$NominationAppDeadlineField->setConfig('showcalendar', true);
|
||||
$NominationAppDeadlineField->setConfig('showdropdown', true);
|
||||
$fields->addFieldToTab('Root.Content.Main', $NominationAppDeadlineField, 'Content');
|
||||
|
||||
// Elections Open
|
||||
$ElectionsOpenField = new DateField('ElectionsOpen','Date the elections open (12:00AM this day)');
|
||||
$ElectionsOpenField->setConfig('showcalendar', true);
|
||||
@ -135,4 +141,4 @@
|
||||
'CandidateListGold'
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -394,8 +394,16 @@ class EditProfilePage_Controller extends Page_Controller
|
||||
$Candidate->write();
|
||||
$questions = array('Bio' => 'Bio','RelationshipToOpenStack' => 'RelationshipToOpenStack','Experience' => 'Experience' ,'BoardsRole' => 'BoardsRole' ,'TopPriority' => 'TopPriority');
|
||||
// Must answer all questions, but can save work as they go, so we're going to check here rather than set up validators
|
||||
foreach ($data as $key => $value) {
|
||||
if (array_key_exists($key,$questions) && strlen($value) < 4) {
|
||||
|
||||
if(
|
||||
(strlen($data['Bio'])) < 4 ||
|
||||
(strlen($data['RelationshipToOpenStack'])) < 4 ||
|
||||
(strlen($data['Experience'])) < 4 ||
|
||||
(strlen($data['BoardsRole'])) < 4 ||
|
||||
(strlen($data['TopPriority'])) < 4
|
||||
|
||||
) {
|
||||
|
||||
$Candidate->HasAcceptedNomination = FALSE;
|
||||
$form->saveInto($Candidate);
|
||||
$Candidate->write();
|
||||
@ -403,7 +411,6 @@ class EditProfilePage_Controller extends Page_Controller
|
||||
$this->setMessage('Success', 'Your edits have been saved but you will need to provide full answers to all these questions to be eligible as a candidate.');
|
||||
$this->redirectBack();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$Candidate->HasAcceptedNomination = TRUE;
|
||||
|
@ -16,7 +16,7 @@
|
||||
<% else %>
|
||||
<p>You have not yet accepted the nomination. If you would like to accept your nomination and run in the OpenStack Individual Board Member election, you can do that here: http://www.openstack.org/profile/election/ </p>
|
||||
<p>Once you accept the nomination and complete the application, you'll need a total of 10 nominations from members before you appear on the ballot. You currently have $countNominations nomination<% if countNominations = 1 %><% else %>s<% end_if %>.</p>
|
||||
<p>If you wish to run in the 2014 Individual Director election, you must accept your nomination by December 13, 2013 and <a href="http://www.openstack.org/profile/election/">submit your candidate application</a>.</p>
|
||||
<p>If you wish to run in the {$Election.Title}, you must accept your nomination by {$Election.NominationAppDeadline.Format(F d Y)} and <a href="http://www.openstack.org/profile/election/">submit your candidate application</a>.</p>
|
||||
<% end_if %>
|
||||
|
||||
<% end_loop %>
|
||||
|
Loading…
x
Reference in New Issue
Block a user