各个页面里程碑的新建跳转

This commit is contained in:
huang 2016-10-27 16:33:00 +08:00
parent 86c977ca2d
commit ee275455de
6 changed files with 31 additions and 29 deletions

View File

@ -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

View File

@ -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)

View File

@ -103,8 +103,9 @@
</li>
<li class=" clear" id="milestone_option_tips">
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
<%= link_to "", new_project_version_path(@project, :is_issue => true, :issue => @issue), :class => "pic_add mt5 ml5 fr", :remote => true %>
<% if params[:action] == "new" %>
<%= link_to "", new_project_version_path(@project, :is_issue => true, :issue_project_id => @project.id), :class => "pic_add mt5 ml5 fr", :remote => true %>
<% end %>
</li>
<li class=" clear" style="border:1px solid #c8c8c8;">
<% if @issue.safe_attribute? 'start_date' %>

View File

@ -8,7 +8,7 @@
<div class="muban_popup_con " >
<div class="clear mt30 ml20 " >
<%#= form_tag( url_for(:controller => 'versions', :action => 'update', :is_setting => true, :is_index => @is_index), :remote => true, :id => 'project_applied_form') do %>
<%= form_for :version, :url => project_versions_path(@project, :is_setting => true, :is_issue => @is_issue, :is_create => @is_create),:html => {:id=>"popub_new_project_version_form", :remote => true} do |f| %>
<%= form_for :version, :url => project_versions_path(@project, :is_setting => @is_setting, :is_issue => @is_issue, :is_create => @is_create, :issue_project_id => @issue_project_id),:html => {:id=>"popub_new_project_version_form", :remote => @is_setting ? true : false} do |f| %>
<%#= labelled_form_for @version, :html => {:id => "popub_new_project_version_form", :remote => true, :is_setting => true, :is_index => params[:is_index] } do |f| %>
<ul class="pro_newsetting_con mb15 ">
<li class="mb10 clear">
@ -20,18 +20,17 @@
<label class=" fl">&nbsp;描述&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;", :no_label => true %>
</li>
<li class="mb10 clear">
<label class=" fl">&nbsp;结束日期&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl", :id => "version_effective_date", :placeholder=>"结束日期", :style=>"height:28px;", :no_label => true %>
<%= calendar_for('version_effective_date') %>
<!--<input type="text" placeholder="结束日期" class="issues_calendar_input fl ">-->
<!--<a href="" class="issues_data_img fl"></a>-->
</li>
<!--<li class="mb10 clear">-->
<!--<label class=" fl">&nbsp;结束日期&nbsp;&nbsp;:&nbsp;</label>-->
<!--<%#= f.text_field :effective_date, :size => 10, :readonly => true, :class => "issues_calendar_input fl", :id => "version_effective_date_create", :placeholder=>"结束日期", :style=>"height:28px;", :no_label => true %>-->
<!--<%#= calendar_for('version_effective_date_create') %>-->
<!--&lt;!&ndash;<input type="text" placeholder="结束日期" class="issues_calendar_input fl ">&ndash;&gt;-->
<!--&lt;!&ndash;<a href="" class="issues_data_img fl"></a>&ndash;&gt;-->
<!--</li>-->
<li class="mb10 clear">
<label class=" fl">&nbsp;状态&nbsp;&nbsp;:&nbsp;</label>
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]},{:no_label => true },{:style=>"height:28px;"} %>
</li>
<input value="true" name="is_setting" type="hidden">
</ul>
<a href="javascript:void(0);" class="fr sy_btn_grey mr45" onclick="hideModal()">取消</a>
<a href="javascript:void(0);" class="fr sy_btn_blue mr5" onclick="popub_project_version_commit();">保存</a>

View File

@ -1,2 +1 @@
$("#versions_choise_id").html('<%= escape_javascript( render :partial => 'issues/versions_choise', :locals => {:issue => @issue}) %>');
// $("#pro_st_tbc_04").html('<%#= escape_javascript( render :partial => 'projects/settings/new_versions') %>');
$("#pro_st_tbc_04").html('<%= escape_javascript( render :partial => 'projects/settings/new_versions') %>');

View File

@ -1,7 +1,2 @@
<% if !@is_create.nil? && !@is_issue.nil? %>
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'versions/new_modal') %>');
showModal('ajax-modal', '600px');
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/new_milestone') %>";
pop_box_new(htmlvalue,820,316);
<% end %>