ask/app/views/admin/asks/_index.html.erb

55 lines
1.8 KiB
Plaintext

<table class="table main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<% @askquestions.each do |b| %>
<tr>
<td>
<% if b.situation == 'is_waiting' %>
<span class='label label-important'><%= t('is_waiting') %></span>
<% elsif b.situation == 'is_processed' %>
<span class='label label-success'><%= t('is_processed') %></span>
<% elsif b.situation == 'is_referral' %>
<span class='label'><%= t('is_referral') %></span>
<% end %>
</td>
<td><%= b.category.title %></td>
<!-- <td>
<%= b.title %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(b) %>
<li><a href="/admin/asks/<%=b.id.to_s%>/edit"><%= t(:edit) %></a></li>
<li><a href="#" class="delete text-error" rel="/admin/asks/<%=b.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td> -->
<td>
<%= b.name %>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(b) %>
<li><a href="/admin/asks/<%=b.id.to_s%>/edit"><%= t(:edit) %></a></li>
<li><a href="#" class="delete text-error" rel="/admin/asks/<%=b.id.to_s%>"><%= t(:delete_) %></a></li>
<% end %>
</ul>
</div>
</td>
<td><%= b.phone %></td>
<td><%= b.appointment.strftime("%Y-%m-%d %H:%M") rescue nil %></td>
</tr>
<% end %>
</tbody>
</table>
<%=
content_tag :div, class: "bottomnav clearfix" do
content_tag :div, paginate(@askquestions), class: "pagination pagination-centered"
end
%>