diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-01-02 09:58:07 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-01-02 09:58:07 +0000 |
commit | 470ef4d11ee7465c7cc2ca19fd4535fec061395b (patch) | |
tree | 43822af536dd7ce6b3e441395ba4a92d9f1b2522 | |
parent | 57d4e698fe59773b692b9e2f86cea6c9790ad191 (diff) | |
download | redmine-470ef4d11ee7465c7cc2ca19fd4535fec061395b.tar.gz redmine-470ef4d11ee7465c7cc2ca19fd4535fec061395b.zip |
* replaced "add_issue" links on projects/show by a drop down list
* added this shortcut on list_issues
git-svn-id: http://redmine.rubyforge.org/svn/trunk@136 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/projects_controller.rb | 5 | ||||
-rw-r--r-- | app/views/issues/_add_shortcut.rhtml | 5 | ||||
-rw-r--r-- | app/views/projects/list_issues.rhtml | 12 | ||||
-rw-r--r-- | app/views/projects/show.rhtml | 13 |
4 files changed, 20 insertions, 15 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 53293340e..c3d54dfe9 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -1,5 +1,5 @@ # redMine - project management software
-# Copyright (C) 2006 Jean-Philippe Lang
+# Copyright (C) 2006-2007 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -239,7 +239,8 @@ class ProjectsController < ApplicationController :conditions => @query.statement,
:limit => @issue_pages.items_per_page,
:offset => @issue_pages.current.offset
- end
+ end
+ @trackers = Tracker.find :all
render :layout => false if request.xhr?
end
diff --git a/app/views/issues/_add_shortcut.rhtml b/app/views/issues/_add_shortcut.rhtml new file mode 100644 index 000000000..f48907777 --- /dev/null +++ b/app/views/issues/_add_shortcut.rhtml @@ -0,0 +1,5 @@ +<% if authorize_for('projects', 'add_issue') %>
+<%= start_form_tag({ :controller => 'projects', :action => 'add_issue', :id => @project }, :method => 'get') %>
+<%= l(:label_issue_new) %>: <%= select_tag 'tracker_id', ("<option></option>" + options_from_collection_for_select(trackers, 'id', 'name')), :onchange => "if (this.value!='') {this.form.submit();}" %>
+<%= end_form_tag %>
+<% end %>
diff --git a/app/views/projects/list_issues.rhtml b/app/views/projects/list_issues.rhtml index a8b1db7bc..7ccc59611 100644 --- a/app/views/projects/list_issues.rhtml +++ b/app/views/projects/list_issues.rhtml @@ -1,4 +1,7 @@ <% if @query.new_record? %>
+ <div class="contextual">
+ <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
+ </div>
<h2><%=l(:label_issue_plural)%></h2>
<%= start_form_tag({:action => 'list_issues'}, :id => 'query_form') %>
@@ -24,12 +27,13 @@ </div>
<br />
<% else %>
- <% if authorize_for('projects', 'add_query') %>
<div class="contextual">
- <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'pic picEdit' %>
- <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
+ <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
+ <% if authorize_for('projects', 'add_query') %>
+ <%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'pic picEdit' %>
+ <%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %>
+ <% end %>
</div>
- <% end %>
<h2><%= @query.name %></h2>
<% end %>
<%= error_messages_for 'query' %>
diff --git a/app/views/projects/show.rhtml b/app/views/projects/show.rhtml index d5da126e2..518ec38ff 100644 --- a/app/views/projects/show.rhtml +++ b/app/views/projects/show.rhtml @@ -13,6 +13,9 @@ </ul>
<div class="box">
+ <div class="contextual">
+ <%= render :partial => 'issues/add_shortcut', :locals => {:trackers => @trackers } %>
+ </div>
<h3><%= image_tag "tracker" %> <%=l(:label_tracker_plural)%></h3>
<ul>
<% for tracker in @trackers %>
@@ -23,15 +26,7 @@ <%= lwr(:label_open_issues, issue_count) %>
</li>
<% end %>
- </ul> - <% if authorize_for 'projects', 'add_issue' %>
- » <%=l(:label_issue_new)%>:
- <ul>
- <% @trackers.each do |tracker| %>
- <li><%= link_to tracker.name, :controller => 'projects', :action => 'add_issue', :id => @project, :tracker_id => tracker %></li>
- <% end %>
- </ul>
- <% end %> + </ul>
<center><small><%= link_to l(:label_issue_view_all), :controller => 'projects', :action => 'list_issues', :id => @project, :set_filter => 1 %></small></center>
</div> </div>
|