Browse Source

fix row action being removed (sync)

ref 0c6aad4941
pull/1/head
Nicolae Claudius 11 years ago
parent
commit
a36d449390
  1. 31
      app/views/users/as/_list_record.html.erb

31
app/views/users/as/_list_record.html.erb

@ -1,16 +1,31 @@
<%# add :controller_id => :as_records to respond in records list, not a's %> <%# add :controller_id => :as_records to respond in records list, not a's %>
<% <%
record = list_record if list_record # compat with render :partial :collection record = list_record if local_assigns[:list_record] # compat with render :partial :collection
columns ||= list_columns columns ||= list_columns
tr_class = cycle("", "even-record") tr_class = cycle("", "even-record") + ' ' + list_row_class(record)
tr_class += " #{list_row_class(record)}"
url_options = params_for(:action => :list, :id => record.id)
action_links ||= active_scaffold_config.action_links.member action_links ||= active_scaffold_config.action_links.member
data_refresh ||= record.id
-%> -%>
<tr class="record <%= tr_class %>" id="<%= element_row_id(:controller_id => :as_records, :action => :list, :id => record.id) %>" data-refresh="<%= data_refresh %>">
<% columns.each do |column| %>
<% authorized = record.authorized_for?(:crud_type => :read, :column => column.name) -%>
<% column_value = authorized ? get_column_value(record, column) : active_scaffold_config.list.empty_field_text -%>
<tr class="record <%= tr_class %>" id="<%= element_row_id(:controller_id => :as_records, :action => :list, :id => record.id) %>" data-refresh="<%= url_for(params_for(:action => :row, :id => record.id, :_method => :get)).html_safe %>"> <%= content_tag :td, column_attributes(column, record).merge(:class => column_class(column, column_value, record)) do %>
<%= render :partial => 'list_record_columns', :locals => {:record => record, :columns => columns} %> <%= authorized ? render_list_column(column_value, column, record) : column_value %>
<%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options, :action_links => action_links} unless action_links.empty? %> <% end %>
<%= render_nested_view(action_links, url_options, record) unless @nested_auto_open.nil? %> <% end -%>
<td class="actions"><table>
<tr>
<td class="indicator-container">
<%= loading_indicator_tag(:action => :record, :id => record.id) %>
</td>
<%= display_action_links(action_links, record, :level_0_tag => :td, :for => record.persisted? ? record : record.class) %>
</tr>
</table></td>
<%= render_nested_view(action_links, record) unless @nested_auto_open.nil? %>
</tr> </tr>
Loading…
Cancel
Save