ask/app/views/asks/_history.html.erb

40 lines
1.1 KiB
Plaintext

<% if @histories.count > 0 %>
<table class="table">
<thead>
<tr>
<th><%= t('status') %></th>
<% if !current_user.nil? %>
<th><%= t('ask.modified_by') %></th>
<th><%= t('ask.remark') %></th>
<th><%= t('ask.attachment') %></th>
<% end %>
<th><%= t('ask.updated_at') %></th>
</tr>
</thead>
<tbody>
<% @histories.each do |ask_status_history| %>
<tr>
<td>
<%= @status_mapping[ask_status_history.status] %>
</td>
<% if !current_user.nil? %>
<td>
<%= ask_status_history.modified_by_name %>
</td>
<td>
<%= ask_status_history.comment %>
</td>
<td>
<%= link_to(ask_status_history[:file], "/#{I18n.locale}/admin/asks/#{ask_status_history.id.to_s}/download") if ask_status_history.file.present? %>
</td>
<% end %>
<td>
<%= ask_status_history.created_at.strftime("%Y-%m-%d %H:%M:%S") %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% else %>
<p><%= t('no_history_records') %></p
<% end %>