User groups branch added.
git-svn-id: http://redmine.rubyforge.org/svn/branches/work@1372 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">
|
||||
<% 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) : mod.humanize %></legend>
|
||||
<% perms_by_module[mod].each do |permission| %>
|
||||
<label class="floating">
|
||||
<%= check_box_tag 'role[permissions][]', permission.name, (@role.permissions.include? permission.name) %>
|
||||
<%= permission.name.to_s.humanize %>
|
||||
</label>
|
||||
<% end %>
|
||||
</fieldset>
|
||||
<% end %>
|
||||
<br /><%= check_all_links 'role_form' %>
|
||||
<%= 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,37 @@
|
||||
<h2><%=l(:label_permissions_report)%></h2>
|
||||
|
||||
<% form_tag({:action => 'report'}, :id => 'permissions_form') do %>
|
||||
<%= hidden_field_tag 'permissions[0]', '' %>
|
||||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%=l(:label_permissions)%></th>
|
||||
<% @roles.each do |role| %>
|
||||
<th><%= content_tag(role.builtin? ? 'em' : 'span', h(role.name)) %></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', mod.humanize, :colspan => (@roles.size + 1), :align => 'left') %></tr>
|
||||
<% end %>
|
||||
<% perms_by_module[mod].each do |permission| %>
|
||||
<tr class="<%= cycle('odd', 'even') %>">
|
||||
<td><%= permission.name.to_s.humanize %></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) %>
|
||||
<% end %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<p><%= check_all_links 'permissions_form' %></p>
|
||||
<p><%= submit_tag l(:button_save) %></p>
|
||||
<% end %>
|
||||
@@ -0,0 +1,58 @@
|
||||
<h2><%=l(:label_workflow)%></h2>
|
||||
|
||||
<p><%=l(:text_workflow_edit)%>:</p>
|
||||
|
||||
<% form_tag({:action => 'workflow'}, :method => 'get') do %>
|
||||
<p><label for="role_id"><%=l(:label_role)%>:</label>
|
||||
<select id="role_id" name="role_id">
|
||||
<%= options_from_collection_for_select @roles, "id", "name", (@role.id unless @role.nil?) %>
|
||||
</select>
|
||||
|
||||
<label for="tracker_id"><%=l(:label_tracker)%>:</label>
|
||||
<select id="tracker_id" name="tracker_id">
|
||||
<%= options_from_collection_for_select @trackers, "id", "name", (@tracker.id unless @tracker.nil?) %>
|
||||
</select>
|
||||
<%= submit_tag l(:button_edit) %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
<% unless @tracker.nil? or @role.nil? %>
|
||||
<% form_tag({:action => 'workflow', :role_id => @role, :tracker_id => @tracker }, :id => 'workflow_form' ) do %>
|
||||
<div class="box">
|
||||
<table>
|
||||
<tr>
|
||||
<td align="center"><strong><%=l(:label_current_status)%></strong></td>
|
||||
<td align="center" colspan="<%= @statuses.length %>"><strong><%=l(:label_new_statuses_allowed)%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<% for new_status in @statuses %>
|
||||
<td width="80" align="center"><%= new_status.name %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
|
||||
<% for old_status in @statuses %>
|
||||
<tr>
|
||||
<td><%= old_status.name %></td>
|
||||
<% new_status_ids_allowed = old_status.find_new_statuses_allowed_to(@role, @tracker).collect(&:id) -%>
|
||||
<% for new_status in @statuses -%>
|
||||
<td align="center">
|
||||
<input type="checkbox"
|
||||
name="issue_status[<%= old_status.id %>][]"
|
||||
value="<%= new_status.id %>"
|
||||
<%= 'checked="checked"' if new_status_ids_allowed.include? new_status.id %>>
|
||||
</td>
|
||||
<% end -%>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<p><%= check_all_links 'workflow_form' %></p>
|
||||
</div>
|
||||
<%= submit_tag l(:button_save) %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% html_title(l(:label_workflow)) -%>
|
||||
Reference in New Issue
Block a user