* 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
pull/351/head
Jean-Philippe Lang 18 years ago
parent 57d4e698fe
commit 470ef4d11e
  1. 5
      app/controllers/projects_controller.rb
  2. 5
      app/views/issues/_add_shortcut.rhtml
  3. 12
      app/views/projects/list_issues.rhtml
  4. 13
      app/views/projects/show.rhtml

@ -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

@ -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 %>

@ -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' %>

@ -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' %>
&#187; <%=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>

Loading…
Cancel
Save