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