2014-04-27 01:35:13 +00:00
|
|
|
<h1>Listing Polls</h1>
|
2014-03-23 00:22:25 +00:00
|
|
|
|
2014-04-27 01:35:13 +00:00
|
|
|
<table class="polls striped">
|
2014-03-23 00:22:25 +00:00
|
|
|
<tr>
|
2014-04-27 01:35:13 +00:00
|
|
|
<th class="question">Question</th>
|
|
|
|
<th class="date">End date</th>
|
|
|
|
<th class="votes">Votes</th>
|
|
|
|
<th class="user">User</th>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% if cuser and cuser.admin? %>
|
2014-04-27 01:35:13 +00:00
|
|
|
<th class="actions"></th>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<% @polls.reverse_each do |poll| %>
|
2014-04-27 01:35:13 +00:00
|
|
|
<tr>
|
2014-03-23 00:22:25 +00:00
|
|
|
<td><%= link_to (h poll.question), poll %></td>
|
|
|
|
<td><%= longtime poll.end_date %></td>
|
2014-04-27 01:35:13 +00:00
|
|
|
<td><%=h poll.votes %></td>
|
|
|
|
<td><%=h poll.user %></td>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% if cuser and cuser.admin? %>
|
2014-04-27 01:35:13 +00:00
|
|
|
<td class="actions">
|
|
|
|
<%= link_to icon('pencil'), edit_poll_path(poll) %>
|
|
|
|
<%= link_to icon('times'), poll, confirm: 'Are you sure?', method: :delete %>
|
2014-03-23 00:22:25 +00:00
|
|
|
</td>
|
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<% if cuser and cuser.admin? %>
|
2014-04-27 01:35:13 +00:00
|
|
|
<%= link_to 'New Poll', new_poll_path, class: 'button' %>
|
2014-03-23 00:22:25 +00:00
|
|
|
<% end %>
|