Changeset 58
- Timestamp:
- 03/17/09 03:36:29 (15 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Vote/Controller/Admin.pm
r53 r58 38 38 my $vote = $c->model('Vote'); 39 39 40 $vote->vote_info($id) or do { 41 $c->res->redirect($c->uri_for('/')); 42 return; 43 }; 44 40 45 my $password = $c->session->{vpassword} || $c->req->param('vpassword'); 41 46 42 47 if (!$c->model('Vote')->auth_poll($id, $password)) { 43 $c->stash->{page}{title} = $ c->model('Vote')->vote_info($id)->{label} . ': Login d\'administration';48 $c->stash->{page}{title} = $vote->vote_info($id)->{label} . ': Login d\'administration'; 44 49 $c->session->{vpassword} = undef; 45 50 $c->stash->{template} = 'admin/login.tt'; -
trunk/lib/Vote/Model/Vote.pm
r43 r58 181 181 } 182 182 } 183 $res->{free_choice} = 0; # avoiding undef 183 184 $res 184 185 } -
trunk/root/templates/admin/default.tt
r47 r58 12 12 Label: <input type="text" name="label" value="[% c.req.param('label') || thisvote.label | html %]"> 13 13 <br> 14 Description: <textarea name="description">[% c.req.param('description') || thisvote.description | html %]</textarea> 14 Description:<br> 15 <textarea name="description" cols="60" rows="4">[% c.req.param('description') || thisvote.description | html %]</textarea> 15 16 <br> 17 <br> 18 <i>Les dates sont au format AAAA-MM-JJ HH:MM:SS</i><br> 16 19 Debut du vote: 17 20 <input type="text" name="start" value="[% c.req.param('start') || thisvote.start | html %]"> … … 20 23 <input type="text" name="end" value="[% c.req.param('end') || thisvote.end | html %]"> 21 24 <br> 25 <br> 22 26 Nombre de choix possible: 23 27 <input type="text" name="choice_count" value="[% c.req.param('choice_count') || thisvote.choice_count | html %]"> 24 28 <br> 25 29 Nombre de choix libres: 26 <input type="text" name="free_choice" value="[% c.req.param('free_choice') || thisvote.free_choice | html %]">30 <input type="text" name="free_choice" value="[% c.req.param('free_choice') || thisvote.free_choice || 0 | html %]"> 27 31 <br> 28 32 <input type="submit"> … … 30 34 </td> 31 35 <td valign="TOP"> 36 [% IF ! vote.vote_choices(voteid).size %] 37 <p class="alert">Aucun choix configuré</p> 38 [% ELSE %] 32 39 [% FOREACH choice = vote.vote_choices(voteid) %] 33 40 <form action="[% c.uri_for(voteid) %]"> … … 39 46 [% END %] 40 47 <form action="[% c.uri_for(voteid) %]"> 48 [% END %] 41 49 Ajouter un choix:<br> 42 50 <input type="text" name="addch"> … … 52 60 <tr> 53 61 <td valign="TOP"> 62 [% IF NOT vote.vote_voting_count(voteid) %] 63 <p class="alert">Aucun votant inscrit</p> 64 [% ELSE %] 54 65 [% signing = vote.vote_voting(voteid) %] 55 66 [% FOREACH thisvoting = signing %] … … 61 72 <input type="submit" name="delete" value="delete"><br> 62 73 </form> 74 [% END %] 63 75 [% END %] 64 76 </td>
Note: See TracChangeset
for help on using the changeset viewer.