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>
|
2022-07-07 08:54:09 +00:00
|
|
|
<%
|
|
|
|
situation_class_relation = {
|
|
|
|
"is_waiting"=>"label-important",
|
|
|
|
"is_processed"=>"label-warning",
|
|
|
|
"is_referral"=>"",
|
|
|
|
"is_published"=>"label-success"
|
|
|
|
}
|
|
|
|
situation_trans = AskTicketStatus.all.map{|a| [a.key, a.title]}.to_h
|
|
|
|
%>
|
2014-10-02 06:00:35 +00:00
|
|
|
<% @askquestions.each do |b| %>
|
|
|
|
<tr>
|
|
|
|
<td>
|
2022-07-07 08:54:09 +00:00
|
|
|
<span class='label <%=situation_class_relation[b.situation]%>'><%= situation_trans[b.situation] %></span>
|
2014-10-02 06:00:35 +00:00
|
|
|
</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>
|
2022-07-07 08:54:09 +00:00
|
|
|
<td><%= b.ip %></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
|
|
|
|
%>
|