##// END OF EJS Templates
Adds a 'New version' link on the roadmap....
Jean-Philippe Lang -
r6049:7d658e1477fc
parent child
Show More
@@ -79,7 +79,7 class VersionsController < ApplicationController
79 respond_to do |format|
79 respond_to do |format|
80 format.html do
80 format.html do
81 flash[:notice] = l(:notice_successful_create)
81 flash[:notice] = l(:notice_successful_create)
82 redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
82 redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
83 end
83 end
84 format.js do
84 format.js do
85 # IE doesn't support the replace_html rjs method for select box options
85 # IE doesn't support the replace_html rjs method for select box options
@@ -108,7 +108,7 class VersionsController < ApplicationController
108 attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
108 attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
109 if @version.update_attributes(attributes)
109 if @version.update_attributes(attributes)
110 flash[:notice] = l(:notice_successful_update)
110 flash[:notice] = l(:notice_successful_update)
111 redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
111 redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
112 else
112 else
113 respond_to do |format|
113 respond_to do |format|
114 format.html { render :action => 'edit' }
114 format.html { render :action => 'edit' }
@@ -127,7 +127,7 class VersionsController < ApplicationController
127 def destroy
127 def destroy
128 if @version.fixed_issues.empty?
128 if @version.fixed_issues.empty?
129 @version.destroy
129 @version.destroy
130 redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
130 redirect_back_or_default :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
131 else
131 else
132 flash[:error] = l(:notice_unable_delete_version)
132 flash[:error] = l(:notice_unable_delete_version)
133 redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
133 redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project
@@ -1,3 +1,4
1 <%= back_url_hidden_field_tag %>
1 <%= error_messages_for 'version' %>
2 <%= error_messages_for 'version' %>
2
3
3 <div class="box">
4 <div class="box">
@@ -1,3 +1,7
1 <div class="contextual">
2 <%= link_to l(:label_version_new), {:controller => 'versions', :action => 'new'}, :class => 'icon icon-add' if User.current.allowed_to?(:manage_versions, @project) %>
3 </div>
4
1 <h2><%=l(:label_roadmap)%></h2>
5 <h2><%=l(:label_roadmap)%></h2>
2
6
3 <% if @versions.empty? %>
7 <% if @versions.empty? %>
@@ -1,6 +1,8
1 <div class="contextual">
1 <div class="contextual">
2 <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %>
2 <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => @version}, :class => 'icon icon-edit' %>
3 <%= 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? %>
3 <%= 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? %>
4 <%= 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)},
5 :confirm => l(:text_are_you_sure), :method => :delete, :class => 'icon icon-del' %>
4 <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
6 <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
5 </div>
7 </div>
6
8
General Comments 0
You need to be logged in to leave comments. Login now