cirandas.net

ref: master

app/views/profile_members/_manage_roles.html.erb


<%= form_tag :action => 'save_associations' do %>
  <% @roles.each do |role|%>
    <%= content_tag('p', content_tag('b', role.name.pluralize+':'), :style => 'margin-top: 30px; margin-bottom: 0px;') %>
    <%= text_field_tag('q_'+role.key, nil, :id => 'search_'+role.key) %>
    <%= hidden_field_tag(:last_admin, true) if from == 'last_admin'%>
  <% end %>

  <%= button_bar(:style => 'margin-top: 30px;') do %>
    <%= submit_button('save', _('Save'))%>
    <%= button('cancel', _('Cancel'), {:controller => 'profile_editor'})%>
  <% end %>
<% end %>

<% @roles.each do |role| %>
  <% search_url = url_for(:controller => :profile_members, :action => 'search_user', :profile => profile.identifier, :role => role.id) %>
  <% pre_population = params[:action] == 'last_admin' ? [].to_json : profile.members_by_role_to_json(role) %>
  
<% end %>