创建版本库控制层及国际化

This commit is contained in:
huang 2015-10-15 09:18:56 +08:00
parent a45722b0f5
commit 9399063886
2 changed files with 15 additions and 9 deletions

View File

@ -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

View File

@ -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: 信息