Nicolae Claudius
13 years ago
8 changed files with 78 additions and 5 deletions
@ -1,2 +1,5 @@
|
||||
module RecordsHelper |
||||
def record_authentication_token_column(record) |
||||
record.type == 'A' ? record.authentication_token : '-' |
||||
end |
||||
end |
@ -0,0 +1,16 @@
|
||||
<%# add :controller_id => :as_records to respond in records list, not a's %> |
||||
|
||||
<% |
||||
record = list_record if list_record # compat with render :partial :collection |
||||
columns ||= list_columns |
||||
tr_class = cycle("", "even-record") |
||||
tr_class += " #{list_row_class(record)}" if respond_to? :list_row_class |
||||
url_options = params_for(:action => :list, :id => record.id) |
||||
action_links ||= active_scaffold_config.action_links.member |
||||
-%> |
||||
|
||||
<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 %>"> |
||||
<%= render :partial => 'list_record_columns', :locals => {:record => record, :columns => columns} %> |
||||
<%= render :partial => 'list_actions', :locals => {:record => record, :url_options => url_options, :action_links => action_links} unless action_links.empty? %> |
||||
<%= render_nested_view(action_links, url_options, record) unless @nested_auto_open.nil? %> |
||||
</tr> |
@ -0,0 +1,15 @@
|
||||
<%# add :controller_id => :as_records to respond in records list, not a's %> |
||||
|
||||
<%if controller.send :successful?%> |
||||
ActiveScaffold.replace_html('<%=active_scaffold_messages_id(:controller_id => :as_records)%>','<%=escape_javascript(render(:partial => 'messages'))%>'); |
||||
<%if @record%> |
||||
ActiveScaffold.update_row('<%=element_row_id(:controller_id => :as_records, :action => :list, :id => @record.id)%>','<%=escape_javascript(render(:partial => 'list_record', :locals => {:record => @record}))%>'); |
||||
<%end%> |
||||
<% if active_scaffold_config.list.columns.any? {|c| c.calculation?}%> |
||||
ActiveScaffold.replace('<%=active_scaffold_calculations_id(:controller_id => :as_records)%>', '<%=escape_javascript(render(:partial => 'list_calculations'))%>'); |
||||
<% end %> |
||||
<%else%> |
||||
<%flash[:error] = active_scaffold_error_messages_for(@record, :object_name => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :header_message => '', :message => "#{@record.class.model_name.human.downcase}#{@record.new_record? ? '' : ": #{@record.to_label}"}", :container_tag => nil, :list_type => :br)%> |
||||
ActiveScaffold.replace_html('<%=active_scaffold_messages_id(:controller_id => :as_records)%>','<%=escape_javascript(render(:partial => 'messages'))%>'); |
||||
ActiveScaffold.scroll_to('<%=active_scaffold_messages_id(:controller_id => :as_records)%>'); |
||||
<%end%> |
Loading…
Reference in new issue