修改国际化

This commit is contained in:
Administrator 2013-08-19 08:48:21 +08:00
parent 09b98cbcc6
commit fee81455db
2 changed files with 14 additions and 15 deletions

View File

@ -76,6 +76,8 @@ class RepositoriesController < ApplicationController
@repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git" @repository_name=User.current.login.to_s+"/"+params[:repository][:identifier]+".git"
@project_path=@root_path+"htdocs/"+@repository_name @project_path=@root_path+"htdocs/"+@repository_name
@repository_tag=params[:repository][:upassword] @repository_tag=params[:repository][:upassword]
@repo_name=User.current.login.to_s+"-"+params[:repository][:identifier]
@middle=User.current.login.to_s+"-"+params[:repository][:identifier]+"-write:"
attrs = pickup_extra_info attrs = pickup_extra_info
if((@repository_tag!="")&&params[:repository_scm]=="Git") if((@repository_tag!="")&&params[:repository_scm]=="Git")
params[:repository][:url]=@project_path params[:repository][:url]=@project_path
@ -91,23 +93,19 @@ class RepositoriesController < ApplicationController
@repository.project = @project @repository.project = @project
if request.post? && @repository.save if request.post? && @repository.save
if(params[:repository_scm]=="Git") if(params[:repository_scm]=="Git")
system "htpasswd -mb "+@root_path+"user.passwd "+User.current.login.to_s+" "+@repository_tag system "htpasswd -mb "+@root_path+" "+@repo_name+" "+@repository_tag
system "echo -e '\n"+User.current.login.to_s+"-"+params[:repository][:identifier]+"-write:"+ system "echo -e '\n"+@repo_name+"-write:"+
" "+User.current.login.to_s+"' >> "+@root_path+"group.passwd" " "+@repo_name+"' >> "+@root_path+"group.passwd"
system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s system "mkdir "+@root_path+"htdocs/"+User.current.login.to_s
system "git init --bare "+@project_path system "git init --bare "+@project_path
system "mv "+@project_path+"/hooks/post-update{.sample,}" system "mv "+@project_path+"/hooks/post-update{.sample,}"
system "chmod a+x "+@project_path+"/hooks/post-update" system "chmod a+x "+@project_path+"/hooks/post-update"
system "echo -e 'Allow from all \n Order Deny,Allow \n "+ system "echo -e 'Allow from all \n Order Deny,Allow \n "+
"<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+ "<Limit PUT POST DELETE PROPPATCH MKCOL COPY MOVE LOCK UNLOCK> \n"+
"Require group "+User.current.login.to_s+"-"+params[:repository][:identifier]+"-write \n "+ "Require group "+@repo_name+"-write \n "+
"</Limit> \n ' >> "+ "</Limit> \n ' >> "+
@root_path+"htdocs/"+ @repository_name+"/.htaccess" @root_path+"htdocs/"+ @repository_name+"/.htaccess"
puts "before ======================================================================"
puts system "cd "+@project_path+" ;git update-server-info"
flag = system "cd "+@project_path+" ;git update-server-info" flag = system "cd "+@project_path+" ;git update-server-info"
puts "after flag:#{flag} ======================================================================"
@repository.update_attributes(:login => User.current.login.to_s) @repository.update_attributes(:login => User.current.login.to_s)
end end
redirect_to settings_project_path(@project, :tab => 'repositories') redirect_to settings_project_path(@project, :tab => 'repositories')
@ -171,10 +169,9 @@ class RepositoriesController < ApplicationController
@repository.destroy if request.delete? @repository.destroy if request.delete?
redirect_to settings_project_path(@project, :tab => 'repositories') redirect_to settings_project_path(@project, :tab => 'repositories')
if(@repository.type=="Repository::Git") if(@repository.type=="Repository::Git")
puts "before destroy system cmd =======================================" system "sed -i /"+@repo_name+"/{d} "+@root_path+"user.passwd"
puts "rm -r "+@root_path+@repository_name system "sed -i /"+@middle+"/{d} "+@root_path+"group.passwd"
flag = system "rm -r "+@root_path+"htdocs/"+@repository_name system "rm -r "+@root_path+"htdocs/"+@repository_name
puts "after destroy system cmd :#{flag} ======================================="
end end
end end

View File

@ -1261,9 +1261,11 @@ zh:
label_tags_user_mail: 用户邮箱: label_tags_user_mail: 用户邮箱:
label_tags_numbers: Tag统计 label_tags_numbers: Tag统计
label_max_number: 至多25个字符。 label_max_number: 至多25个字符。
label_mail_attention: qq邮箱可能收不到此邮件其他邮箱如果没有收到可能在垃圾邮件中
label_all_revisions: 所有版本: label_all_revisions: 所有版本:
label_upassword_info: 该密码在项目组内可共享 label_upassword_info: 该密码在项目组内可共享
label_how_commit_code: 如何提交代码: label_how_commit_code: 如何提交代码:
label_how_commit_code_chinese: 中文 label_how_commit_code_chinese: 中文
label_welcome_leave_message: 朋友,系统仍在不断完善,有意见和建议请 label_welcome_leave_message: 朋友,系统仍在不断完善,有意见和建议请
label_welcome_click_me: 点击我 label_welcome_click_me: 点击我
label_mail_attention: qq邮箱可能收不到此邮件其他邮箱如果没有收到可能在垃圾邮件中