diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-05 20:45:04 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2006-12-05 20:45:04 +0000 |
commit | 96f83cc8f0f032554f771a59da22303cd473b878 (patch) | |
tree | 355a0d2ed653a5426c59ebf6a1fe65eba024b4d0 /app/views/roles | |
parent | eabc04d8368824965d3ac8de3fa84502e9c05d38 (diff) | |
download | redmine-96f83cc8f0f032554f771a59da22303cd473b878.tar.gz redmine-96f83cc8f0f032554f771a59da22303cd473b878.zip |
trunk moved from /trunk/redmine to /trunk
git-svn-id: http://redmine.rubyforge.org/svn/trunk@67 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/roles')
-rw-r--r-- | app/views/roles/_form.rhtml | 20 | ||||
-rw-r--r-- | app/views/roles/edit.rhtml | 6 | ||||
-rw-r--r-- | app/views/roles/list.rhtml | 21 | ||||
-rw-r--r-- | app/views/roles/new.rhtml | 6 | ||||
-rw-r--r-- | app/views/roles/workflow.rhtml | 71 |
5 files changed, 124 insertions, 0 deletions
diff --git a/app/views/roles/_form.rhtml b/app/views/roles/_form.rhtml new file mode 100644 index 000000000..e0ab1c099 --- /dev/null +++ b/app/views/roles/_form.rhtml @@ -0,0 +1,20 @@ +<%= error_messages_for 'role' %> +<div class="box"> +<!--[form:role]-->
+<p><%= f.text_field :name, :required => true %></p>
+
+<strong><%=l(:label_permissions)%>:</strong>
+<% permissions = @permissions.group_by {|p| p.group_id } %>
+<% permissions.keys.sort.each do |group_id| %> +<fieldset style="margin-top: 6px;"><legend><strong><%= l(Permission::GROUPS[group_id]) %></strong></legend>
+<% permissions[group_id].each do |p| %>
+ <div style="width:170px;float:left;"><%= check_box_tag "permission_ids[]", p.id, (@role.permissions.include? p) %>
+ <%= l(p.description.to_sym) %>
+ </div>
+<% end %>
+</fieldset>
+<% end %>
+<br /> +<%= check_all_links 'role_form' %>
+<!--[eoform:role]--> +</div> diff --git a/app/views/roles/edit.rhtml b/app/views/roles/edit.rhtml new file mode 100644 index 000000000..ffe117cef --- /dev/null +++ b/app/views/roles/edit.rhtml @@ -0,0 +1,6 @@ +<h2><%=l(:label_role)%></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 %>
diff --git a/app/views/roles/list.rhtml b/app/views/roles/list.rhtml new file mode 100644 index 000000000..169b3d1c0 --- /dev/null +++ b/app/views/roles/list.rhtml @@ -0,0 +1,21 @@ +<h2><%=l(:label_role_plural)%></h2> + +<table class="listTableContent"> + <tr class="ListHead"> + <th><%=l(:label_role)%></th> + <th></th> + </tr> + +<% for role in @roles %> + <tr class="<%= cycle("odd", "even") %>"> + <td><%= link_to role.name, :action => 'edit', :id => role %></td> + <td align="center"> + <%= button_to l(:button_delete), { :action => 'destroy', :id => role }, :confirm => l(:text_are_you_sure), :class => "button-small" %>
+ </tr> +<% end %> +</table> +
+<%= pagination_links_full @role_pages %> +<br /> + +<%= link_to '» ' + l(:label_role_new), :action => 'new' %> diff --git a/app/views/roles/new.rhtml b/app/views/roles/new.rhtml new file mode 100644 index 000000000..a73c36cb1 --- /dev/null +++ b/app/views/roles/new.rhtml @@ -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 %>
\ No newline at end of file diff --git a/app/views/roles/workflow.rhtml b/app/views/roles/workflow.rhtml new file mode 100644 index 000000000..ee5b3a278 --- /dev/null +++ b/app/views/roles/workflow.rhtml @@ -0,0 +1,71 @@ +<h2><%=l(:label_workflow)%></h2>
+
+<p><%=l(:text_workflow_edit)%>:</p>
+
+<%= start_form_tag ({:action => 'workflow'}, :method => 'get') %>
+<div style="float:left;margin-right:10px;">
+<p><label for="role_id"><%=l(:label_role)%></label><br/>
+<select id="role_id" name="role_id">
+ <%= options_from_collection_for_select @roles, "id", "name", (@role.id unless @role.nil?) %>
+</select></p>
+</div>
+
+<div>
+<p><label for="tracker_id"><%=l(:label_tracker)%></label><br/>
+<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>
+</div>
+<%= end_form_tag %>
+
+
+
+<% unless @tracker.nil? or @role.nil? %>
+<div class="box">
+ <%= form_tag ({:action => 'workflow', :role_id => @role, :tracker_id => @tracker }, :id => 'workflow_form' ) %>
+ <table>
+ <tr>
+ <td align="center" colspan="2"><strong><%=l(:label_current_status)%></strong></td>
+ <td align="center" colspan="<%= @statuses.length %>"><strong><%=l(:label_new_statuses_allowed)%></strong></td>
+ </tr>
+ <tr>
+ <td colspan="2"></td>
+ <% for new_status in @statuses %>
+ <td width="80" align="center"><%= new_status.name %></td>
+ <% end %>
+ </tr>
+
+ <% for old_status in @statuses %>
+ <tr>
+ <td width="20" align="center"><div style="background-color:#<%= old_status.html_color %>"> </div></td>
+ <td><%= old_status.name %></td>
+
+ <% for new_status in @statuses %>
+ <td align="center">
+
+ <input type="checkbox"
+ name="issue_status[<%= old_status.id %>][]"
+ value="<%= new_status.id %>"
+ <%if old_status.new_statuses_allowed_to(@role, @tracker).include? new_status%>checked="checked"<%end%>
+ <%if old_status==new_status%>disabled<%end%>
+ >
+ </td>
+ <% end %>
+
+ </tr>
+ <% end %>
+ </table>
+<br />
+<p>
+<a href="javascript:checkAll('workflow_form', true)"><%=l(:button_check_all)%></a> |
+<a href="javascript:checkAll('workflow_form', false)"><%=l(:button_uncheck_all)%></a>
+</p>
+<br />
+<%= submit_tag l(:button_save) %> +<%= end_form_tag %>
+
+<% end %>
+</div>
\ No newline at end of file |