projects_role.codeviewer=Code Viewers
projects_role.codeviewer.desc=Ability to view the source code of the project.
projects_role.bulk_change=Bulk Change
-projects_role.apply_template.form.title=Apply permission template
+projects_role.apply_template=Apply permission template
+projects_role.apply_template_to_xxx=Apply permission template to {0}
projects_role.no_projects=There are currently no results to apply the permission template to.
permission_template.edit_permissions=Edit permissions
permission_template.update_permissions=Save
permission_template.no_results=No template to display
+permission_template.set_default_templates=Set default templates
#------------------------------------------------------------------------------
# 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]}
- render :partial => 'apply_template_form', :locals => {:components => params[:projects], :qualifier => params[:qualifier] || 'TRK'}
+ render :partial => 'apply_template_form', :locals => {:components => params[:projects], :project_name => params[:project_name], :qualifier => params[:qualifier] || 'TRK'}
end
# POST /roles/apply_template?criteria
<% end %>
<fieldset>
<div class="modal-head">
- <h2><%= message('projects_role.apply_template.form.title', {:params => ''}) -%></h2>
+ <% if params[:project_name] %>
+ <h2><%= message('projects_role.apply_template_to_xxx', :params => params[:project_name]) -%></h2>
+ <% else %>
+ <h2><%= message('projects_role.apply_template') -%></h2>
+ <% end %>
</div>
<div class="modal-body">
<div class="apply-template errors error" style="display:none;"/>
<div class="modal-field">
<%= label_tag 'template_key', 'Permission template:' %>
<%= select_tag('template_key', options_for_select(@permission_templates, -1), :style => 'width: 250px;') %>
- <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}(s)" %>)</span><br/>
+ <% unless params[:project_name] %>
+ <span style="float:right" class="note">(<%= "#{components.size} #{message('qualifier.' + qualifier)}(s)" %>)</span><br/>
+ <% end %>
</div>
<% end %>
</div>
<th><%= message('projects_role.admin') -%></th>
<th><%= message('projects_role.user') -%></th>
<th><%= message('projects_role.codeviewer') -%></th>
+ <th></th>
</tr>
</thead>
(<%= link_to message('select groups'), {:action => :edit_groups, :role => 'codeviewer', :resource => project.id},
:id => "selectg-codeviewer-#{u project.kee}", :class => 'open-modal link-action', 'modal-width' => '760px' %>)<br/>
</td>
+ <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' %>
+ </td>
</tr>
<%
end %>