Fix edit button in backend show page.

This commit is contained in:
邱博亞 2024-07-21 15:25:17 +08:00
parent d202a8ad0a
commit 0a3fc812c4
1 changed files with 23 additions and 25 deletions

View File

@ -27,13 +27,13 @@
</tr>
</thead>
<tbody>
<% can_edit = can_edit_or_delete?(@entries.first.u_table) if !(@entries.first.nil?) %>
<% can_edit = can_edit_or_delete?(@table) %>
<% @entries.each do |entry| %>
<tr>
<% @columns.each_with_index do |column, index| %>
<% ce = entry.column_entries.where(:table_column_id => column.id).first rescue nil %>
<% if !ce.nil? %>
<td>
<% if !ce.nil? %>
<% case ce.type %>
<% when "text" %>
<%= ce.text %>
@ -54,6 +54,9 @@
<%= format_date(ce.period_from, column.date_format) %> ~ <%= format_date(ce.period_to, column.date_format) %>
<% end %>
<% end %>
<% else %>
&nbsp;
<% end %>
<% if index == 0 && can_edit %>
<div class="quick-edit">
<ul class="nav nav-pills">
@ -63,11 +66,6 @@
</div>
<% end %>
</td>
<% else %>
<td>
&nbsp;
</td>
<% end %>
<% end %>
</tr>
<% end %>