新建里程碑在项目内不能重名

This commit is contained in:
daiao 2016-12-27 16:54:53 +08:00
parent cfa81fc79d
commit 50fb461f20
2 changed files with 2 additions and 2 deletions

View File

@ -278,7 +278,7 @@ class VersionsController < ApplicationController
# 判断里程碑是否重名 # 判断里程碑是否重名
def judge_version_title def judge_version_title
begin begin
version = Version.where(:name => params[:version_name]).first version = Version.where(:name => params[:version_name], :project_id => @project.id).first
if version.blank? if version.blank?
result = {:result => true} result = {:result => true}
else else

View File

@ -4,7 +4,7 @@
<li class="mb10 clear"> <li class="mb10 clear">
<label class="label02"><span class="c_red f12">*</span>&nbsp;<%= l(:field_name) %>&nbsp;&nbsp;:&nbsp;</label> <label class="label02"><span class="c_red f12">*</span>&nbsp;<%= l(:field_name) %>&nbsp;&nbsp;:&nbsp;</label>
<%= f.text_field :name, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;", :id => "project_setting_create_version_title" %> <%= f.text_field :name, :maxlength => 60, :class=>"w650 fl", :style=>"height: 28px;", :id => "project_setting_create_version_title" %>
<p class="c_orange ml100" style="display: none" id="project_setting_version_name">标题不能为空</p> <p class="c_orange ml100" style="display: none" id="project_setting_version_name">名称不能为空</p>
</li> </li>
<li class="mb10 clear"> <li class="mb10 clear">
<label class="fl">&nbsp;<%= l(:label_version_description) %>&nbsp;&nbsp;:&nbsp;</label> <label class="fl">&nbsp;<%= l(:label_version_description) %>&nbsp;&nbsp;:&nbsp;</label>