]> source.dussan.org Git - redmine.git/commitdiff
Adds a 'New version' link on the roadmap.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 3 Jul 2011 12:56:27 +0000 (12:56 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 3 Jul 2011 12:56:27 +0000 (12:56 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6169 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/versions_controller.rb
app/views/versions/_form.rhtml
app/views/versions/index.html.erb
app/views/versions/show.rhtml

index 03af71b993b67d6dad4da198bb73dba2b3572974..30d8f3bf2a28b35b83dbc250cb0ca7e2c1b664d4 100644 (file)
@@ -79,7 +79,7 @@ class VersionsController < ApplicationController
         respond_to do |format|
           format.html do
             flash[:notice] = l(:notice_successful_create)
-            redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
+            redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
           end
           format.js do
             # IE doesn't support the replace_html rjs method for select box options
@@ -108,7 +108,7 @@ class VersionsController < ApplicationController
       attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
       if @version.update_attributes(attributes)
         flash[:notice] = l(:notice_successful_update)
-        redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
+        redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
       else
         respond_to do |format|
           format.html { render :action => 'edit' }
@@ -127,7 +127,7 @@ class VersionsController < ApplicationController
   def destroy
     if @version.fixed_issues.empty?
       @version.destroy
-      redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
+      redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
     else
       flash[:error] = l(:notice_unable_delete_version)
       redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
index b829cf2f8a00d6741e3a3655fab338a34962755e..61bba046c51859a1633bb88ded6b15df3a13d69a 100644 (file)
@@ -1,3 +1,4 @@
+<%= back_url_hidden_field_tag %>
 <%= error_messages_for 'version' %>
 
 <div class="box">
index d0c5dcac1475be74877113fcbdcfad6816533946..e8acb3d01e0c01cd1582a3c9fcb46409a628622c 100644 (file)
@@ -1,3 +1,7 @@
+<div class="contextual">
+       <%= link_to l(:label_version_new), {:controller => 'versions', :action => 'new'}, :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %>
+</div>
+
 <h2><%=l(:label_roadmap)%></h2>
 
 <% if @versions.empty? %>
index a769274bfb007381c07a7f4d11edb12ec97c21b2..5fcdf8b826f44c4d4ee7f7aa82d2e63289705044 100644 (file)
@@ -1,6 +1,8 @@
 <div class="contextual">
 <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %>
 <%= link_to_if_authorized(l(:button_edit_associated_wikipage, :page_title => @version.wiki_page_title), {:controller => 'wiki', :action => 'edit', :project_id => @version.project, :id => Wiki.titleize(@version.wiki_page_title)}, :class => 'icon icon-edit') unless @version.wiki_page_title.blank? || @version.project.wiki.nil? %>
+<%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => @version, :back_url => url_for(:controller => 'versions', :action => 'index', :project_id => @version.project)}, 
+  :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %>
 <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
 </div>