新建版本库--

如果主版本库已存在,新建的时候不允许设置主版本库
This commit is contained in:
huang 2015-05-13 10:27:27 +08:00
parent 6c500109c9
commit a62001c892
2 changed files with 18 additions and 4 deletions

View File

@ -232,6 +232,18 @@ module RepositoriesHelper
:label => l(:label_git_report_last_commit)
))
end
# 判断项目是否有主版本库
def judge_main_repository(pro)
if pro.repositories.blank?
return false
else
pro.repositories.sort.each do |rep|
rep.is_default?
return true
end
end
end
# def cvs_field_tags(form, repository)
# content_tag('p', form.text_field(
# :root_url,

View File

@ -72,10 +72,12 @@
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
<% end %>
</li>
<% unless judge_main_repository(@project) %>
<li>
<label class="label02"><%=l(:field_repository_is_default)%></label>
<%= f.check_box :is_default, :label => "" %></p>
</li>
<% end %>
<li >
<label class="label02"><span class="c_red">*</span><%=l(:label_repository_name)%></label>
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>""%>