Changeset 169 for trunk/lib


Ignore:
Timestamp:
04/06/09 23:59:10 (15 years ago)
Author:
nanardon
Message:
  • split ballot admin page into subsection
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Vote/Controller/Admin.pm

    r167 r169  
    4848            $vote->delete_choice($c->req->param('delch')) 
    4949                and $vote->db->commit; 
    50         } elsif ($c->req->param('label')) { 
     50        } elsif ($c->req->param('pollparam')) { 
    5151            if ($c->req->param('dstart')) { 
    5252                $c->req->param('start', 
     
    6262                $id, 
    6363                map { $_ => ($c->req->param($_) || undef) } 
     64                grep { exists($c->req->params->{$_}) } 
    6465                qw(label description start end choice_count free_choice) 
    6566            ) and $vote->db->commit; 
     
    140141    $c->forward('modify_poll'); 
    141142    $c->stash->{page}{title} = $c->model('Vote')->vote_info($id)->{label} . ': Administration'; 
    142  
    143  
    144143} 
    145144 
     
    156155    $c->forward('auth') or return; 
    157156    $c->forward('modify_poll'); 
    158     $c->stash->{page}{title} = $c->model('Vote')->vote_info($id)->{label} . ': Administration'; 
     157    $c->stash->{page}{title} = $c->model('Vote')->vote_info( 
     158        $c->stash->{voteid} 
     159    )->{label} . ': Administration, liste des electeurs'; 
     160} 
     161 
     162sub ballot: LocalRegex('^(\d+)/ballot$') { 
     163    my ($self, $c, $id, @sub) = @_; 
     164    ($c->stash->{voteid}) = @{ $c->req->snippets || [] }; 
     165    my $vote = $c->model('Vote'); 
     166 
     167    $vote->vote_info($id) or do { 
     168        $c->res->redirect($c->uri_for('/')); 
     169        return; 
     170    }; 
     171 
     172    $c->forward('auth') or return; 
     173    $c->forward('modify_poll'); 
     174    $c->stash->{page}{title} = $c->model('Vote')->vote_info( 
     175        $c->stash->{voteid} 
     176    )->{label} . ': Administration, bulletin'; 
    159177} 
    160178 
Note: See TracChangeset for help on using the changeset viewer.