里程碑列表,新建弹框
This commit is contained in:
parent
a83f5317bb
commit
3080c8ff09
|
@ -143,11 +143,14 @@ class VersionsController < ApplicationController
|
||||||
# @version = @project.versions.build
|
# @version = @project.versions.build
|
||||||
# @version.safe_attributes = params[:version]
|
# @version.safe_attributes = params[:version]
|
||||||
#
|
#
|
||||||
# respond_to do |format|
|
respond_to do |format|
|
||||||
# format.html
|
@is_create = params[:is_create]
|
||||||
# format.js
|
format.js{
|
||||||
# end
|
unless @is_create
|
||||||
redirect_to settings_project_url(@project, :tab => 'versions')
|
redirect_to settings_project_url(@project, :tab => 'versions')
|
||||||
|
end
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
@ -157,7 +160,6 @@ class VersionsController < ApplicationController
|
||||||
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
attributes.delete('sharing') unless attributes.nil? || @version.allowed_sharings.include?(attributes['sharing'])
|
||||||
@version.safe_attributes = attributes
|
@version.safe_attributes = attributes
|
||||||
end
|
end
|
||||||
|
|
||||||
if request.post?
|
if request.post?
|
||||||
if @version.save
|
if @version.save
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
|
|
|
@ -3,32 +3,7 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class=" sy_new_tchbox clear " >
|
<div class=" sy_new_tchbox clear " >
|
||||||
<a href="javascript:void(0);" class=" sy_btn_green mb10" onclick="pro_st_show_ban1();">新建里程碑</a>
|
<a href="javascript:void(0);" class=" sy_btn_green mb10" onclick="pro_st_show_ban1();">新建里程碑</a>
|
||||||
<%= form_for :version, :url => project_versions_path(@project, :is_setting => true),:html=>{:id=>"new_project_version_form", :remote => true} do |f| %>
|
<%= render :partial => 'projects/settings/new_versions_form', :locals => {:project => @project} %>
|
||||||
<div id="pro_st_edit_ban1" style="display:none;">
|
|
||||||
<ul class="pro_newsetting_con mb15">
|
|
||||||
<li class="mb10 clear">
|
|
||||||
<label class="label02"><span class="c_red f12">*</span> <%= l(:field_name) %> : </label>
|
|
||||||
<%= f.text_field :name, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;", :id => "setting_version_name" %>
|
|
||||||
<p class="c_orange ml100" style="display: none" id="project_setting_version_title">标题不能为空</p>
|
|
||||||
</li>
|
|
||||||
<li class="mb10 clear">
|
|
||||||
<label class="fl"> <%= l(:label_version_description) %> : </label>
|
|
||||||
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;", :id => "setting_version_description" %>
|
|
||||||
</li>
|
|
||||||
<li class="mb10 clear">
|
|
||||||
<label class=" fl"> <%= l(:milestone_date_closed) %> : </label>
|
|
||||||
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class=>"issues_calendar_input fl", :placeholder=>"结束日期", :style=>"height:28px;", :id => "setting_version_effective_date" %>
|
|
||||||
<%= calendar_for('setting_version_effective_date') %>
|
|
||||||
</li>
|
|
||||||
<li class="mb10 clear">
|
|
||||||
<label class="fl"> <%= l(:field_status) %> : </label>
|
|
||||||
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]},{},{:style=>"height:28px"} %>
|
|
||||||
</li>
|
|
||||||
<div class="cl mb10"></div>
|
|
||||||
</ul>
|
|
||||||
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="pro_st_show_ban1();">取消</a><a href="javascript:void(0);" onclick="project_version_commit();" class="fr sy_btn_blue mr5">保存</a>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% if @project.shared_versions.any? %>
|
<% if @project.shared_versions.any? %>
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<%= form_for :version, :url => project_versions_path(@project, :is_setting => true),:html=>{:id=>"new_project_version_form", :remote => true} do |f| %>
|
||||||
|
<div id="pro_st_edit_ban1" style="display:none;">
|
||||||
|
<ul class="pro_newsetting_con mb15">
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class="label02"><span class="c_red f12">*</span> <%= l(:field_name) %> : </label>
|
||||||
|
<%= f.text_field :name, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;", :id => "setting_version_name" %>
|
||||||
|
<p class="c_orange ml100" style="display: none" id="project_setting_version_title">标题不能为空</p>
|
||||||
|
</li>
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class="fl"> <%= l(:label_version_description) %> : </label>
|
||||||
|
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;", :id => "setting_version_description" %>
|
||||||
|
</li>
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class=" fl"> <%= l(:milestone_date_closed) %> : </label>
|
||||||
|
<%= f.text_field :effective_date, :size => 10, :readonly => true, :class=>"issues_calendar_input fl", :placeholder=>"结束日期", :style=>"height:28px;", :id => "setting_version_effective_date" %>
|
||||||
|
<%= calendar_for('setting_version_effective_date') %>
|
||||||
|
</li>
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class="fl"> <%= l(:field_status) %> : </label>
|
||||||
|
<%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]},{},{:style=>"height:28px"} %>
|
||||||
|
</li>
|
||||||
|
<div class="cl mb10"></div>
|
||||||
|
</ul>
|
||||||
|
<a href="javascript:void(0);" class="fr sy_btn_grey " onclick="pro_st_show_ban1();">取消</a><a href="javascript:void(0);" onclick="project_version_commit();" class="fr sy_btn_blue mr5">保存</a>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
||||||
|
<script>
|
||||||
|
function project_version_commit(){
|
||||||
|
$("#new_project_version_form").submit();
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -0,0 +1,69 @@
|
||||||
|
<div id="muban_popup_box" style="width:820px;">
|
||||||
|
<div class="muban_popup_top">
|
||||||
|
<h3 class="fl">新建里程碑</h3>
|
||||||
|
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="hideModal()"></a>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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),: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| %>
|
||||||
|
<ul class="pro_newsetting_con mb15 ">
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class=" fl"><span class="c_red f12">*</span> 名称 : </label>
|
||||||
|
<%= f.text_field :name, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;", :id => "popub_setting_version_name", :no_label => true %>
|
||||||
|
<p class="c_orange ml100" style="display: none" id="pupub_project_setting_version_title">标题不能为空</p>
|
||||||
|
</li>
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class=" fl"> 描述 : </label>
|
||||||
|
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;", :no_label => true %>
|
||||||
|
</li>
|
||||||
|
<li class="mb10 clear">
|
||||||
|
<label class=" fl"> 结束日期 : </label>
|
||||||
|
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>"issues_calendar_input fl", :id => "version_effective_datex", :placeholder=>"结束日期", :style=>"height:28px;", :no_label => true %>
|
||||||
|
<%= calendar_for('version_effective_datex') %>
|
||||||
|
<!--<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"> 状态 : </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>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 新建版本
|
||||||
|
function popub_project_version_commit()
|
||||||
|
{
|
||||||
|
if(popub_regex_version_name())
|
||||||
|
{
|
||||||
|
hideModal();
|
||||||
|
$("#popub_new_project_version_form").submit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function popub_regex_version_name()
|
||||||
|
{
|
||||||
|
var name = $.trim($("#popub_setting_version_name").val());
|
||||||
|
if(name.length == 0)
|
||||||
|
{
|
||||||
|
$("#pupub_project_setting_version_title").show();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$("#pupub_project_setting_version_title").hide();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -15,7 +15,8 @@
|
||||||
<%= link_to "关闭<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_4'>#{@versions_closed_count}</span>".html_safe, project_roadmap_path(@project, :type => "4"), :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_4" %>
|
<%= link_to "关闭<span class='new_roadmap_nav_tagnomal ml5' id='new_roadmap_num_4'>#{@versions_closed_count}</span>".html_safe, project_roadmap_path(@project, :type => "4"), :remote => true, :class => "new_roadmap_type_nomal", :id => "new_roadmap_type_1", :id => "new_roadmap_type_4" %>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<a href="javascript:void(0);" class="btn btn-green fr mr15 mt10"> 新建 </a>
|
<!-- <a href="javascript:void(0);" class="btn btn-green fr mr15 mt10"> 新建 </a>-->
|
||||||
|
<%= link_to "新建", new_project_version_path(@project, :is_create => true), :class => 'btn btn-green fr mr15 mt10', :remote => true %>
|
||||||
</div>
|
</div>
|
||||||
<div id="version_list">
|
<div id="version_list">
|
||||||
<%= render :partial => "versions/list" %>
|
<%= render :partial => "versions/list" %>
|
||||||
|
|
|
@ -1,2 +1,7 @@
|
||||||
|
<% if @is_create %>
|
||||||
|
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');
|
||||||
|
<% end %>
|
Loading…
Reference in New Issue