ensl.org/app/views/polls/index.html.erb

33 lines
884 B
Text
Raw Permalink Normal View History

2014-04-27 01:35:13 +00:00
<h1>Listing Polls</h1>
2014-04-27 01:35:13 +00:00
<table class="polls striped">
<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>
<% if cuser and cuser.admin? %>
2014-04-27 01:35:13 +00:00
<th class="actions"></th>
<% end %>
</tr>
<% @polls.reverse_each do |poll| %>
2014-04-27 01:35:13 +00:00
<tr>
<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>
<% 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 %>
</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' %>
<% end %>