diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index e321f2dc..af489ef8 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -37,6 +37,9 @@ class RepositoriesController < ApplicationController accept_rss_auth :revisions # hidden repositories filter // 隐藏代码过滤器 before_filter :check_hidden_repo, :only => [:show, :stats, :revisions, :revision, :diff ] + helper :repositories + include RepositoriesHelper + #@root_path = RepositoriesHelper::ROOT_PATH rescue_from Redmine::Scm::Adapters::CommandFailed, :with => :show_error_command_failed @@ -90,7 +93,7 @@ class RepositoriesController < ApplicationController def create ##xianbo - @root_path="/home/pdl/redmine-2.3.2-0/apache2/" + @root_path=RepositoriesHelper::ROOT_PATH @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git" @project_path=@root_path+"htdocs/"+@repository_name @repository_tag=params[:repository][:upassword] @@ -189,7 +192,7 @@ class RepositoriesController < ApplicationController end def destroy - @root_path="/home/pdl/redmine-2.3.2-0/apache2/" + @root_path=RepositoriesHelper::ROOT_PATH @repo_name=User.current.login.to_s+"_"+@repository.identifier.to_s @repository_name=User.current.login.to_s+"/"+@repository.identifier.to_s+".git" @middle=User.current.login.to_s+"_"+@repository.identifier.to_s+"-write:" @@ -222,6 +225,10 @@ class RepositoriesController < ApplicationController @entries = @repository.entries(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) + + #@project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT + #@ip = RepositoriesHelper::REPO_IP_ADDRESS + if request.xhr? @entries ? render(:partial => 'dir_list_content') : render(:nothing => true) else diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index 4b5bcfb4..d0286376 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -18,6 +18,10 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module RepositoriesHelper + ROOT_PATH="/home/pdl/redmine-2.3.2-0/apache2/" + PROJECT_PATH_CUT = 40 + REPO_IP_ADDRESS = "repository.trustie.net" + def format_revision(revision) if revision.respond_to? :format_identifier revision.format_identifier diff --git a/app/views/projects/settings/_repositories.html.erb b/app/views/projects/settings/_repositories.html.erb index 83da6f79..bb42e7a5 100644 --- a/app/views/projects/settings/_repositories.html.erb +++ b/app/views/projects/settings/_repositories.html.erb @@ -1,5 +1,5 @@ -<% project_path_cut = 40 %> -<% ip = "repository.trustie.net" %> +<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %> +<% ip = RepositoriesHelper::REPO_IP_ADDRESS %> <% if @project.repositories.any? %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 4c3ec9bb..1ba15fc7 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -4,8 +4,8 @@ <%= render :partial => 'navigation' %> -<% project_path_cut = 40 %> -<% ip = "repository.trustie.net" %> +<% project_path_cut = RepositoriesHelper::PROJECT_PATH_CUT %> +<% ip = RepositoriesHelper::REPO_IP_ADDRESS %>

<%= render :partial => 'breadcrumbs', :locals => { :path => @path, :kind => 'dir', :revision => @rev } %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 11ad0d5f..99ecee55 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1021,7 +1021,7 @@ en: text_enumeration_destroy_question: "%{count} objects are assigned to this value." text_enumeration_category_reassign_to: 'Reassign them to this value:' text_email_delivery_not_configured: "Email delivery is not configured, and notifications are disabled.\nConfigure your SMTP server in config/configuration.yml and restart the application to enable them." - text_repository_usernames_mapping: "Select or update the Redmine user mapped to each username found in the repository log.\nUsers with the same Redmine and repository username or email are automatically mapped." + text_repository_usernames_mapping: "Select or update the Trustie user mapped to each username found in the repository log.\nUsers with the same Trustie and repository username or email are automatically mapped." text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.' text_custom_field_possible_values_info: 'One line for each value' text_wiki_page_destroy_question: "This page has %{descendants} child page(s) and descendant(s). What do you want to do?" diff --git a/config/locales/zh.yml b/config/locales/zh.yml index 43e40294..2262c5e0 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1026,7 +1026,7 @@ zh: text_enumeration_destroy_question: "%{count} 个对象被关联到了这个枚举值。" text_enumeration_category_reassign_to: '将它们关联到新的枚举值:' text_email_delivery_not_configured: "邮件参数尚未配置,因此邮件通知功能已被禁用。\n请在config/configuration.yml中配置您的SMTP服务器信息并重新启动以使其生效。" - text_repository_usernames_mapping: "选择或更新与版本库中的用户名对应的Redmine用户。\n版本库中与Redmine中的同名用户将被自动对应。" + text_repository_usernames_mapping: "选择或更新与版本库中的用户名对应的Trustie用户。\n版本库中与Trustie中的同名用户将被自动对应。" text_diff_truncated: '... 差别内容超过了可显示的最大行数并已被截断' text_custom_field_possible_values_info: '每项数值一行' text_wiki_page_destroy_question: 此页面有 %{descendants} 个子页面和下级页面。您想进行那种操作?