summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/versions_controller.rb6
-rw-r--r--app/views/versions/_form.rhtml1
-rw-r--r--app/views/versions/index.html.erb4
-rw-r--r--app/views/versions/show.rhtml2
4 files changed, 10 insertions, 3 deletions
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb
index 03af71b99..30d8f3bf2 100644
--- a/app/controllers/versions_controller.rb
+++ b/app/controllers/versions_controller.rb
@@ -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
diff --git a/app/views/versions/_form.rhtml b/app/views/versions/_form.rhtml
index b829cf2f8..61bba046c 100644
--- a/app/views/versions/_form.rhtml
+++ b/app/views/versions/_form.rhtml
@@ -1,3 +1,4 @@
+<%= back_url_hidden_field_tag %>
<%= error_messages_for 'version' %>
<div class="box">
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb
index d0c5dcac1..e8acb3d01 100644
--- a/app/views/versions/index.html.erb
+++ b/app/views/versions/index.html.erb
@@ -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? %>
diff --git a/app/views/versions/show.rhtml b/app/views/versions/show.rhtml
index a769274bf..5fcdf8b82 100644
--- a/app/views/versions/show.rhtml
+++ b/app/views/versions/show.rhtml
@@ -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>