里程碑编辑弹框

This commit is contained in:
daiao 2016-10-26 15:18:07 +08:00
parent 6833cc5105
commit 3229277737
5 changed files with 19 additions and 8 deletions

View File

@ -182,6 +182,7 @@ class VersionsController < ApplicationController
end
def edit
@@is_index = params[:is_index]
end
def update
@ -219,7 +220,11 @@ class VersionsController < ApplicationController
flash[:notice] = l(:notice_successful_update)
redirect_to settings_project_path(@project, :tab => 'versions')
}
format.js
format.js{
if @@is_index
redirect_to project_versions_path(@project)
end
}
format.api { render_api_ok }
end
else

View File

@ -13,11 +13,11 @@
</li>
<li class="mb10 clear">
<label class="fl">&nbsp;<%= l(:label_version_description) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;"%>
<%= f.text_field :description, :maxlength => 60, :class=>"w650 fl", :style=>"height:28px;", :id => "setting_version_description" %>
</li>
<li class="mb10 clear">
<label class=" fl">&nbsp;<%= l(:milestone_date_closed) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :effective_date, :size => 10, :readonly => true,:class=>"issues_calendar_input fl", :placeholder=>"结束日期", :style=>"height:28px;" %>
<%= 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('version_effective_date') %>
</li>
<li class="mb10 clear">
@ -54,7 +54,7 @@
<th><%= l("version_status_#{version.status}") %></th>
<th>
<% if version.project == @project && User.current.allowed_to?(:manage_versions, @project) %>
<%= link_to l(:button_edit), edit_version_path(version, :is_setting => true), :class => 'sy_btn_blue mr5', :remote => true %></a>
<%= link_to l(:button_edit), edit_version_path(version, :is_setting => true), :class => 'sy_btn_blue mr5', :remote => true %>
<%= delete_link_version version_path(version, :is_setting => true), :class=>"sy_btn_grey mr5", :remote => true %>
<% end %>
</th>
@ -93,6 +93,9 @@
function pro_st_show_ban1()
{
$("#pro_st_edit_ban1").toggle();
$("#setting_version_name").val("");
$("#setting_version_description").val("");
$("#setting_version_effective_date").val("");
}
function pro_st_show_ban()
{

View File

@ -7,8 +7,9 @@
<div class="muban_popup_con " >
<div class="clear mt30 ml20 " >
<%#= form_tag( url_for(:controller => 'versions', :action => 'update', :is_setting => true), :remote => true, :id => 'project_applied_form') do %>
<%= labelled_form_for @version, :html => {:id => "popub_new_project_version_form", :remote => true, :is_setting => true, } do |f| %>
<%#= form_tag( url_for(:controller => 'versions', :action => 'update', :is_setting => true, :is_index => @is_index), :remote => true, :id => 'project_applied_form') do %>
<%= 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>&nbsp;名称&nbsp;&nbsp;:&nbsp;</label>

View File

@ -7,7 +7,8 @@
:action => 'index',
:project_id => version.project)),
:class=>'roadmap_icons_del fr mt5 mr5' if User.current.allowed_to?(:manage_versions, version.project) %>
<a href="javascript:void(0);" class="roadmap_icons_edit fr mt5 " alt="编辑"></a>
<!--<a href="<%#= edit_version_path(version, :is_setting => true) %>" class="roadmap_icons_edit fr mt5 " alt="编辑"></a>-->
<%= link_to "", edit_version_path(version, :is_index => true), :class => 'roadmap_icons_edit fr mt5', :remote => true %>
</div>
<ul class="new_roadmap_list_txt clear mb5">
<li>完成 <span class="ml5 c_red" title="<%= version.closed_percent %>"><%= version.closed_percent.round %>% </span></li>

View File

@ -20,7 +20,8 @@
<%= delete_version_link version_path(@version, :back_url => url_for(:controller => 'versions',
:action => 'index',
:project_id => @version.project)),:class=>'roadmap_icons_del fr mt5 mr5' if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= link_to("", edit_version_path(@version), :class => 'roadmap_icons_edit fr mt5 ') if User.current.allowed_to?(:manage_versions, @version.project) %>
<%#= link_to("", edit_version_path(@version), :class => 'roadmap_icons_edit fr mt5 ') if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= link_to( "", edit_version_path(@version), :class => 'roadmap_icons_edit fr mt5', :remote => true) if User.current.allowed_to?(:manage_versions, @version.project) %>
<%= call_hook(:view_versions_show_contextual, { :version => @version, :project => @project }) %>
<% else %>
<div class="flash error"><%= l(:label_roadmap_no_issues) %></div>