Adds a 'New version' link on the roadmap.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6169 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-07-03 12:56:27 +00:00
parent f2af44b6fe
commit 7d658e1477
4 changed files with 10 additions and 3 deletions

View File

@ -79,7 +79,7 @@ class VersionsController < ApplicationController
respond_to do |format| respond_to do |format|
format.html do format.html do
flash[:notice] = l(:notice_successful_create) 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 end
format.js do format.js do
# IE doesn't support the replace_html rjs method for select box options # 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']) attributes.delete('sharing') unless @version.allowed_sharings.include?(attributes['sharing'])
if @version.update_attributes(attributes) if @version.update_attributes(attributes)
flash[:notice] = l(:notice_successful_update) 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 else
respond_to do |format| respond_to do |format|
format.html { render :action => 'edit' } format.html { render :action => 'edit' }
@ -127,7 +127,7 @@ class VersionsController < ApplicationController
def destroy def destroy
if @version.fixed_issues.empty? if @version.fixed_issues.empty?
@version.destroy @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 else
flash[:error] = l(:notice_unable_delete_version) flash[:error] = l(:notice_unable_delete_version)
redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project redirect_to :controller => 'projects', :action => 'settings', :tab => 'versions', :id => @project

View File

@ -1,3 +1,4 @@
<%= back_url_hidden_field_tag %>
<%= error_messages_for 'version' %> <%= error_messages_for 'version' %>
<div class="box"> <div class="box">

View 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> <h2><%=l(:label_roadmap)%></h2>
<% if @versions.empty? %> <% if @versions.empty? %>

View File

@ -1,6 +1,8 @@
<div class="contextual"> <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), {: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_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 }) %> <%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
</div> </div>