<%= t(:category) %>

<% @table_fields.each do |f| %> <%= ask_thead(f, @ask_setting.field_name(f)) %> <% end %> <% @table_ext_fields.each do |f, v| %> <%= ask_thead(f, v['field'][I18n.locale.to_s]) %> <% end %> <% 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 last_serial_number = @ask_setting.last_serial_number display_length = [last_serial_number.to_s.length + 1, 4].max edit_box_display_index = @table_fields.count > 3 ? 2 : @table_fields.count %> <% @askquestions.each do |b| %> <% is_editable = can_edit_or_delete?(b) ask_show_url = Page.where(:module=>'ask').first.url rescue nil edit_button_can_show = true %> <% @table_fields.each_with_index do |f,i| %> <% end %> <% @table_ext_fields.each do |f, v| %> <% end %> <% end %>
<% if is_editable %><% end %> <% case f %> <% when 'serial_number' %> <%= b.get_serial_number(last_serial_number, display_length) %> <% when 'situation' %> <%= situation_trans[b.situation] %> <% when 'ask_category_id' %> <%= b.category.title rescue 'category not set' %> <% when 'sex' %> <%= ['male','female'].include?(sex.to_s) ? t("mongoid.attributes.ask_question.#{sex}") : '' %> <% when 'mail' %> <%= b.mail %> <% when 'title' %> <% if b.situation == 'is_published' %> <%= link_to b.title, (ask_show_url ? (ask_show_url+"?item=#{b.id}") : "javascript:alert('#{t('ask.no_index_page')}')") %> <% else %> <%= b.title %> <% end %> <% when 'name' %> <%= b.name %> <% when 'phone' %> <%= b.phone %> <% when 'appointment' %> <%= b.appointment.strftime("%Y-%m-%d %H:%M") rescue nil %> <% when 'created_at' %> <%= b.created_at.strftime("%Y-%m-%d %H:%M") rescue nil %> <% when 'ip' %> <%= b.ip %> <% when 'reviewer' %> <%= b.reviewer.name rescue "" %> <% when 'review_time' %> <%= b.review_time.strftime("%Y-%m-%d %H:%M") rescue nil %> <% end %> <% if edit_box_display_index == i %> <%= render partial: 'edit_box_for_index', :locals => {is_editable: is_editable, b: b} %> <% end %> <%= show_on_front(f,v,b,true) %>
<%= content_tag :div, class: "bottomnav clearfix" do %> <%= content_tag :div, class: "pagination pagination-centered" do paginate(@askquestions) end %> <%= content_tag :div, link_to(I18n.t('ask.display_fields_setting'), backend_table_setting_admin_asks_path + (@category_id.present? ? "?category_id=#{@category_id}" : ''), :class=>'btn btn-primary' ) + link_to(t("ask.delete_selected"), "javascript:void(0)", :class=>"btn btn-danger delete_asks_btn hide", :style=>'margin-left: 0.5em;') + link_to(t("ask.batch_modify_status"), "javascript:void(0)", :class=>"btn btn-success batch_modify_status_btn hide", :style=>'margin-left: 0.5em;'), class: 'pull-right' %> <% end %>