From a45722b0f5cf3f476f6fff6aa049ff1fd85b5c64 Mon Sep 17 00:00:00 2001
From: huang
Date: Thu, 15 Oct 2015 09:11:26 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=A1=B9=E7=9B=AE=E5=8F=AA?=
=?UTF-8?q?=E8=83=BD=E5=BB=BA=E4=B8=80=E4=B8=AA=E7=89=88=E6=9C=AC=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../settings/_new_repositories.html.erb | 179 +++++++++---------
1 file changed, 92 insertions(+), 87 deletions(-)
diff --git a/app/views/projects/settings/_new_repositories.html.erb b/app/views/projects/settings/_new_repositories.html.erb
index 410bd8c32..0859e5e19 100644
--- a/app/views/projects/settings/_new_repositories.html.erb
+++ b/app/views/projects/settings/_new_repositories.html.erb
@@ -8,93 +8,98 @@
<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %>
<% ip = RepositoriesHelper::REPO_IP_ADDRESS %>
<% if @project.repositories.any? %>
-
-
-
- <%= l(:field_identifier) %> |
- <%= l(:field_repository_is_default) %> |
- <%= l(:label_scm) %> |
- <%= l(:label_repository_path) %> |
- |
- |
-
- <% @project.repositories.sort.each do |repository| %>
-
-
- <%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %> |
- <%= checked_image repository.is_default? %> |
- <%=h repository.scm_name %> |
- <%if repository.scm_name=="Git"%>
-
+ |
+
+ <%= l(:field_identifier) %> |
+ <%= l(:field_repository_is_default) %> |
+ <%= l(:label_scm) %> |
+ <%= l(:label_repository_path) %> |
+ |
+ |
+
+ <% @project.repositories.sort.each do |repository| %>
+
+
+ <%= link_to truncate(repository.identifier), ({:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repository.identifier_param} if repository.identifier.present?) %> |
+ <%= checked_image repository.is_default? %> |
+ <%=h repository.scm_name %> |
+ <%if repository.scm_name=="Git"%>
+ <%=truncate( 'http://' << repository.login.to_s << '_'<< repository.identifier.to_s << '@'<< ip.to_s << h( repository.url.slice(project_path_cut, repository.url.length)),:length=>20)%> |
- <%else %>
- <%=h truncate(repository.url,:length=>10) %> |
- <% end %>
-
- <% if repository.scm_name=="Git"%>
- <%if User.current.allowed_to?(:manage_repository, @project) %>
- <%= link_to(l(:label_user_plural), committers_repository_path(repository)) %>
- <% end %>
- <% end %>
- |
-
- <% if repository.login.to_s==User.current.login.to_s %>
- <%= delete_new_link repository_path(repository) %>
- <% end %> |
-
- <% end %>
-<% else %>
- <%= l(:label_no_data) %>
-<% end %>
-
-
-
-
-
- <% course_tag = @project.project_type %>
- <% if User.current.allowed_to?(:manage_repository, @project) %>
-
- <%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %>
- <% end %>
-
-
-
-<%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
-
-
- -
-
- <%= select_tag('repository_scm',
- options_for_select(["Git"],@repository.class.name.demodulize),
- :data => {:remote => true, :method => 'get'})%>
- <% if @repository && ! @repository.class.scm_available %>
- <%= l(:text_scm_command_not_available) %>
- <% end %>
-
-
- <% unless judge_main_repository(@project) %>
- -
-
- <%= f.check_box :is_default, :label => "", :no_label => true %>
-
- <% end %>
- -
-
-
-
- <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
- <% unless @repository.identifier_frozen? %>
- <%=l(:text_length_between,:min=>1,:max=>254)<
+ <%else %>
+
<%=h truncate(repository.url,:length=>10) %> |
+ <% end %>
+
+ <% if repository.scm_name=="Git"%>
+ <%if User.current.allowed_to?(:manage_repository, @project) %>
+ <%= link_to(l(:label_user_plural), committers_repository_path(repository)) %>
+ <% end %>
+ <% end %>
+ |
+
+ <% if repository.login.to_s==User.current.login.to_s %>
+ <%= delete_new_link repository_path(repository) %>
+ <% end %> |
+
<% end %>
-
- -
-
- <%= f.password_field :upassword, :label=> "", :no_label => true%>
- <%= l(:label_upassword_info)%>
-
-
-
-
<%=l(:button_save)%>
-
<%=l(:button_cancel)%>
-
+
+
+<% else %>
+ <%= l(:label_repository_no_data) %>
<% end %>
+
+<%# 新建版本库 %>
+<% if @project.repositories.count == 0 %>
+
+
+ <% course_tag = @project.project_type %>
+ <% if User.current.allowed_to?(:manage_repository, @project) %>
+
+ <%= link_to l(:label_repository_new_repos),"#" , :onclick=>"pro_st_show_ku();", :class => 'c_blue fl' %>
+ <% end %>
+
+
+
+ <%= labelled_form_for :repository, @repository, :url =>project_repositories_path(@project),:html => {:id => 'repository-form',:method=>"post",:autocomplete=>'off'} do |f| %>
+
+
+ -
+
+ <%= select_tag('repository_scm',
+ options_for_select(["Git"],@repository.class.name.demodulize),
+ :data => {:remote => true, :method => 'get'})%>
+ <% if @repository && ! @repository.class.scm_available %>
+ <%= l(:text_scm_command_not_available) %>
+ <% end %>
+
+
+ <% unless judge_main_repository(@project) %>
+ -
+
+ <%= f.check_box :is_default, :label => "", :no_label => true %>
+
+ <% end %>
+ -
+
+
+
+ <%= f.text_field :identifier, :disabled =>@repository.nil? || @repository.identifier_frozen? ? true:false,:label=>"", :no_label => true %>
+ <% unless @repository.identifier_frozen? %>
+ <%=l(:text_length_between,:min=>1,:max=>254)<
+ <% end %>
+
+ -
+
+ <%= f.password_field :upassword, :label=> "", :no_label => true%>
+ <%= l(:label_upassword_info)%>
+
+
+
+
<%=l(:button_save)%>
+
<%=l(:button_cancel)%>
+
+ <% end %>
+
+<% end %>
+