新版版本库界面代码整理
This commit is contained in:
parent
50f9c5244d
commit
10778fabc9
|
@ -400,7 +400,8 @@ class ProjectsController < ApplicationController
|
|||
@gitlab_repository = Repository.where(:project_id => @project, :type => "Repository::Gitlab").first
|
||||
unless @gitlab_repository.nil?
|
||||
gitlab_address = Redmine::Configuration['gitlab_address']
|
||||
@repos_url = gitlab_address.to_s+"/" + @creator + "/" + @repository.identifier+"."+"git"
|
||||
creator = @project.owner.try(:login)
|
||||
@repos_url = gitlab_address+"/" + creator + "/" + @gitlab_repository.identifier+"."+"git"
|
||||
end
|
||||
|
||||
scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first
|
||||
|
|
|
@ -1,42 +1,44 @@
|
|||
<%= error_messages_for 'project' %>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<ul class="pro_newsetting_con mb15">
|
||||
<li class="clear mb10" id="project_avatar_form">
|
||||
<label class="label fl"> </label>
|
||||
<%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %>
|
||||
</li>
|
||||
<li class="mb10">
|
||||
<label class="label"><span class="c_red f12">*</span> 项目名称 : </label>
|
||||
<input type="text" name="project[name]" id="project_name" class="ml5 w690" maxlength="100" onkeyup="regex_project_name();" value="<%= @project.name %>">
|
||||
<span class="c_red ml5 fl" id="project_name_notice" style="display: none;">项目名称不能为空!</span>
|
||||
</li>
|
||||
<li class="clear mb10">
|
||||
<label class="label fl"> 项目描述 : </label>
|
||||
<textarea class="fl ml5 w690" style="height:192px; padding-top:5px;" id="project_description" name="project[description]" rows="8" placeholder="项目描述作为项目的简介,将始终显示在动态页的顶部
|
||||
<div id="project_setting_hight">
|
||||
<%= error_messages_for 'project' %>
|
||||
<%= labelled_form_for @project do |f| %>
|
||||
<ul class="pro_newsetting_con mb15">
|
||||
<li class="clear mb10" id="project_avatar_form">
|
||||
<label class="label fl"> </label>
|
||||
<%= render :partial=>"avatar/new_avatar_form",:locals=> {source:@project} %>
|
||||
</li>
|
||||
<li class="mb10">
|
||||
<label class="label"><span class="c_red f12">*</span> 项目名称 : </label>
|
||||
<input type="text" name="project[name]" id="project_name" class="ml5 w690" maxlength="100" onkeyup="regex_project_name();" value="<%= @project.name %>">
|
||||
<span class="c_red ml5 fl" id="project_name_notice" style="display: none;">项目名称不能为空!</span>
|
||||
</li>
|
||||
<li class="clear mb10">
|
||||
<label class="label fl"> 项目描述 : </label>
|
||||
<textarea class="fl ml5 w690" style="height:192px; padding-top:5px;" id="project_description" name="project[description]" rows="8" placeholder="项目描述作为项目的简介,将始终显示在动态页的顶部
|
||||
最多3000个汉字(或6000个英文字符)"><%= @project.description%></textarea>
|
||||
</li>
|
||||
<% if !@project.gpid.nil? && !@gitlab_branches.blank? %>
|
||||
<li class="clear">
|
||||
<label class="fl"> 默认分支 :</label>
|
||||
<%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @rev), :id => 'branch', :class => "ml5" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<li class="clear">
|
||||
<label class="fl">公开 :</label>
|
||||
<input class="fl ml5" id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
|
||||
<span class="fl c_grey ">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
|
||||
</li>
|
||||
<li class="clear mb10">
|
||||
<label class="fl ">隐藏代码库 :</label>
|
||||
<input class="fl ml5" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<% if Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
|
||||
<%= link_to(l(:button_delete_project), { :controller => 'projects', :action => 'archive', :id => @project, :status => params[:status], :type =>"project" },
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => "sy_btn_grey mr5 fl ml15") unless @project.archived? %>
|
||||
<p class="fl c_grey">(友情提示:删除该项目后如果您想恢复该项目,请联系系统管理员!)</p>
|
||||
</li>
|
||||
<% if !@project.gpid.nil? && !@gitlab_branches.blank? %>
|
||||
<li class="clear">
|
||||
<label class="fl"> 默认分支 :</label>
|
||||
<%= select_tag :branch, options_for_select(["#{@gitlab_default_branch}"]+ @branch_names, @rev), :id => 'branch', :class => "ml5" %>
|
||||
</li>
|
||||
<% end %>
|
||||
<a href="javascript:void(0)" class="sy_btn_blue mr15 fr" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
<li class="clear">
|
||||
<label class="fl">公开 :</label>
|
||||
<input class="fl ml5" id="project_is_public" name="project[is_public]" type="checkbox" <%= @project.is_public ? "checked" : ""%>>
|
||||
<span class="fl c_grey ">(打钩为公开项目,不打钩为私有项目;私有项目仅项目成员可见。)</span>
|
||||
</li>
|
||||
<li class="clear mb10">
|
||||
<label class="fl ">隐藏代码库 :</label>
|
||||
<input class="fl ml5" id="project_hidden_repo" name="project[hidden_repo]" type="checkbox" <%= @project.hidden_repo ? "checked" : ""%>>
|
||||
</li>
|
||||
<li class="clear">
|
||||
<% if Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") %>
|
||||
<%= link_to(l(:button_delete_project), { :controller => 'projects', :action => 'archive', :id => @project, :status => params[:status], :type =>"project" },
|
||||
:data => {:confirm => l(:text_are_you_sure)}, :method => :post, :class => "sy_btn_grey mr5 fl ml15") unless @project.archived? %>
|
||||
<p class="fl c_grey">(友情提示:删除该项目后如果您想恢复该项目,请联系系统管理员!)</p>
|
||||
<% end %>
|
||||
<a href="javascript:void(0)" class="sy_btn_blue mr15 fr" onclick="submit_edit_project(<%= @project.id %>);" >保存</a>
|
||||
</li>
|
||||
</ul>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="pro_new_prompt ml15 mr15 mb10"><p>温馨提示:每个项目只能创建一个版本库</p></div>
|
||||
<div class=" sy_new_tchbox clear " >
|
||||
<% if @gitlab_repository.nil? %>
|
||||
<div class=" sy_new_tchbox clear " >
|
||||
<a href="javascript:void(0);" class=" sy_btn_green mb10">新建版本库</a>
|
||||
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
|
||||
<ul class="pro_newsetting_con mb15">
|
||||
|
@ -27,127 +27,31 @@
|
|||
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="fr sy_btn_grey"><%=l(:button_cancel)%></a>
|
||||
<a href="#" onclick="$('#repository-form').submit();" class="fr sy_btn_blue mr5"><%=l(:lable_project_rep_create) %></a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class=" clear ml15 mr15" >
|
||||
<table class="sy_new_table clear mb15" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>版本库名</th>
|
||||
<th >管理系统</th>
|
||||
<th>库路径</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th><%= repository.identifier %></th>
|
||||
<th>Gitlab</th>
|
||||
<th><%=h truncate(@repos_url,:length=>10) %></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class=" clear ml15 mr15" >
|
||||
<table class="sy_new_table clear mb15" cellpadding="0" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w150 hidden">版本库名</th>
|
||||
<th class="w100 hidden">管理系统</th>
|
||||
<th class="w536 hidden">库路径</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="w150 hidden"><%= @gitlab_repository.identifier %></th>
|
||||
<th class="w100 hidden">Git</th>
|
||||
<th class="w536 hidden db"><%=h @repos_url %></th>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
function pro_st_show_ku()
|
||||
{
|
||||
$("#pro_st_edit_ku").toggle();
|
||||
}
|
||||
</script>
|
||||
<% unless @project.repositories.any? %>
|
||||
<p class="nodata">温馨提示:<%= l(:label_repository_no_data) %></p>
|
||||
<% end %>
|
||||
<%= str = error_messages_for 'repository' %>
|
||||
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
|
||||
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %><!--Added by tanxianbo For formatting project's path-->
|
||||
<%# 提示 %>
|
||||
<% if @project.repositories.count>1 %>
|
||||
<div class="flash notice">
|
||||
项目管理员您好!近日平台完成了版本库升级,以后每个项目将唯一的对应一个版本库。请您按照以下步骤完成项目版本库的更新:
|
||||
<p>1. 点击下面的"创建版本库按钮",为本项目创建一个新的版本库;</p>
|
||||
<p>2. 从本项目的历史版本库中选择一个您将使用的版本库,将其完整的克隆(clone)到本地(需要提供您之前设置的版本库口令),然后推送(push)到新建的版本库(注意不能仅推送代码,否则之前各开发者的提交记录将丢失)。</p>
|
||||
<p>3. 本项目的历史版本库将在您新建版本库的一周内自动隐藏,如果您以后需要这些版本库,请与网站联系,我们将为您提供这些版本库的所有数据。</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<%# 新建版本库 %>
|
||||
<% if @project.repositories.count == 0 || rep_is_gitlab?(@project) %>
|
||||
<div style="padding-bottom: 40px">
|
||||
<a href="javascript:viod(0)" class="pic_add fl mr5" onclick="pro_st_show_ku();"></a>
|
||||
<a href="javascript:viod(0)" class="c_blue fl" onclick="pro_st_show_ku();">
|
||||
<% course_tag = @project.project_type %>
|
||||
<% if User.current.allowed_to?(:manage_repository, @project) %>
|
||||
<!--newrepo_project_repository_path(@project, :course => course_tag) -->
|
||||
<%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %></p>
|
||||
<% end %>
|
||||
</a>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
|
||||
<div id="pro_st_edit_ku" class="pro_st_edit_ku">
|
||||
<ul>
|
||||
<li style="display: none">
|
||||
<label class="label02"><%=l(:label_scm)%>:</label>
|
||||
<%= select_tag('repository_scm',
|
||||
options_for_select(["Git"],@repository.class.name.demodulize),
|
||||
:data => {:remote => true, :method => 'get'}) %>
|
||||
<% if @repository && ! @repository.class.scm_available %>
|
||||
<span class="c_grey"><%= l(:text_scm_command_not_available) %></span>
|
||||
<% end %>
|
||||
</li>
|
||||
<li >
|
||||
<input type="text" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<input type="password" style="display: none"/> <!--阻止表单自动填充 -->
|
||||
<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 %>
|
||||
<%# unless @repository.identifier_frozen? %>
|
||||
<span class="c_grey"><%=l(:text_length_between,:min=>1,:max=>254)<<l(:text_project_identifier_info) %></span>
|
||||
<%# end %>
|
||||
</li>
|
||||
<div class="cl"></div>
|
||||
</ul>
|
||||
<a href="#" onclick="$('#repository-form').submit();" class="blue_btn fl "><%=l(:lable_project_rep_create) %></a>
|
||||
<a href="<%= settings_project_path(@project, :tab => 'repositories')%>" class="grey_btn fl "><%=l(:button_cancel)%></a>
|
||||
</div><!--pro_st_edit_issues end-->
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if @project.repositories.any? %>
|
||||
<%= render :partial => 'projects/settings/rep_gitlab', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
|
||||
<%#= render :partial => 'projects/settings/rep_forge', :locals => {:project => @project, :ip => "ip", :project_path_cut => "project_path_cut" } %>
|
||||
<div class="rep_history_title">历史版本库</div>
|
||||
<table class="pro_table">
|
||||
<tbody>
|
||||
<% rep_forge(@project).sort.each do |repository| %>
|
||||
<tr class="<%= cycle 'pro_table_on_forge', '' %>">
|
||||
<td class="w150"><span class="rep_history_grey" title="<%= repository.identifier %>">
|
||||
<%= repository.identifier %></span></td>
|
||||
<td class="w150"><span class="rep_history_grey"><%=h repository.scm_name %></span></td>
|
||||
<%if repository.scm_name=="Git"%>
|
||||
<% rep_url = "http://" + repository.login.to_s + '_'+ repository.identifier.to_s + "@" + ip.to_s + h( repository.url.slice(project_path_cut, repository.url.length)) %>
|
||||
<td class="w362 pl5" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis; text-align: left">
|
||||
<span class="rep_history_grey">
|
||||
<textarea id="copy_rep_content2_<%= repository.id %>" class="cloneUrl2 fl" type="input" ><%= rep_url %></textarea>
|
||||
<a href="javascript:void(0);" onclick="jsCopy2(<%= repository.id %>)"><span class="vl_copy2" title="点击复制版本库地址"></span></a>
|
||||
<%#= rep_url %>
|
||||
</span>
|
||||
</td><!--Modified by tanxianbo-->
|
||||
<%else %>
|
||||
<td class="w360" style="white-space:nowrap;overflow:hidden;text-overflow:ellipsis;" ><%=h truncate(repository.url,:length=>10) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1413,7 +1413,7 @@ zh:
|
|||
label_board_description: 七嘴八舌,汇聚众人智慧,为您排忧解难!
|
||||
label_create_course_description: 课程小社区,创建新课程,让我们共同分享多到想不到的公共资源!
|
||||
label_welcome_page_to: 参与了 %{project_count} 个项目!
|
||||
label_repository_path_not_null: 库路径 不能为空字符
|
||||
label_repository_path_not_null: 库路径不能为空字符
|
||||
label_password_not_null: 密码不能设置为空。
|
||||
label_exist_repository_path: 定义已有版本库URL路径,定义格式file://, http://, https://, svn://
|
||||
label_project_no_activity: 该项目暂无动态!
|
||||
|
|
|
@ -261,6 +261,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/
|
|||
.w465{width:465px !important;}
|
||||
.w490{width:490px;}
|
||||
.w520{ width:520px;}
|
||||
.w536{ width:536px;}
|
||||
.w543{ width:543px;}
|
||||
.w557{ width:557px;}
|
||||
.w576{ width:576px;}
|
||||
|
|
Loading…
Reference in New Issue