2014-10-02 06:00:35 +00:00
|
|
|
<table class="table main-list">
|
|
|
|
<thead>
|
|
|
|
<tr class="sort-header">
|
|
|
|
<% @table_fields.each do |f| %>
|
2020-04-30 05:18:02 +00:00
|
|
|
<% tmp = f.to_s.gsub(/ask\./,'') %>
|
|
|
|
<% if @ask_setting.default_setting[tmp].nil? || @ask_setting.default_setting[tmp] %>
|
|
|
|
<%= thead(f) %>
|
|
|
|
<% end %>
|
2014-10-02 06:00:35 +00:00
|
|
|
<% end %>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<% @askquestions.each do |b| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
2014-10-23 07:03:21 +00:00
|
|
|
<% if b.situation == 'is_waiting' %>
|
2020-04-30 05:18:02 +00:00
|
|
|
<span class='label label-important'><%= t('ask.is_waiting') %></span>
|
2014-10-23 07:03:21 +00:00
|
|
|
<% elsif b.situation == 'is_processed' %>
|
2020-04-30 05:18:02 +00:00
|
|
|
<span class='label label-warning'><%= t('ask.is_processed') %></span>
|
2014-10-23 07:03:21 +00:00
|
|
|
<% elsif b.situation == 'is_referral' %>
|
2020-04-30 05:18:02 +00:00
|
|
|
<span class='label'><%= t('ask.is_referral') %></span>
|
|
|
|
<% elsif b.situation == 'is_published' %>
|
|
|
|
<span class='label label-success'><%= t('ask.is_published') %></span>
|
2014-10-02 06:00:35 +00:00
|
|
|
<% end %>
|
|
|
|
</td>
|
2020-04-30 05:18:02 +00:00
|
|
|
<td>
|
2020-05-07 01:09:52 +00:00
|
|
|
<%= b.category.title rescue 'category not set' %>
|
2014-10-02 06:00:35 +00:00
|
|
|
<div class="quick-edit">
|
|
|
|
<ul class="nav nav-pills">
|
|
|
|
<% if can_edit_or_delete?(b) %>
|
2020-05-13 09:08:40 +00:00
|
|
|
<li><a href="/<%= I18n.locale %>/admin/asks/<%=b.id.to_s%>/edit"><%= t(:edit) %></a></li>
|
2014-10-02 06:00:35 +00:00
|
|
|
<li><a href="#" class="delete text-error" rel="/admin/asks/<%=b.id.to_s%>"><%= t(:delete_) %></a></li>
|
|
|
|
<% end %>
|
2020-07-04 13:36:32 +00:00
|
|
|
<li><a href="/<%= I18n.locale %>/admin/asks/<%=b.id.to_s%>/print" target="_blank"><%= t('ask.print') %></a></li>
|
2014-10-02 06:00:35 +00:00
|
|
|
</ul>
|
2020-04-30 05:18:02 +00:00
|
|
|
</div>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<% if b.situation == 'is_published' %>
|
|
|
|
<%= link_to b.title,((Page.where(:module=>'ask').first.url+"?item=#{b.id}") rescue "javascript:alert('#{t('ask.no_index_page')}')") %>
|
|
|
|
<% else %>
|
|
|
|
<%= b.title %>
|
|
|
|
<% end %>
|
|
|
|
</td>
|
2021-02-24 10:53:00 +00:00
|
|
|
<% if @ask_setting.default_setting['name'].nil? || @ask_setting.default_setting['name'] %>
|
2016-11-07 02:08:04 +00:00
|
|
|
<td>
|
|
|
|
<%= b.name %>
|
2014-10-02 06:00:35 +00:00
|
|
|
</td>
|
2021-02-24 10:53:00 +00:00
|
|
|
<% end %>
|
2020-04-30 05:18:02 +00:00
|
|
|
<% if @ask_setting.default_setting['phone'] %>
|
|
|
|
<td><%= b.phone %></td>
|
|
|
|
<% end %>
|
|
|
|
<% if @ask_setting.default_setting['appointment'] %>
|
|
|
|
<td><%= b.appointment.strftime("%Y-%m-%d %H:%M") rescue nil %></td>
|
|
|
|
<% end %>
|
2020-07-27 02:11:58 +00:00
|
|
|
<td><%= b.created_at.strftime("%Y-%m-%d %H:%M") rescue nil %></td>
|
2014-10-02 06:00:35 +00:00
|
|
|
</tr>
|
|
|
|
<% end %>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<%=
|
|
|
|
content_tag :div, class: "bottomnav clearfix" do
|
|
|
|
content_tag :div, paginate(@askquestions), class: "pagination pagination-centered"
|
|
|
|
end
|
|
|
|
%>
|