Changeset 61 for trunk


Ignore:
Timestamp:
03/17/09 19:11:33 (15 years ago)
Author:
nanardon
Message:
  • improve admin page
Location:
trunk
Files:
2 added
4 edited

Legend:

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

    r58 r61  
    7070                and $vote->db->commit; 
    7171        } elsif ($c->req->param('label')) { 
     72            if ($c->req->param('dstart')) { 
     73                $c->req->param('start', 
     74                    $c->req->param('dstart') . ' ' . ($c->req->param('hstart') || '') 
     75                ); 
     76            } 
     77            if ($c->req->param('dend')) { 
     78                $c->req->param('end', 
     79                    $c->req->param('dend') . ' ' . ($c->req->param('hend') || '') 
     80                ); 
     81            } 
    7282            $vote->vote_param( 
    7383                $id, 
  • trunk/lib/Vote/Model/Vote.pm

    r58 r61  
    165165    my $sth = $self->db->prepare_cached( 
    166166        q{ 
    167         select * from poll where id = ? 
     167        select *, 
     168        to_char("start", 'DD/MM/YYYY') as dstart, 
     169        to_char("start", 'HH24:MI:SS') as hstart, 
     170        to_char("end", 'DD/MM/YYYY') as dend, 
     171        to_char("end", 'HH24:MI:SS') as hend 
     172        from poll where id = ? 
    168173        } 
    169174    ); 
  • trunk/root/templates/admin/default.tt

    r60 r61  
     1<DIV ID="testdiv1" STYLE="position:absolute;visibility:hidden;background-color:white;layer-background-color:white;"></DIV> 
     2 
    13[% vote = c.model('Vote') %] 
    24 
     
    1820<!-- http://www.mattkruse.com/javascript/calendarpopup/ --> 
    1921<i>Les dates sont au format AAAA-MM-JJ HH:MM:SS</i><br> 
    20 Debut du vote: 
    21 <input type="text" name="start" value="[% c.req.param('start') || thisvote.start | html %]"> 
     22 
     23<SCRIPT LANGUAGE="JavaScript" ID="js13"> 
     24var cal13 = new CalendarPopup(); 
     25</SCRIPT> 
     26 
     27Debut du vote:<br> 
     28Date: <input type="text" name="dstart" value="[% c.req.param('dstart') || thisvote.dstart | html %]"> 
     29<A HREF="#" onClick="cal13.select(document.forms[0].dstart,'anchor13','dd/MM/yyyy'); return false;" TITLE="cal13.select(document.forms[0].dstart,'anchor13','dd/MM/yyyy'); return false;" NAME="anchor13" ID="anchor13">select</A> 
     30Heure: <input type="text" name="hstart" value="[% c.req.param('hstart') || thisvote.hstart | html %]"> 
    2231<br> 
    23 Fin du vote: 
    24 <input type="text" name="end" value="[% c.req.param('end') || thisvote.end | html %]"> 
     32Fin du vote:<br> 
     33Date: <input type="text" name="dend" value="[% c.req.param('dend') || thisvote.dend | html %]"> 
     34<A HREF="#" onClick="cal13.select(document.forms[0].dend,'anchor14','dd/MM/yyyy',(document.forms[0].dend.value=='')?document.forms[0].dstart.value:null); return false;" TITLE="cal13.select(document.forms[0].dend,'anchor14','dd/MM/yyyy',(document.forms[0].dend.value=='')?document.forms[0].dstart.value:null); return false;" NAME="anchor14" ID="anchor14">select</A> 
     35Heure: <input type="text" name="hend" value="[% c.req.param('hend') || thisvote.hend | html %]"> 
    2536<br> 
    2637<br> 
     
    7788</td> 
    7889<td valign="TOP"> 
     90<p>Ajouter un votant</p> 
    7991<form action="[% c.uri_for(voteid) %]"> 
    8092Nom: <input type="text" name="id"><br> 
     
    8395</form> 
    8496<hr> 
     97<p>Soumettre la liste via un fichier csv</p> 
     98<p>Format: <i>Nom;Mail@domain</i></p> 
    8599<form method="POST" ENCTYPE="multipart/form-data" action="[% c.uri_for(voteid) %]"> 
    86100<input type="file" name="votinglist"><br> 
     
    89103</form> 
    90104<hr> 
     105<p>Envoyer les mots de passes au nouveaux votants</p> 
    91106<form action="[% c.uri_for(voteid) %]"> 
    92107<input type="submit" name="mailpasswd" value="Envoyer les mot de passe"> 
  • trunk/root/templates/includes/header.tt

    r57 r61  
    66<link rel="stylesheet" href="[% c.uri_for('/static', 'vote.css') %]" type="text/css"> 
    77<link rel="icon" href="[%- c.uri_for('/static', 'images', 'favicon.ico') -%]" type="image/x-icon"> 
     8 
     9<script language="JavaScript" src="[% c.uri_for('/static', 'js', 'CalendarPopup.js') %]"></SCRIPT> 
    810 
    911</head> 
Note: See TracChangeset for help on using the changeset viewer.