From d006c2691b5eef53a4b4fca0d32c9386265cd429 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 13 Oct 2015 13:54:31 +0800 Subject: [PATCH 01/14] =?UTF-8?q?issue=E6=A8=A1=E5=9D=97=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E9=97=AE=E9=A2=98=E6=97=B6=EF=BC=8C=E7=BB=99?= =?UTF-8?q?=E5=87=BA=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=E2=80=9C=E8=AF=B7?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E9=97=AE=E9=A2=98=E5=90=8D=E7=A7=B0=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index 670f5c51a..29c038226 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -47,7 +47,7 @@ <%= form_tag({:controller => 'issues', :action => 'index', :project_id => @project},:remote=>'true', :method => :get,:id=>"issue_query_form", :class => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %> From 69ad8495c794bcd05ebc8b519c468b69eccea9a6 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Wed, 14 Oct 2015 17:28:13 +0800 Subject: [PATCH 02/14] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=B6=88=E6=81=AF=E4=B8=AD=EF=BC=8C=E8=AF=84=E9=98=85=E4=BA=86?= =?UTF-8?q?=E6=9F=90=E4=BD=9C=E8=AF=84=E7=9A=84=E6=B6=88=E6=81=AF=E5=86=85?= =?UTF-8?q?=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 1b9b175ea..ba1806d69 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -281,9 +281,15 @@ :onmouseover =>"message_titile_show($(this),event)", :onmouseout => "message_titile_hide($(this))" %> <% end %>
  • <%= time_tag(ma.created_at).html_safe %>
  • From a45722b0f5cf3f476f6fff6aa049ff1fd85b5c64 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 15 Oct 2015 09:11:26 +0800 Subject: [PATCH 03/14] =?UTF-8?q?=E4=B8=80=E4=B8=AA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E5=BB=BA=E4=B8=80=E4=B8=AA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=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? %> - - - - - - - - - - - <% @project.repositories.sort.each do |repository| %> - - - - - <%if repository.scm_name=="Git"%> - + + + + + + + + + <% @project.repositories.sort.each do |repository| %> + + + + + <%if repository.scm_name=="Git"%> + - <%else %> - - <% end %> - - - - <% end %> -<% else %> -

    <%= l(:label_no_data) %>

    -<% end %> - - -
    <%= l(:field_identifier) %> <%= l(:field_repository_is_default) %><%= l(:label_scm) %> <%= l(:label_repository_path) %>
    - <%= 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 %> +
    <%= l(:field_identifier) %> <%= l(:field_repository_is_default) %><%= l(:label_scm) %> <%= l(:label_repository_path) %>
    + <%= 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 %> <%=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)%><%=h truncate(repository.url,:length=>10) %> - <% 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 %>
    - - - <% 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 %> + From 939906388630615c8bffce2ba5038c76d5355e57 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 15 Oct 2015 09:18:56 +0800 Subject: [PATCH 04/14] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=BA=93=E6=8E=A7=E5=88=B6=E5=B1=82=E5=8F=8A=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/repositories_controller.rb | 21 +++++++++++++-------- config/locales/commons/zh.yml | 3 ++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 126b269bb..f2f10d5b6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -46,16 +46,21 @@ class RepositoriesController < ApplicationController rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed def new - scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first - @repository = Repository.factory(scm) - @repository.is_default = @project.repository.nil? - @repository.project = @project - @course_tag = params[:course] - if @course_tag == 1 - render :layout => 'base_courses' + if @project.repositories.count == 0 + scm = params[:repository_scm] || (Redmine::Scm::Base.all & Setting.enabled_scm).first + @repository = Repository.factory(scm) + @repository.is_default = @project.repository.nil? + @repository.project = @project + @course_tag = params[:course] + if @course_tag == 1 + render :layout => 'base_courses' + else + render :layout => 'base_projects' + end else - render :layout => 'base_projects' + render_403 end + end diff --git a/config/locales/commons/zh.yml b/config/locales/commons/zh.yml index 7cbb223c6..61bad2a00 100644 --- a/config/locales/commons/zh.yml +++ b/config/locales/commons/zh.yml @@ -199,7 +199,8 @@ zh: label_descripition_blank: 描述不能为空 label_subject_empty: 主题不能为空 - label_no_data: 没有任何数据可供显示 + label_no_data: 没有任何数据可供显示 + label_repository_no_data: 您还没有创建版本库,每个项目只允许创建一个版本库! # 项目、课程、用户公用 label_settings: 配置 label_information_plural: 信息 From b261eed24cfe13c7211d6a80c8e09b0670064ae1 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Thu, 15 Oct 2015 09:56:05 +0800 Subject: [PATCH 05/14] =?UTF-8?q?=E6=8F=90=E5=8F=96=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E8=AF=84=E5=88=86=E6=B6=88=E6=81=AF=E7=9A=84=E8=AF=84=E5=88=86?= =?UTF-8?q?=E5=8F=8A=E8=AF=84=E8=AF=AD=EF=BC=8C=E7=94=A8=E9=80=82=E5=BD=93?= =?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E6=98=BE=E7=A4=BA=E5=87=BA=E6=9D=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index ba1806d69..9c426f495 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -283,7 +283,14 @@