permission_template.delete_template=Delete
permission_template.edit_template=Edit permission template
permission_template.update_template=Update
-permission_template.edit_permissions=Edit permissions
+permission_template.edit_permissions=Edit permissions: {0}
permission_template.update_permissions=Save
permission_template.no_results=No template to display
permission_template.set_default_templates=Set default templates
def default_templates_form
all_templates = Internal.permission_templates.selectAllPermissionTemplates
- @permission_templates_options = all_templates.collect {|t| [t.name, t.key]}
+ @permission_templates_options = all_templates.sort_by {|t| t.name}.collect {|t| [t.name, t.key]}
@root_qualifiers = get_root_qualifiers
@default_templates = get_default_templates_per_qualifier(@root_qualifiers)
templates_names.each do |template_name|
permission_templates << Internal.permission_templates.selectPermissionTemplate(template_name)
end
- permission_templates
+ permission_templates.sort_by {|t| t.name}
end
end
# GET /roles/apply_template_form?projects=<projects>&qualifier=<qualifier>
def apply_template_form
- @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().collect {|pt| [pt.name, pt.key]}
+ @permission_templates = Internal.permission_templates.selectAllPermissionTemplates().sort_by {|t| t.name}.collect {|pt| [pt.name, pt.key]}
render :partial => 'apply_template_form', :locals => {:components => params[:projects], :project_name => params[:project_name], :qualifier => params[:qualifier] || 'TRK'}
end
def link_to_edit_roles_permission_form(label, role, resource_id, html_id)
link_to message(label), {:controller => :roles, :action => :edit_users, :role => role, :resource => resource_id},
- :id => html_id, :class => 'open-modal link-action', 'modal-width' => '780px'
+ :id => html_id, :class => 'open-modal link-action nowrap', 'modal-width' => '780px'
end
def link_to_edit_groups_permission_form(label, role, resource_id, html_id)
link_to message(label), {:controller => :roles, :action => :edit_groups, :role => role, :resource => resource_id},
- :id => html_id, :class => 'open-modal link-action', 'modal-width' => '780px'
+ :id => html_id, :class => 'open-modal link-action nowrap', 'modal-width' => '780px'
end
end
<input type="hidden" name="permission" value="<%= @permission -%>"/>
<fieldset>
<div class="modal-head">
- <h2><%= message('permission_template.edit_permissions') -%></h2>
+ <h2><%= message('permission_template.edit_permissions', :params => @permission_template.name) -%></h2>
</div>
<div class="modal-body">
<div id="permission-template-error" class="permission-template error" style="display:none;" />
<tbody>
<tr>
<td style="padding: 5px 0;" valign="top">
- <h2>Add Users</h2>
+ <h2>Add Groups</h2>
<select name="from" id="from" size="30" style="margin: 5px 0; width: 300px;" multiple="multiple">
<% @groups_without_permission.sort.each do |group| %>
<input type="hidden" name="permission" value="<%= @permission -%>"/>
<fieldset>
<div class="modal-head">
- <h2><%= message('permission_template.edit_permissions') -%></h2>
+ <h2><%= message('permission_template.edit_permissions', :params => @permission_template.name) -%></h2>
</div>
<div class="modal-body">
<div id="permission-template-error" class="permission-template error" style="display:none;" />
users=Api::Utils.insensitive_sort(permission_template.getUsersForPermission(permission).collect {|u| u.userName})
groups=Api::Utils.insensitive_sort(permission_template.getGroupsForPermission(permission).collect {|g| g.groupName.blank? ? 'Anyone' : g.groupName})
%>
- <span id="u-<%= permission -%>-<%= u permission_template.name -%>"><%= users.join(', ') %></span>
+ <span class="nowrap" id="u-<%= permission -%>-<%= u permission_template.name -%>"><%= users.join(', ') %></span>
(<%= link_to message('select users'), {:action => :edit_users, :name => permission_template.name, :permission => permission},
- :id => "selectu-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action', 'modal-width' => '780px' %>)<br/>
- <span id="g-<%= permission -%>-<%= u permission_template.name -%>"><%= groups.join(', ') %></span>
+ :id => "select-u-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action nowrap', 'modal-width' => '780px' %>)<br/>
+ <span class="nowrap" id="g-<%= permission -%>-<%= u permission_template.name -%>"><%= groups.join(', ') %></span>
(<%= link_to message('select groups'), {:action => :edit_groups, :name => permission_template.name, :permission => permission},
- :id => "selectg-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action', 'modal-width' => '780px' %>)<br/>
+ :id => "select-g-#{permission}-#{u permission_template.name}", :class => 'open-modal link-action nowrap', 'modal-width' => '780px' %>)<br/>
</td>
<% end %>
<td>
<%= label_tag 'template_key', 'Permission template:' %>
<%= select_tag('template_key', options_for_select(@permission_templates, -1), :style => 'width: 250px;') %>
<% unless params[:project_name] %>
- <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}(s)" %>)</span><br/>
+ <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}s" %>)</span><br/>
<% end %>
</div>
<% end %>
users=Api::Utils.insensitive_sort(project.user_roles.select { |ur| ur.role==permission }.map { |ur| ur.user.name })
groups=Api::Utils.insensitive_sort(project.group_roles.select { |gr| gr.role==permission }.map { |gr| group_name(gr.group) })
%>
- <span id="u-<%= permission -%>-<%= u project.kee -%>"><%= users.join(', ') %></span>
- (<%= link_to_edit_roles_permission_form(message('select users'), permission, project.id, "selectu-#{permission}-#{u project.kee}") %>)<br/>
- <span id="g-<%= permission -%>-<%= u project.kee -%>"><%= groups.join(', ') %></span>
- (<%= link_to_edit_groups_permission_form(message('select groups'), permission, project.id, "selectg-#{permission}-#{u project.kee}") %>)<br/>
+ <span class="nowrap" id="u-<%= permission -%>-<%= u project.kee -%>"><%= users.join(', ') %></span>
+ (<%= link_to_edit_roles_permission_form(message('select users'), permission, project.id, "select-u-#{permission}-#{u project.kee}") %>)<br/>
+ <span class="nowrap" id="g-<%= permission -%>-<%= u project.kee -%>"><%= groups.join(', ') %></span>
+ (<%= link_to_edit_groups_permission_form(message('select groups'), permission, project.id, "select-g-#{permission}-#{u project.kee}") %>)<br/>
</td>
<% end %>
<td align="right">
<%= link_to message('projects_role.apply_template'), {:action => :apply_template_form, :projects => [project.id], :project_name => project.name, :qualifier => @qualifier},
- :id => "apply-template-modal-#{project.id}", :class => 'open-modal link-action' %>
+ :id => "apply-template-#{u project.kee}", :class => 'open-modal link-action' %>
</td>
</tr>
<%