Index: user/des/fbce/lib/FBCE/Controller/Root.pm =================================================================== --- user/des/fbce/lib/FBCE/Controller/Root.pm (revision 333467) +++ user/des/fbce/lib/FBCE/Controller/Root.pm (revision 333468) @@ -1,147 +1,148 @@ package FBCE::Controller::Root; use Moose; use namespace::autoclean; BEGIN { extends 'Catalyst::Controller' } # # Sets the actions in this controller to be registered with no prefix # so they function identically to actions created in MyApp.pm # __PACKAGE__->config(namespace => ''); =head1 NAME FBCE::Controller::Root - Root Controller for FBCE =head1 DESCRIPTION [enter your description here] =head1 METHODS =head2 index The root page (/) =cut sub auto :Private { my ($self, $c) = @_; # Stash schedule information etc. $c->stash(title => $c->config->{'title'}); + $c->stash(descr => $c->config->{'descr'}); my $now = DateTime->now(); $c->stash(now => $now); my $schedule = $c->model('Schedule'); foreach my $phase ("nominating", "voting") { foreach my $endpoint ("${phase}_starts", "${phase}_ends") { $c->stash($endpoint => $schedule->{$endpoint}); } } $c->stash(announcement => $schedule->{'announcement'}); $c->stash(investiture => $schedule->{'investiture'}); $c->stash(nominating => $schedule->nominating($now)); $c->stash(voting => $schedule->voting($now)); $c->stash(announced => $schedule->announced($now)); my $rules = $c->model('Rules'); $c->stash(max_votes => $rules->{'max_votes'}); # Authentication if ($c->request->path !~ m/^(login|logout|bylaws|help|static\/.*)?$/) { if (!$c->user_exists) { $c->stash(action => $c->uri_for()); $c->stash(template => 'login.tt'); return 0; } } if ($c->user) { $c->stash(user => $c->user->get_object()); } return 1; } sub login :Local :Args(0) { my ($self, $c) = @_; my ($login, $password, $action) = @{$c->request->params}{'login', 'password', 'action'}; if ($login && $password) { $c->authenticate({ login => $c->request->params->{'login'}, password => $c->request->params->{'password'} }); } if ($c->user_exists) { $c->change_session_id(); if ($action) { $c->response->redirect($action); } else { $c->response->redirect($c->uri_for('/')); } return; } $c->stash(action => $action); } sub logout :Local :Args(0) { my ($self, $c) = @_; $c->logout(); $c->response->redirect($c->uri_for('/')); } sub index :Path :Args(0) { my ($self, $c) = @_; } sub bylaws :Local :Args(0) { my ($self, $c) = @_; } sub help :Local :Args(0) { my ($self, $c) = @_; } =head2 default Standard 404 error page =cut sub default :Path { my ($self, $c) = @_; $c->response->body('Page not found'); $c->response->status(404); } =head2 end Attempt to render a view, if needed. =cut sub end : ActionClass('RenderView') {} =head1 AUTHOR Dag-Erling Smørgrav =head1 LICENSE This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. =cut __PACKAGE__->meta->make_immutable; 1; # $FreeBSD$ Index: user/des/fbce/root/lib/help =================================================================== --- user/des/fbce/root/lib/help (revision 333467) +++ user/des/fbce/root/lib/help (revision 333468) @@ -1,67 +1,67 @@ [%-# $FreeBSD$ -%]
This is the website for the 2016 FreeBSD core team elections. See the bylaws and the schedule posted on the front page for additional information on the election rules.
+This is the website for the [% descr | html %]. See the bylaws and the schedule posted on the front page for additional information on the election rules.
Anyone with a valid commit bit in at least one of FreeBSD's repositories (src, doc, ports) can log in with their FreeBSD user name. However, only active committers, i.e. those who have made at least one commit in the twelve months preceding the election, are allowed to run or vote in the election. Inactive committers can only observe.
[% IF user %] [% IF user.active %]You are registered as an active committer, and are qualified to run and vote in the election.
[% ELSE %]You are not registered as an active committer, and are therefore not qualified to run or vote in the election. If you believe this is incorrect, please contact the election administrator.
[% END %] [% ELSE %]When you are logged in, your status (active or inactive) will be visible next to your name in the top right corner.
[% END %]You're already logged in, you big dummy.
[% ELSE %]Click the Log in link below the navigation bar. Or the one right here. You will find your password in ~/fbce-password on freefall.
[% IF nominating >= 0 || voting >= 0 %]If you have a valid FreeBSD commit bit but you haven't received a password, please contact the election administrator.
[% END %] [% END %]Come back when the application period starts, on [% INCLUDE lib/datetime dt=nominating_starts %].
[% ELSIF nominating > 0 %]The application period ended on [% INCLUDE lib/datetime dt=nominating_ends %].
[% ELSIF !user %]You must be logged in to run for election.
[% ELSIF !user.active %]You are not registered as an active committer, and are therefore not qualified to run in the election. If you believe this is incorrect, please contact the election administrator.
[% ELSE %]Click the Run link in the navigation bar (or the one right here). You will be asked to enter a slogan and a statement of intent.
[% END %]The application period hasn't started yet.
[% ELSIF !user %]You must be logged in to see the list of candidates.
[% ELSE %]Click the Candidates link in the navigation bar (or the one right here).
[% END %]Come back when the voting period starts, on [% INCLUDE lib/datetime dt=voting_starts %].
[% ELSIF voting > 0 %]The voting period ended on [% INCLUDE lib/datetime dt=voting_ends %].
[% ELSIF !user %]You must be logged in to vote.
[% ELSIF !user.active %]You are not registered as an active committer, and are therefore not qualified to run in the election. If you believe this is incorrect, please contact the election administrator.
[% ELSE %]Click the Vote link in the navigation bar (or the one right here) and select up to [% max_votes %] candidates. You can change your vote at any time until the election ends.
[% END %]