survey/app/views/admin/surveys/answer_sets.html.erb

30 lines
821 B
Plaintext
Raw Normal View History

<h3><%= @survey.title %></h3>
<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
<th class="span2"></th>
</tr>
</thead>
<tbody>
<% @survey_answers.each do |sa| %>
<tr>
<% user = sa.user.nil? ? nil : (User.find(sa.user) rescue nil) %>
<% if !user.nil? %>
<td><%= user.name %></td>
<% else %>
<td>&nbsp;</td>
<% end %>
<td><%= sa.created_at.strftime("%y-%M-%d %h:%m") rescue nil %></td>
<td><a href="/admin/surveys/<%= sa.id.to_s %>/answer_set"><%= t("survey.view_answers") %></a></td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@survey_answers), class: "pagination pagination-centered"
end
%>