<% is_editable = can_edit_or_delete?(b)
ask_show_url = Page.where(:module=>'ask').first.url rescue nil
edit_button_can_show = true
%>
<% if is_editable %><% end %> |
<% @table_fields.each_with_index do |f,i| %>
<% 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 %>
<% end %>
<% if edit_box_display_index == i %>
<%= render partial: 'edit_box_for_index', :locals => {is_editable: is_editable, b: b} %>
<% end %>
|
<% end %>
<% @table_ext_fields.each do |f, v| %>
<%= show_on_front(f,v,b,true) %>
|
<% end %>
<% end %>