code format cleanup app/views/projects/settings/_members.html.erb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12099 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
3acefa8923
commit
adebdc835f
|
@ -18,19 +18,29 @@
|
|||
<td class="<%= member.principal.class.name.downcase %>"><%= link_to_user member.principal %></td>
|
||||
<td class="roles">
|
||||
<span id="member-<%= member.id %>-roles"><%= member.roles.sort.collect(&:to_s).join(', ') %></span>
|
||||
<%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
|
||||
:method => :put,
|
||||
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
|
||||
<%= form_for(member,
|
||||
{:as => :membership, :remote => true,
|
||||
:url => membership_path(member),
|
||||
:method => :put,
|
||||
:html => { :id => "member-#{member.id}-roles-form", :class => 'hol' }}
|
||||
) do |f| %>
|
||||
<p><% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect {|mr| mr.role_id == role.id && !mr.inherited_from.nil?} %> <%= role %></label><br />
|
||||
<% end %></p>
|
||||
<p>
|
||||
<% roles.each do |role| %>
|
||||
<label>
|
||||
<%= check_box_tag('membership[role_ids][]',
|
||||
role.id, member.roles.include?(role),
|
||||
:disabled => member.member_roles.detect {
|
||||
|mr| mr.role_id == role.id && !mr.inherited_from.nil?
|
||||
} ) %> <%= role %>
|
||||
</label><br />
|
||||
<% end %>
|
||||
</p>
|
||||
<%= hidden_field_tag 'membership[role_ids][]', '' %>
|
||||
<p><%= submit_tag l(:button_save), :class => "small" %>
|
||||
<%= link_to_function l(:button_cancel),
|
||||
"$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;"
|
||||
%></p>
|
||||
<p>
|
||||
<%= submit_tag l(:button_save), :class => "small" %>
|
||||
<%= link_to_function(l(:button_cancel),
|
||||
"$('#member-#{member.id}-roles').show(); $('#member-#{member.id}-roles-form').hide(); return false;") %>
|
||||
</p>
|
||||
<% end %>
|
||||
</td>
|
||||
<td class="buttons">
|
||||
|
@ -53,22 +63,26 @@
|
|||
|
||||
<div class="splitcontentright">
|
||||
<% if roles.any? %>
|
||||
<%= form_for(@member, {:as => :membership, :url => project_memberships_path(@project), :remote => true, :method => :post}) do |f| %>
|
||||
<fieldset><legend><%=l(:label_member_new)%></legend>
|
||||
|
||||
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
|
||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
|
||||
|
||||
<div id="principals_for_new_member">
|
||||
<%= render_principals_for_new_members(@project) %>
|
||||
</div>
|
||||
|
||||
<p><%= l(:label_role_plural) %>:
|
||||
<% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= role %></label>
|
||||
<% end %></p>
|
||||
|
||||
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
|
||||
<%= form_for(@member,
|
||||
{:as => :membership, :url => project_memberships_path(@project),
|
||||
:remote => true, :method => :post}) do |f| %>
|
||||
<fieldset>
|
||||
<legend><%=l(:label_member_new)%></legend>
|
||||
<p>
|
||||
<%= label_tag("principal_search", l(:label_principal_search)) %>
|
||||
<%= text_field_tag('principal_search', nil) %>
|
||||
</p>
|
||||
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript autocomplete_project_memberships_path(@project, :format => 'js') }')" %>
|
||||
<div id="principals_for_new_member">
|
||||
<%= render_principals_for_new_members(@project) %>
|
||||
</div>
|
||||
<p>
|
||||
<%= l(:label_role_plural) %>:
|
||||
<% roles.each do |role| %>
|
||||
<label><%= check_box_tag 'membership[role_ids][]', role.id %> <%= role %></label>
|
||||
<% end %>
|
||||
</p>
|
||||
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue