Merge remote-tracking branch 'origin/szzh' into szzh

memcached_alan
lizanle 10 years ago
commit 99ae746bff

@ -180,14 +180,17 @@ class ZipdownController < ApplicationController
def zipping(zip_name_refer, files_paths, output_path, is_attachment=false, not_exist_file=[]) 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" rename_zipfile = zip_name_refer ||= "#{Time.now.to_i.to_s}.zip"
zipfile_name = "#{output_path}/#{rename_zipfile}" zipfile_name = "#{output_path}/#{rename_zipfile}"
Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name)) Dir.mkdir(File.dirname(zipfile_name)) unless File.exist?(File.dirname(zipfile_name))
Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile| Zip::File.open(zipfile_name, Zip::File::CREATE) do |zipfile|
files_paths.each do |filename| files_paths.each do |filename|
rename_file = File.basename(filename) rename_file = ic.iconv( (File.basename(filename)) ).to_s
rename_file = filename_to_real( File.basename(filename)) if is_attachment rename_file = ic.iconv( filename_to_real( File.basename(filename))).to_s if is_attachment
begin begin
zipfile.add(rename_file, filename) zipfile.add(rename_file, filename)
rescue Exception => e rescue Exception => e

@ -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_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) %> <%= 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? %> <%= 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) %>
<% 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? && User.current.allowed_to?(:add_issue_notes, @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? %>
<% end %>

@ -1,15 +1,24 @@
<div class="pr_info_join fl"> <div class="pr_info_join fl">
<!--关注项目--> <!--关注:非项目成员-->
<% if ( !(User.current.member_of? @project) && User.current.login?) %> <!--added by linchun--> <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<span><%= watcher_link_for_project(@project, User.current) %></span> <span><%= watcher_link_for_project(@project, User.current) %></span>
<% end %> <% end %>
<!--加入项目 --> <!--加入项目 -->
<% if ( !(User.current.member_of? @project) && User.current.login?) %> <% if !User.current.member_of?(@project) && User.current.login? && !User.current.admin %>
<%= join_in_project_link(@project, User.current) %> <%= join_in_project_link(@project, User.current) %>
<% end %> <% end %>
<!--退出项目--> <!--配置项目-->
<% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %> <% if User.current.admin? || User.current.allowed_to?({:controller => 'projects', :action => 'settings'}, @project) %>
<%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %> <%= link_to "<span class='pr_setting'></span>#{l(:button_configure)}".html_safe, settings_project_path(@project), :class => "pr_join_a" %>
<% end %>
<!--项目类型-->
<% if (User.current.login? && User.current.member_of?(@project) && Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager")) || User.current.admin? %>
<%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%> <%= link_to "<span class='#{typeclass}'></span>#{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %> <% end %>
<!--退出项目-->
<% if (User.current.member_of? @project) && User.current.login? &&
Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %>
<%= exit_project_link(@project) %>
<% end %>
</div> </div>

@ -1,89 +1,119 @@
<%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %> <%= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="project_r_h"> <div class="project_r_h">
<h2 class="project_h2">版本库</h2> <h2 class="project_h2">版本库</h2>
</div> </div>
<div class="repository_con" style="line-height:1.9;"> <div class="repository_con" style="line-height:1.9;">
<div class="repositorytitle" style="float:left;" > <div class="repositorytitle" style="float:left;">
<%= render :partial => 'breadcrumbs', <%= render :partial => 'breadcrumbs',
:locals => { :path => @path, :kind => 'dir', :revision => @rev } %> :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<%= render :partial => 'navigation' %> <%= render :partial => 'navigation' %>
</div><!--contextual end--> </div>
<!--contextual end-->
<div class="cl"></div> <div class="cl"></div>
<div class=" c_dark f14"> <div class=" c_dark f14">
<p > <%if @repository.type.to_s=="Repository::Git"%> <p>
<%= @repos_url%> <% if @repository.type.to_s=="Repository::Git" %>
<%else %> <%= @repos_url %>
<%=h @repository.url %> <% else %>
<%= h @repository.url %>
<% end %> <% end %>
</p> </p>
<p class="mb10 word_break">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect {|repo| <p class="mb10 break_word">
(<%= l(:label_all_revisions) %><%= @repositories.sort.collect { |repo|
link_to h(repo.name), link_to h(repo.name),
{:controller => 'repositories', :action => 'show', {:controller => 'repositories', :action => 'show',
:id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil}, :id => @project, :repository_id => repo.identifier_param, :rev => nil, :path => nil},
:class => 'repository' + (repo == @repository ? ' selected' : '') , :class => 'repository' + (repo == @repository ? ' selected' : ''),
:class => "mb10 word_break c_orange"}.join('&nbsp|&nbsp').html_safe %>) :class => "mb10 break_word c_orange" }.join('&nbsp|&nbsp').html_safe %>)
</p> </p>
</div>
</div>
<div class="repos_more"><a id="showgithelp" value="show_help" onclick ="showhelpAndScrollTo('repos_git_more','repos_git_more'); return false;" class="c_dblue">显示Git操作指南</a></div>
<div id="repos_git_more" style="display:none;">
<br>
<div class=" c_dark f14">
<p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</p> <p>项目代码请设置好正确的编码方式utf-8否则中文会出现乱码</p>
<p>建立版本库文件夹,打开命令行执行如下:</p> <p>建立版本库文件夹,打开命令行执行如下:</p>
</div> </div>
<div class="repos_explain"> <div class="repos_explain">
<p>git init</p> <p>git init</p>
<p>git add *</p> <p>git add *</p>
<p>git commit -m "first commit"</p> <p>git commit -m "first commit"</p>
<p>git remote add origin <p>git remote add origin
http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
</p> </p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p> <p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p> <p>git push -u origin master:master</p>
</div><!--repos_explain end--> </div>
<div class="c_dark f14"> <!--repos_explain end-->
<div class="c_dark f14">
<p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p> <p>已经有本地库,还没有配置远程地址,打开命令行执行如下:</p>
</div> </div>
<div class="repos_explain"> <div class="repos_explain">
<p>git remote add origin http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p> <p>git remote add origin http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p>
<p>git add .</p> <p>git add .</p>
<p>git commit -m "first commit"</p> <p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p> <p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u origin master:master</p> <p>git push -u origin master:master</p>
</div><!--repos_explain end--> </div>
<div class="c_dark f14"> <!--repos_explain end-->
<div class="c_dark f14">
<p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p> <p>已有远程地址,创建一个远程分支,并切换到该分支,打开命令行执行如下:</p>
</div> </div>
<div class="repos_explain"> <div class="repos_explain">
<p>git clone http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p> <p>git clone http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git</p>
<p>git push</p> <p>git push</p>
<p>git checkout -b branch_name</p> <p>git checkout -b branch_name</p>
<p>git push origin branch_name</p> <p>git push origin branch_name</p>
</div><!--repos_explain end--> </div>
<div class="c_dark f14"> <!--repos_explain end-->
<div class="c_dark f14">
<p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p> <p>从网上获取别人的开源版本库转交到trustie网站上打开命令行执行如下</p>
</div> </div>
<div class="repos_explain"> <div class="repos_explain">
<p>git remote add trustie <p>git remote add trustie
http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git
</p> </p>
<p>git add .</p> <p>git add .</p>
<p>git commit -m "first commit"</p> <p>git commit -m "first commit"</p>
<p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p> <p>git config http.postBuffer 524288000 #设置本地post缓存为500MB</p>
<p>git push -u trustie master:master</p> <p>git push -u trustie master:master</p>
<p><a href="/users/646" class="c_orange">李海</a>提供</p> <p><a href="/users/646" class="c_orange">李海</a>提供</p>
</div>
</div> </div>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %> <%= render :partial => 'dir_list' %>
<% end %> <% end %>
<%= render_properties(@properties) %> <%= render_properties(@properties) %>
<% if authorize_for('repositories', 'revisions') %> <% if authorize_for('repositories', 'revisions') %>
<% if @changesets && !@changesets.empty? %> <% if @changesets && !@changesets.empty? %>
<h3> <h3>
<%= l(:label_latest_revision_plural) %> <%= l(:label_latest_revision_plural) %>
</h3> </h3>
<%= render :partial => 'revisions', <%= render :partial => 'revisions',
:locals => {:project => @project, :path => @path, :locals => {:project => @project, :path => @path,
:revisions => @changesets, :entry => nil }%> :revisions => @changesets, :entry => nil} %>
<% end %> <% end %>
<p style="padding-top: 10px;"> <p style="padding-top: 10px;">
<% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0) <% has_branches = (!@repository.branches.nil? && @repository.branches.length > 0)
@ -94,7 +124,7 @@
:class => "orange_u_btn" %> :class => "orange_u_btn" %>
<% sep = '|' %> <% sep = '|' %>
<% end %> <% end %>
<% if @repository.supports_directory_revisions? && ( has_branches || !@path.blank? || !@rev.blank? ) %> <% if @repository.supports_directory_revisions? && (has_branches || !@path.blank? || !@rev.blank?) %>
<%= sep %> <%= sep %>
<%= link_to l(:label_view_revisions), <%= link_to l(:label_view_revisions),
{:action => 'changes', {:action => 'changes',
@ -113,13 +143,14 @@
:id => @project, :page => nil, :key => User.current.rss_key})) %> :id => @project, :page => nil, :key => User.current.rss_key})) %>
<% end %> <% end %>
<% end %> <% end %>
<% end %> <% end %>
<!-- added by bai --> <!-- added by bai -->
<p class="fb c_dark mt10">查看如何提交代码: <p class="fb c_dark mt10">查看如何提交代码:
<%= link_to(l(:label_how_commit_code_chinese), ch_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") %> <%= link_to('English', en_usage_path, :class => "c_blue") %>
<div class="cl"></div>
<div class="cl"></div>
</div> </div>

@ -1,5 +1,5 @@
<%= form_tag(words_create_reply_path, :remote => true) do %> <%= 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, :style => "resize: none;", :rows => 4,
:placeholder => l(:label_feedback_respond_content), :placeholder => l(:label_feedback_respond_content),
:maxlength => 250 %> :maxlength => 250 %>
@ -9,7 +9,7 @@
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %> <%= 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 %> <%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<%= submit_tag l(:button_feedback_respond), :name => nil , <%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "enterprise", :class => "reply_btn",
:style => "float: right; margin-top: 1px; margin-right: 4px;"%> :style => "float: right; margin-top: 1px; margin-right: 4px;"%>
<% end %> <% end %>

@ -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() { function regexSubject() {
@ -191,27 +212,22 @@ function project_setting(n) {
} }
//配置-验证项目名称 //配置-验证项目名称
function regex_project_name() function regex_project_name() {
{
var name = $.trim($("#project_name").val()); var name = $.trim($("#project_name").val());
if(name.length == 0) if (name.length == 0) {
{
$("#project_name_notice").show(); $("#project_name_notice").show();
return false; return false;
} }
else else {
{
$("#project_name_notice").hide(); $("#project_name_notice").hide();
return true; return true;
} }
} }
//配置-信息提交 //配置-信息提交
function submit_edit_project(id) function submit_edit_project(id) {
{ if (regex_project_name()) {
if(regex_project_name()) $("#edit_project_" + id).submit();
{
$("#edit_project_"+id).submit();
} }
} }
@ -233,12 +249,13 @@ $(document).ready(function () {
//issue_project_id //issue_project_id
}); });
function showAndScrollTo(id, focus) { function showAndScrollTo(id, focus) {
$('#' + id).show(); $('#' + id).show();
if (focus !== null) { if (focus !== null) {
$('#' + focus).focus(); $('#' + focus).focus();
} }
$('html, body').animate({scrollTop: $('#' + id).offset().top}, 400); $('html, body').animate({scrollTop: $('#' + id).offset().top}, 400);
}
/*缺陷完成度决定缺陷状态*/ /*缺陷完成度决定缺陷状态*/
@ -288,6 +305,3 @@ function showAndScrollTo(id, focus) {
} }
}); });
}

@ -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.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;} 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;} .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;} .alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}

Loading…
Cancel
Save