Use a modal form to create a category from the issue form.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9707 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-05-24 17:31:53 +00:00
parent 6206c88dfa
commit c77370a9eb
4 changed files with 36 additions and 11 deletions
@@ -0,0 +1,9 @@
<h3 class="title"><%=l(:label_issue_category_new)%></h3>
<%= labelled_remote_form_for @category, :as => 'issue_category', :url => project_issue_categories_path(@project) do |f| %>
<%= render :partial => 'issue_categories/form', :locals => { :f => f } %>
<p class="buttons">
<%= submit_tag l(:button_create), :name => nil %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>
+4 -6
View File
@@ -18,12 +18,10 @@
<% if @issue.safe_attribute?('category_id') && @issue.project.issue_categories.any? %>
<p><%= f.select :category_id, (@issue.project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
<%= prompt_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'),
l(:label_issue_category_new),
'issue_category[name]',
{:controller => 'issue_categories', :action => 'create', :project_id => @issue.project},
:title => l(:label_issue_category_new),
:tabindex => 199) if User.current.allowed_to?(:manage_categories, @issue.project) %></p>
<%= link_to_remote(image_tag('add.png', :style => 'vertical-align: middle;'),
{:url => new_project_issue_category_path(@issue.project), :method => 'get'},
:title => l(:label_issue_category_new),
:tabindex => 200) if User.current.allowed_to?(:manage_categories, @issue.project) %></p>
<% end %>
<% if @issue.safe_attribute?('fixed_version_id') && @issue.assignable_versions.any? %>