Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject
This commit is contained in:
commit
d8f30f4dbe
|
@ -147,7 +147,9 @@ class VersionsController < ApplicationController
|
||||||
# @version.safe_attributes = params[:version]
|
# @version.safe_attributes = params[:version]
|
||||||
#
|
#
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
@is_issue = params[:is_issue]
|
||||||
@is_create = params[:is_create]
|
@is_create = params[:is_create]
|
||||||
|
#@@issue = Issue.find(params[:issue].to_i)
|
||||||
format.js{
|
format.js{
|
||||||
unless @is_create
|
unless @is_create
|
||||||
redirect_to settings_project_url(@project, :tab => 'versions')
|
redirect_to settings_project_url(@project, :tab => 'versions')
|
||||||
|
@ -157,7 +159,13 @@ class VersionsController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
# 项目配置中新建
|
||||||
|
@is_setting = params[:is_setting]
|
||||||
|
@is_issue = params[:is_issue]
|
||||||
|
@is_create = params[:is_create]
|
||||||
|
|
||||||
@version = @project.versions.build
|
@version = @project.versions.build
|
||||||
|
|
||||||
if params[:version]
|
if params[:version]
|
||||||
attributes = params[:version].dup
|
attributes = params[:version].dup
|
||||||
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
||||||
|
|
|
@ -88,10 +88,11 @@
|
||||||
<li class=" clear" id="assigned_to_tips">
|
<li class=" clear" id="assigned_to_tips">
|
||||||
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
|
<%= @issue.assigned_to.nil? ? "未指派" : "已指派" %>
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear">
|
<li class=" clear" id="versions_choise_id">
|
||||||
<%= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
|
<%#= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
|
||||||
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
|
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
|
||||||
{:onchange => "change_milestone_tip();",:class => "w150"} %>
|
{:onchange => "change_milestone_tip();",:class => "w150"} %>
|
||||||
|
<%= render :partial => 'issues/versions_choise' %>
|
||||||
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
|
<%#= link_to(image_tag('add.png', :style => 'vertical-align: middle;'),
|
||||||
new_project_version_path(@issue.project),
|
new_project_version_path(@issue.project),
|
||||||
:remote => true,
|
:remote => true,
|
||||||
|
@ -102,7 +103,8 @@
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" id="milestone_option_tips">
|
<li class=" clear" id="milestone_option_tips">
|
||||||
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
|
<%= @issue.fixed_version.nil? ? "无里程碑" : "已指派里程碑" %>
|
||||||
<%= link_to "", new_project_version_path(@issue.project), :class => "pic_add mt5 ml5 fr", :target => "_blank" %>
|
<%= link_to "", new_project_version_path(@project, :is_issue => true, :issue => @issue), :class => "pic_add mt5 ml5 fr", :remote => true %>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
<li class=" clear" style="border:1px solid #c8c8c8;">
|
<li class=" clear" style="border:1px solid #c8c8c8;">
|
||||||
<% if @issue.safe_attribute? 'start_date' %>
|
<% if @issue.safe_attribute? 'start_date' %>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<%#= f.select :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
|
||||||
|
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
|
||||||
|
{:onchange => "change_milestone_tip();",:class => "w150"} %>
|
||||||
|
|
||||||
|
<%= select :fixed_version_id, :fixed_version_id, version_options_for_select(@issue.assignable_versions, @issue.fixed_version),
|
||||||
|
{:include_blank => true, :required => @issue.required_attribute?('fixed_version_id'), :no_label => true},
|
||||||
|
{:onchange => "change_milestone_tip();",:class => "w150"}%>
|
|
@ -8,7 +8,7 @@
|
||||||
<div class="muban_popup_con " >
|
<div class="muban_popup_con " >
|
||||||
<div class="clear mt30 ml20 " >
|
<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_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),:html => {:id=>"popub_new_project_version_form", :remote => true} do |f| %>
|
<%= 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| %>
|
||||||
<%#= labelled_form_for @version, :html => {:id => "popub_new_project_version_form", :remote => true, :is_setting => true, :is_index => params[:is_index] } 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 ">
|
<ul class="pro_newsetting_con mb15 ">
|
||||||
<li class="mb10 clear">
|
<li class="mb10 clear">
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
$("#pro_st_tbc_04").html('<%= escape_javascript( render :partial => 'projects/settings/new_versions') %>');
|
$("#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') %>');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<% if @is_create %>
|
<% if !@is_create.nil? && !@is_issue.nil? %>
|
||||||
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/new_milestone') %>";
|
|
||||||
pop_box_new(htmlvalue,820,316);
|
|
||||||
<% else %>
|
|
||||||
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'versions/new_modal') %>');
|
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'versions/new_modal') %>');
|
||||||
showModal('ajax-modal', '600px');
|
showModal('ajax-modal', '600px');
|
||||||
|
<% else %>
|
||||||
|
var htmlvalue = "<%= escape_javascript(render :partial => 'versions/new_milestone') %>";
|
||||||
|
pop_box_new(htmlvalue,820,316);
|
||||||
<% end %>
|
<% end %>
|
Loading…
Reference in New Issue