Adds a branch for unlimited project hierarchy.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/work@2148 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<%= error_messages_for 'role' %>
|
||||
|
||||
<% unless @role.builtin? %>
|
||||
<div class="box">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.check_box :assignable %></p>
|
||||
<% if @role.new_record? && @roles.any? %>
|
||||
<p><label><%= l(:label_copy_workflow_from) %></label>
|
||||
<%= select_tag(:copy_workflow_from, content_tag("option") + options_from_collection_for_select(@roles, :id, :name)) %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<h3><%= l(:label_permissions) %></h3>
|
||||
<div class="box" id="permissions">
|
||||
<% perms_by_module = @permissions.group_by {|p| p.project_module.to_s} %>
|
||||
<% perms_by_module.keys.sort.each do |mod| %>
|
||||
<fieldset><legend><%= mod.blank? ? l(:label_project) : l_or_humanize(mod, :prefix => 'project_module_') %></legend>
|
||||
<% perms_by_module[mod].each do |permission| %>
|
||||
<label class="floating">
|
||||
<%= check_box_tag 'role[permissions][]', permission.name, (@role.permissions.include? permission.name) %>
|
||||
<%= l_or_humanize(permission.name, :prefix => 'permission_') %>
|
||||
</label>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<br /><%= check_all_links 'permissions' %>
|
||||
<%= hidden_field_tag 'role[permissions][]', '' %>
|
||||
</div>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h2><%=l(:label_role)%>: <%= @role.name %></h2>
|
||||
|
||||
<% labelled_tabular_form_for :role, @role, :url => { :action => 'edit' }, :html => {:id => 'role_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,37 @@
|
||||
<div class="contextual">
|
||||
<%= link_to l(:label_role_new), {:action => 'new'}, :class => 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<h2><%=l(:label_role_plural)%></h2>
|
||||
|
||||
<table class="list">
|
||||
<thead><tr>
|
||||
<th><%=l(:label_role)%></th>
|
||||
<th><%=l(:button_sort)%></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<% for role in @roles %>
|
||||
<tr class="<%= cycle("odd", "even") %>">
|
||||
<td><%= content_tag(role.builtin? ? 'em' : 'span', link_to(role.name, :action => 'edit', :id => role)) %></td>
|
||||
<td align="center" style="width:15%;">
|
||||
<% unless role.builtin? %>
|
||||
<%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:action => 'move', :id => role, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %>
|
||||
<%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:action => 'move', :id => role, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> -
|
||||
<%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:action => 'move', :id => role, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %>
|
||||
<%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:action => 'move', :id => role, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td align="center" style="width:10%;">
|
||||
<%= button_to(l(:button_delete), { :action => 'destroy', :id => role }, :confirm => l(:text_are_you_sure), :class => "button-small", :disabled => role.builtin? ) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<p class="pagination"><%= pagination_links_full @role_pages %></p>
|
||||
|
||||
<p><%= link_to l(:label_permissions_report), :action => 'report' %></p>
|
||||
|
||||
<% html_title(l(:label_role_plural)) -%>
|
||||
@@ -0,0 +1,6 @@
|
||||
<h2><%=l(:label_role_new)%></h2>
|
||||
|
||||
<% labelled_tabular_form_for :role, @role, :url => { :action => 'new' }, :html => {:id => 'role_form'} do |f| %>
|
||||
<%= render :partial => 'form', :locals => { :f => f } %>
|
||||
<%= submit_tag l(:button_create) %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,45 @@
|
||||
<h2><%=l(:label_permissions_report)%></h2>
|
||||
|
||||
<% form_tag({:action => 'report'}, :id => 'permissions_form') do %>
|
||||
<%= hidden_field_tag 'permissions[0]', '', :id => nil %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%=l(:label_permissions)%></th>
|
||||
<% @roles.each do |role| %>
|
||||
<th>
|
||||
<%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %>
|
||||
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.role-#{role.id}')",
|
||||
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||||
</th>
|
||||
<% end %>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% perms_by_module = @permissions.group_by {|p| p.project_module.to_s} %>
|
||||
<% perms_by_module.keys.sort.each do |mod| %>
|
||||
<% unless mod.blank? %>
|
||||
<tr><%= content_tag('th', l_or_humanize(mod, :prefix => 'project_module_'), :colspan => (@roles.size + 1), :align => 'left') %></tr>
|
||||
<% end %>
|
||||
<% perms_by_module[mod].each do |permission| %>
|
||||
<tr class="<%= cycle('odd', 'even') %> permission-<%= permission.name %>">
|
||||
<td>
|
||||
<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('.permission-#{permission.name} input')",
|
||||
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
|
||||
<%= l_or_humanize(permission.name, :prefix => 'permission_') %>
|
||||
</td>
|
||||
<% @roles.each do |role| %>
|
||||
<td align="center">
|
||||
<% if role.setable_permissions.include? permission %>
|
||||
<%= check_box_tag "permissions[#{role.id}][]", permission.name, (role.permissions.include? permission.name), :id => nil, :class => "role-#{role.id}" %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><%= check_all_links 'permissions_form' %></p>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<% end %>
|
||||
Reference in New Issue
Block a user