diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index df354f107..0b7357ff2 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -180,14 +180,17 @@ class ZipdownController < ApplicationController def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[]) + ic = Iconv.new('GBK//IGNORE', 'UTF-8//IGNORE') + rename_zipfile = zip_name_refer ||= "#{Time.now.to_i.to_s}.zip" zipfile_name = "#{output_path}/#{rename_zipfile}" Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name)) Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile| files_paths.each do |filename| - rename_file = File.basename(filename) - rename_file = filename_to_real( File.basename(filename)) if is_attachment + rename_file = ic.iconv( (File.basename(filename)) ).to_s + rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment + begin zipfile.add(rename_file, filename) rescue Exception => e diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index 49ea0d57e..ff498f100 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -3,8 +3,6 @@ <%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> -<% if (@issue.author == User.current) || (User.current.admin?) %> - <%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("all_attributes", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %> -<% else %> - <%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? %> -<% end %> \ No newline at end of file + + <%= link_to l(:button_edit), edit_issue_path(@issue), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> + <%= link_to l(:label_user_newfeedback), edit_issue_path(@issue), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb index 67744e4b8..9cd376c60 100644 --- a/app/views/layouts/_join_exit_project.html.erb +++ b/app/views/layouts/_join_exit_project.html.erb @@ -1,15 +1,24 @@
<%if @repository.type.to_s=="Repository::Git"%> - <%= @repos_url%> - <%else %> - <%=h @repository.url %> +
+ <% if @repository.type.to_s=="Repository::Git" %> + <%= @repos_url %> + <% else %> + <%= h @repository.url %> <% end %>
-- (<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo| + +
+ (<%= l(:label_all_revisions) %><%= @repositories.sort.collect { |repo| link_to h(repo.name), {:controller => 'repositories', :action => 'show', :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, - :class => 'repository' + (repo == @repository ? ' selected' : '') , - :class => "mb10 word_break c_orange"}.join(' | ').html_safe %>) + :class => 'repository' + (repo == @repository ? ' selected' : ''), + :class => "mb10 break_word c_orange" }.join(' | ').html_safe %>)
-项目代码请设置好正确的编码方式(utf-8),否则中文会出现乱码
-建立版本库文件夹,打开命令行执行如下:
-git init
-git add *
-git commit -m "first commit"
-git remote add origin - http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git -
-git config http.postBuffer 524288000 #设置本地post缓存为500MB
-git push -u origin master:master
-已经有本地库,还没有配置远程地址,打开命令行执行如下:
-git remote add origin http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
-git add .
-git commit -m "first commit"
-git config http.postBuffer 524288000 #设置本地post缓存为500MB
-git push -u origin master:master
-已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:
-git clone http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
-git push
-git checkout -b branch_name
-git push origin branch_name
-从网上获取别人的开源版本库,转交到trustie网站上,打开命令行执行如下:
-git remote add trustie - http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git -
-git add .
-git commit -m "first commit"
-git config http.postBuffer 524288000 #设置本地post缓存为500MB
-git push -u trustie master:master
-李海提供
+- <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) - sep = '' %> - <% if @repository.supports_all_revisions? && @path.blank? %> - <%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project, - :repository_id => @repository.identifier_param}, - :class => "orange_u_btn" %> - <% sep = '|' %> + + <%= render_properties(@properties) %> + <% if authorize_for('repositories', 'revisions') %> + <% if @changesets && !@changesets.empty? %> +
+ <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) + sep = '' %> + <% if @repository.supports_all_revisions? && @path.blank? %> + <%= link_to l(:label_view_all_revisions), {:action => 'revisions', :id => @project, + :repository_id => @repository.identifier_param}, + :class => "orange_u_btn" %> + <% sep = '|' %> + <% end %> + <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %> + <%= sep %> + <%= link_to l(:label_view_revisions), + {:action => 'changes', + :path => to_path_param(@path), + :id => @project, + :repository_id => @repository.identifier_param, + :rev => @rev}, + :class => "orange_u_btn" %> + <% end %> +
+ <% if @repository.supports_all_revisions? %> + <% content_for :header_tags do %> + <%= auto_discovery_link_tag( + :atom, params.merge( + {:format => 'atom', :action => 'revisions', + :id => @project, :page => nil, :key => User.current.rss_key})) %> + <% end %> <% end %> - - <% if @repository.supports_all_revisions? %> - <% content_for :header_tags do %> - <%= auto_discovery_link_tag( - :atom, params.merge( - {:format => 'atom', :action => 'revisions', - :id => @project, :page => nil, :key => User.current.rss_key})) %> - <% end %> <% end %> -<% end %> - -查看如何提交代码: - <%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %> - <%= link_to('English', en_usage_path, :class => "c_blue") %> -
+ +查看如何提交代码: + <%= link_to(l(:label_how_commit_code_chinese), ch_usage_path, :class => "c_blue") %> + <%= link_to('English', en_usage_path, :class => "c_blue") %> + +
<% content_for :header_tags do %> - <%= stylesheet_link_tag "scm" %> + <%= stylesheet_link_tag "scm" %> <% end %> <% html_title(l(:label_repository)) -%> diff --git a/app/views/words/_new_respond.html.erb b/app/views/words/_new_respond.html.erb index 34e7c1ccf..243f8b2c4 100644 --- a/app/views/words/_new_respond.html.erb +++ b/app/views/words/_new_respond.html.erb @@ -1,5 +1,5 @@ <%= form_tag(words_create_reply_path, :remote => true) do %> - <%= text_area_tag 'user_notes', "", :class => 'noline', + <%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5', :style => "resize: none;", :rows => 4, :placeholder => l(:label_feedback_respond_content), :maxlength => 250 %> @@ -9,7 +9,7 @@ <%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %> <%= submit_tag l(:button_feedback_respond), :name => nil , - :class => "enterprise", + :class => "reply_btn", :style => "float: right; margin-top: 1px; margin-right: 4px;"%> <% end %> \ No newline at end of file diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 0aef464f8..4d10df1c2 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -59,6 +59,27 @@ function show_more_msg() { } } +function showhelpAndScrollTo(id, focus) { + var information = $("#showgithelp"); + var val = information.attr("value"); + if (val == "show_help") { + $("#showgithelp").text("收起Git操作指南"); + information.attr("value", "hide_help"); + $('#' + id).show(); + if (focus !== null) { + $('#' + focus).focus(); + } + $('html, body').animate({scrollTop: $('#' + id).offset().top}, 400); + } + else { + $("#showgithelp").text("显示Git操作指南"); + information.attr("value", "show_help"); + $('#' + id).hide(); + } +} + + + /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////项目讨论区 function regexSubject() { @@ -191,27 +212,22 @@ function project_setting(n) { } //配置-验证项目名称 -function regex_project_name() -{ +function regex_project_name() { var name = $.trim($("#project_name").val()); - if(name.length == 0) - { + if (name.length == 0) { $("#project_name_notice").show(); return false; } - else - { + else { $("#project_name_notice").hide(); return true; } } //配置-信息提交 -function submit_edit_project(id) -{ - if(regex_project_name()) - { - $("#edit_project_"+id).submit(); +function submit_edit_project(id) { + if (regex_project_name()) { + $("#edit_project_" + id).submit(); } } @@ -233,12 +249,13 @@ $(document).ready(function () { //issue_project_id }); -function showAndScrollTo(id, focus) { - $('#' + id).show(); - if (focus !== null) { + function showAndScrollTo(id, focus) { + $('#' + id).show(); + if (focus !== null) { $('#' + focus).focus(); + } + $('html, body').animate({scrollTop: $('#' + id).offset().top}, 400); } - $('html, body').animate({scrollTop: $('#' + id).offset().top}, 400); /*缺陷完成度决定缺陷状态*/ @@ -287,7 +304,4 @@ function showAndScrollTo(id, focus) { $("pre").addClass("break_word"); } - }); - - -} \ No newline at end of file + }); \ No newline at end of file diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 6894e3382..b1d2bb021 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -177,7 +177,7 @@ a:hover.upload_btn_grey{background:#8a8a8a;} a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; color:#64bdd9; } a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;} .r_txt_tit{width:510px; overflow:hidden; white-space: nowrap; text-overflow:ellipsis;color:#15bccf; float:left; color:#09658c; font-size:14px;} - +.repos_more{height:23px; width:100%; border:1px solid #CCC; background:#F6F6F6; text-align:center; font-size:12px; padding-top:2px;} /* 弹框 新样式还没设计出来,暂时用的课程那边的样式 */ .alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}