<% is_editable = can_edit_or_delete?(b)
ask_show_url = Page.where(:module=>'ask').first.url rescue nil
edit_button_can_show = true
%>
<% content_for :edit_button do %>
<% end %>
<% 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_button_display_index == i %>
<%= yield :edit_button %>
<% end %>
|
<% end %>
<% @table_ext_fields.each do |f, v| %>
<%= show_on_front(f,v,b.custom_values[f],true) %>
|
<% end %>
<% end %>