Merge branch 'develop' of https://git.trustie.net/jacknudt/trustieforge into develop
This commit is contained in:
commit
6ba91cb3fe
|
@ -405,11 +405,16 @@ class ProjectsController < ApplicationController
|
||||||
end
|
end
|
||||||
flash.now[:error] = html if !html.to_s.blank?
|
flash.now[:error] = html if !html.to_s.blank?
|
||||||
end
|
end
|
||||||
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
|
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
|
||||||
@repository = Repository.factory(scm)
|
@repository = Repository.factory(scm)
|
||||||
@repository.is_default = @project.repository.nil?
|
@repository.is_default = @project.repository.nil?
|
||||||
@repository.project = @project
|
@repository.project = @project
|
||||||
|
unless @project.gpid.nil?
|
||||||
|
g = Gitlab.client
|
||||||
|
@gitlab_branches = g.branches(@project.gpid)
|
||||||
|
@branch_names = g.branches(@project.gpid).map{|b| b.name}
|
||||||
|
@gitlab_default_branch = g.project(@project.gpid).default_branch
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# 项目邀请用户加入实现过程
|
# 项目邀请用户加入实现过程
|
||||||
|
@ -670,8 +675,7 @@ class ProjectsController < ApplicationController
|
||||||
# 更新公开私有时同步gitlab公开私有
|
# 更新公开私有时同步gitlab公开私有
|
||||||
unless @project.gpid.nil?
|
unless @project.gpid.nil?
|
||||||
g = Gitlab.client
|
g = Gitlab.client
|
||||||
gproject = g.project(@project.gpid)
|
params[:project][:is_public] ? g.edit_project(@project.gpid, 20, params[:branch]) : g.edit_project(@project.gpid, 0, params[:branch])
|
||||||
params[:project][:is_public] ? g.edit_project(gproject.id, 20) : g.edit_project(gproject.id, 0)
|
|
||||||
end
|
end
|
||||||
# end
|
# end
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
|
|
|
@ -18,6 +18,13 @@
|
||||||
<textarea class="w543" id="project_description" name="project[description]" rows="8" placeholder="最多3000个汉字(或6000个英文字符)"><%= @project.description%></textarea>
|
<textarea class="w543" id="project_description" name="project[description]" rows="8" placeholder="最多3000个汉字(或6000个英文字符)"><%= @project.description%></textarea>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</li>
|
</li>
|
||||||
|
<% if !@project.gpid.nil? && !@gitlab_branches.blank? %>
|
||||||
|
<li>
|
||||||
|
<label class="label02"> 默认分支 :</label>
|
||||||
|
<%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @rev), :id => 'branch' %>
|
||||||
|
</li>
|
||||||
|
<% end %>
|
||||||
|
<div class="cl"></div>
|
||||||
<li >
|
<li >
|
||||||
<label class="label02">公开 :</label>
|
<label class="label02">公开 :</label>
|
||||||
<input id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
|
<input id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
|
||||||
|
|
|
@ -46,9 +46,9 @@
|
||||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||||
<span class="f14"><span class="c_red">*</span><%=l(:label_repository_name)%>:</span>
|
<span class="f14"><span class="c_red">*</span><%=l(:label_repository_name)%>:</span>
|
||||||
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
|
<%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
|
||||||
<% unless @repository.identifier_frozen? %>
|
<%# unless @repository.identifier_frozen? %>
|
||||||
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
|
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
|
||||||
<% end %>
|
<%# end %>
|
||||||
</li>
|
</li>
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<!-- Branches Dropdown -->
|
<!-- Branches Dropdown -->
|
||||||
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
|
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
|
||||||
<%= l(:label_branch) %>:
|
<%= l(:label_branch) %>:
|
||||||
<%= select_tag :branch, options_for_select([''] + @repository.branches, @rev), :id => 'branch' %>
|
<%= select_tag :branch, options_for_select(@repository.branches, @rev), :id => 'branch' %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
|
<% if !@repository.tags.nil? && @repository.tags.length > 0 -%>
|
||||||
|
|
|
@ -85,8 +85,8 @@ class Gitlab::Client
|
||||||
# public (optional) - if true same as setting visibility_level = 20
|
# public (optional) - if true same as setting visibility_level = 20
|
||||||
# visibility_level (optional)
|
# visibility_level (optional)
|
||||||
|
|
||||||
def edit_project(id, visibility_level)
|
def edit_project(id, visibility_level, default_branch)
|
||||||
put("/projects/#{id}", :body => {:visibility_level => visibility_level})
|
put("/projects/#{id}", :body => {:visibility_level => visibility_level, :default_branch => default_branch})
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deletes a project.
|
# Deletes a project.
|
||||||
|
|
Loading…
Reference in New Issue