!!!### language independant
!if $votecnt<1
  !if $wims_user!=supervisor
    $name_novote $name_novotecheck
    !exit
  !else
    $name_novote
  !endif
!else
  !if $wims_user!=supervisor
    !if $active<1
      $name_noactivevote $name_novotecheck
      !exit
    !endif
  !endif
  $name_class_vote
  $table_header
  $table_tr<th>$wims_name_title</th><th>$name_cnt_votes</th>
  <th>$wims_name_Status</th>
  !if $wims_user=supervisor
    <th>$wims_name_action</th>
  !endif
  </tr>
  !for t=1 to $votecnt
    !set l_=!record $t of $votedir/.votes
    !distribute lines $l_ into vote_status,vote_title,vote_option,vote_show,vote_whovoteshow
    !default vote_title=$name_untitled
    !set vcnt=!defof vcnt in $votedir/$t.votes
    !default vcnt=0
    !if $wims_user!=supervisor
      !if $vote_status iswordof 1 2
        $table_tr
        <td>
        !href cmd=reply&job=read&vote=$t $vote_title
        </td>
        !if $vote_show>0
          <td>$vcnt</td>
          <td class="wims_status_$vote_status">$(name_$vote_status), $(name_$vote_option)</td>
        !else
          <td>&nbsp;</td>
          <td>$(name_$vote_status), $(name_$vote_option)</td>
        !endif
        </tr>
      !endif
    !else
      $table_tr<td>
      $vote_title
      </td>
      <td>$vcnt</td>
       <td class="small">$(name_$vote_status), $(name_$vote_option)
      </td><td>
      !set wims_ref_class=wims_button
      !href cmd=reply&job=read&vote=$t $wims_name_Show
&nbsp;
      !set wims_ref_class=wims_button
      !href cmd=reply&job=edit&vote=$t $wims_name_change
&nbsp;
      !set wims_ref_class=wims_button
      !href cmd=reply&job=csv&vote=$t $wims_name_csv
      !if vote_show=1 or $wims_user=supervisor
        &nbsp;
        !set wims_ref_class=wims_button
        !href cmd=reply&job=showresult&vote=$t $name_showresult
      !endif
      </td>
    !endif
  </tr>
  !next t
  $table_end

!endif

!if $wims_user=supervisor
  !set wims_menu_items=!append line add_vote,1,cmd=reply&job=creat\
to $wims_menu_items
!endif
