diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 7fb0b50da..f59fba784 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -160,6 +160,9 @@ class IssuesController < ApplicationController end def show + # 顶部导航 + @project_menu_type = 2 + # 打开编辑内容 @is_edit = true unless params[:edit].nil? @@ -217,6 +220,9 @@ class IssuesController < ApplicationController # Add a new issue # The new issue will be created from an existing one if copy_from parameter is given def new + # 顶部导航 + @project_menu_type = 2 + respond_to do |format| format.html { render :action => 'new', :layout => 'base_projects' } end diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb index 0c5057a40..b7d9c5ffc 100644 --- a/app/controllers/versions_controller.rb +++ b/app/controllers/versions_controller.rb @@ -35,7 +35,6 @@ class VersionsController < ApplicationController # 顶部导航 @project_menu_type = 7 type = params[:type] - version_all_count = Version.where(:project_id => @project.id).order("created_on desc") case type when nil,"1" @versions = @project.versions @@ -147,14 +146,12 @@ class VersionsController < ApplicationController # @version.safe_attributes = params[:version] # respond_to do |format| - @is_issue = params[:is_issue] + @is_setting = params[:is_setting] @is_create = params[:is_create] + @is_issue = params[:is_issue] + @issue_project_id = params[:issue_project_id] #@@issue = Issue.find(params[:issue].to_i) - format.js{ - unless @is_create - redirect_to settings_project_url(@project, :tab => 'versions') - end - } + format.js end end @@ -163,6 +160,8 @@ class VersionsController < ApplicationController @is_setting = params[:is_setting] @is_issue = params[:is_issue] @is_create = params[:is_create] + @issue_project_id = params[:issue_project_id] + # @issue = current_issue @version = @project.versions.build @@ -174,10 +173,13 @@ class VersionsController < ApplicationController if request.post? if @version.save respond_to do |format| - format.html do - flash[:notice] = l(:notice_successful_create) - redirect_to settings_project_url(@project, :tab => 'versions') - end + format.html{ + if @is_create + redirect_to project_versions_path(@project) + elsif @is_issue + redirect_to new_project_issue_path(@project) + end + } format.js format.api do render :action => 'show', :status => :created, :location => version_url(@version) diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index ed6d5e9fd..c8883bd78 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -103,8 +103,9 @@