Merge branch 'dev_newproject' of https://git.trustie.net/jacknudt/trustieforge into dev_newproject

This commit is contained in:
daiao 2016-10-18 17:22:52 +08:00
commit daf0263be9
8 changed files with 120 additions and 146 deletions

View File

@ -2226,6 +2226,22 @@ module ApplicationHelper
s
end
# 获取issue类型
def get_issue_type_new tracker_id
case tracker_id
when 1
"缺陷"
when 2
"功能"
when 3
"支持"
when 4
"任务"
when 5
"周报"
end
end
def get_memo
@new_memo = Memo.new
@public_forum = Forum.find(1) rescue ActiveRecord::RecordNotFound

View File

@ -7,11 +7,8 @@
</div>
<div class="content-big">
<div class="homepagePostTo break_word">
<% if activity.try(:author).try(:realname) == ' ' %>
<%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% else %>
<%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %>
<% end %> TO
<%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %>
TO
<%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
</div>
<% if User.current.logged? %>
@ -40,18 +37,8 @@
</div>
<% end %>
<div class="homepagePostTitle break_word">
<% case activity.tracker_id %>
<% when 1%>
<span class="fl" title="缺陷">【缺陷】</span>
<% when 2%>
<span class="fl" title="功能">【功能】</span>
<% when 3%>
<span class="fl" title="支持">【支持】</span>
<% when 4%>
<span class="fl" title="任务">【任务】</span>
<% when 5%>
<span class="fl" title="周报">【周报】</span>
<% end %>
<span class="fl">【<%= get_issue_type_new(activity.tracker_id) %>】</span>
<%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %>
<span class='<%= get_issue_priority(activity.priority_id)[0] %>'>
<%= get_issue_priority(activity.priority_id)[1] %>

View File

@ -4,19 +4,19 @@
<% sub_path = entry.path[0] == "/" ? entry.path.sub("/", "") : entry.path %>
<% ent_path = Redmine::CodesetUtil.replace_invalid_utf8(sub_path) %>
<% ent_name = Redmine::CodesetUtil.replace_invalid_utf8(entry.name) %>
<%# latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>
<% latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
<% if entry.is_dir? %>
<%# 展开文件目录 %>
<%# 展开文件目录 %>
<span class="expander" onclick="scmEntryClick('<%= tr_id %>', '<%= escape_javascript(url_for(
:action => 'show',
:id => @project,
:repository_id => @repository.identifier_param,
:path => to_path_param(ent_path),
:rev => @rev,
# :latest_changes => latest_changes,
:latest_changes => latest_changes,
:depth => (depth + 1),
:parent_id => tr_id)) %>');">&nbsp;</span>
<% end %>
@ -26,49 +26,21 @@
</td>
<div id="children_tree">
<td class="tree-comments c_grey hidden">
<div class="hidden" id="changes_message_<%= tr_id %>">
<div class="hidden" title="<%= (latest_changes.message) if latest_changes %>">
<%= (latest_changes.message) if latest_changes %>
</div>
</td>
<td class="tree-author c_grey">
<div class="hidden" id="changes_author_<%= tr_id %>">
<div class="hidden" title="<%= (latest_changes.author_name) if latest_changes %>">
<%= (latest_changes.author_name) if latest_changes %>
</div>
</td>
<td class="tree-age c_grey">
<div class="hidden" id="changes_time_<%= tr_id %>">
<div class="hidden" title="<%= format_time(latest_changes.time) if latest_changes %>">
<%# 为了转换UTC时间时差8小时 %>
<%= link_to tree_head_message_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch) %>
<%= distance_of_time_in_words(latest_changes.time, Time.now) if latest_changes %>
</div>
</td>
</div>
</tr>
<!--&lt;!&ndash;<script>&ndash;&gt;-->
<!--// $("#changes_message_<%#=tr_id %>").html("999")-->
<!--// $("#changes_author_<%#=tr_id %>").html("<%#= get_trees_last_changes(@project.gpid, @rev, ent_path, @g).author_name %>")-->
<!--// $("#changes_time_<%#=tr_id %>").html("<%#= distance_of_time_in_words(get_trees_last_changes(@project.gpid, @rev, ent_path, @g).time, Time.now) %>")-->
<!--&lt;!&ndash;</script>&ndash;&gt;-->
<script>
$(document).ready(function(){
$.ajax({
type:"GET",
url:"Venue.aspx?act=init",
dataType:"html",
success:function(result){ //function1()
f1();
f2();
}
failure:function (result) {
alert('Failed');
}
}
alert("test");
alert(<%#= get_trees_last_changes(@project.gpid, @rev, ent_path, @g).author_name %>);
document.getElementById('changes_author_<%=tr_id %>').html(<%= get_trees_last_changes(@project.gpid, @rev, ent_path, @g).author_name %>);
});
</script>
<% end %>

View File

@ -1,102 +1,100 @@
<%#= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="project_r_h" style="width:730px;">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
<% unless @entries.nil? %>
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
<% if User.current.member_of?(@project) && @project.is_public? %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %>
<% else %>
<%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %>
<div class="wrap-big">
<div class="project_r_h">
<div class="fl"><h2 class="project_h2_repository"><%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %></h2></div>
<% unless @entries.nil? %>
<a href="<%= @zip_path %>" class="btn_zipdown fr" onclick="">ZIP下载</a>
<% if User.current.member_of?(@project) && @project.is_public? %>
<% if quality_analysis(User.current.try(:login), @repository.id).nil? %>
<%= link_to "质量分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "1"), :remote => true, :class => "btn_zipdown fr" %>
<% else %>
<%= link_to "重新分析", quality_analysis_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :default_branch => @g_default_branch, :type => "2"), :remote => true, :class => "btn_zipdown fr" %>
<% end %>
<% end %>
<% end %>
<% end %>
<!--quality_analysis-->
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>
<%# 未提交代码提示 %>
<div class=" repository-url light-well">
<% if @entries.nil? && authorize_for('repositories', 'browse') %>
<div class="page-title">
该版本库还没有上传代码!
</div>
<% end %>
<% if @repository.type.to_s == "Repository::Gitlab" %>
版本库地址:<%= @repos_url %>
<% else %>
版本库地址:<%= h @repository.url %>
<% end %>
<div class="cl"></div>
</div>
<% else %>
<%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repos_url.to_s.lstrip %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<div class="fl mt5 ml15">
<%=link_to "代码统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator, :default_branch => @g_default_branch ), :class => "fl vl_zip" %>
</div>
<!--quality_analysis-->
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>
<%# 未提交代码提示 %>
<div class=" repository-url light-well">
<% if @entries.nil? && authorize_for('repositories', 'browse') %>
<div class="page-title">
该版本库还没有上传代码!
</div>
<% end %>
<% if @repository.type.to_s == "Repository::Gitlab" %>
版本库地址:<%= @repos_url %>
<% else %>
版本库地址:<%= h @repository.url %>
<% end %>
<div class="cl"></div>
</div>
<% else %>
<%= render :partial => 'navigation' %>
<div class="fl c_grey02 mt5 mr5">克隆网址:</div>
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" ><%= @repos_url.to_s.lstrip %></textarea>
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
<div class="fl mt5 ml15">
<%=link_to "代码统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev, :creator => @creator, :default_branch => @g_default_branch ), :class => "fl vl_zip" %>
</div>
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
<% if User.current.id != @project.user_id %>
<div class="fr mt5"><%= link_to "<span class='vl_fork'></span>".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn", :target => "_blank", :confirm=>"平台将为您创建一个新的同名项目和版本库,请问是否继续?" %>
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span>
</div>
<% end %>
<div class="cl"></div>
<div class="recordBanner mt10">
<% if @changesets_latest_coimmit %>
<% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %>
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<%end%>
<% end %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
<%= @repository.branches.count %></font> 个分支
</span>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font> 提交
</span>
</div>
<% end %>
<div class="cl"></div>
<div class="recordBanner mt10" style="width:730px;">
<% if @changesets_latest_coimmit %>
<% if !user_commit_rep(@changesets_latest_coimmit.author_email).nil? %>
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.author_email)), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=link_to user_commit_rep(@changesets_latest_coimmit.author_email), user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<% else %>
<span class="fl"><div class="fb fontGrey3 mr5 fl hidden maxwidth150"><%=@changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.created_at) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<%end%>
<% end %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2">
<%= @repository.branches.count %></font> 个分支
</span>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>
<% end %>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %></font> 提交
</span>
</div>
<% end %>
<% memo = Memo.where(:id => 1232).first %>
<% unless memo.nil? %>
<a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
<% end %>
<% if !@entries.nil? && authorize_for('repositories', 'browse') %>
<%= render :partial => 'dir_list' %>
<% end %>
<div class="fr">
<a style="color: #7f7f7f;">导出统计结果:</a>
<%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week" } %> <a style="color: #7f7f7f;">|</a>
<%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" } %>
</div>
<% memo = Memo.where(:id => 1232).first %>
<% unless memo.nil? %>
<a href="<%= Setting.protocol + "://" %><%=Setting.host_name %>/forums/1/memos/1232" >如何提交代码</a>
<% end %>
<div class="fr">
<a style="color: #7f7f7f;">导出统计结果:</a>
<%= link_to "最近一周", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "week" } %> <a style="color: #7f7f7f;">|</a>
<%= link_to "最近一月", {:controller => 'repositories', :action => 'export_rep_static', :format => 'xls', :rev => @rev, :cycle => "month" } %>
</div>
<%#= link_to "导出excel", {:controller => 'repositories', :action => 'export_rep_static', :rev => @rev}, :format => 'xls' %>
<!--<a href="<%#=project_issues_path(:project_id => @project, :format => 'xls')%>" class="hw_btn_blue fr" alt="导出EXCEL">导出EXCEL</a>-->
<%#= link_to "导出excel", {:controller => 'repositories', :action => 'export_rep_static', :rev => @rev}, :format => 'xls' %>
<!--<a href="<%#=project_issues_path(:project_id => @project, :format => 'xls')%>" class="hw_btn_blue fr" alt="导出EXCEL">导出EXCEL</a>-->
</div>
</div>
<%# content_for :header_tags do %>
<%#= stylesheet_link_tag "scm" %>
<%# end %>
<% html_title(l(:label_repository)) -%>
<script>
$(".project_r_h").parent().css({"width":"730px","background-color":"#fff","padding":"10px","margin-left":"10px","margin-bottom":"10px"});
</script>

View File

@ -1,12 +1,12 @@
<% project = Project.find(activity.act_id) %>
<% user = User.find(project.user_id)%>
<div class="container-big mt10">
<div class="pr">
<div class="resources mt10">
<div class="homepagePostBrief">
<div class="homepagePostPortrait">
<%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
<%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
</div>
<div class="content-big">
<div class="homepagePostDes">
<div class="homepagePostTo break_word">
<% if user.try(:realname) == ' ' %>
<%= link_to user, user_path(user), :class => "newsBlue mr15" %>

View File

@ -8,6 +8,7 @@
#LSide{ width:240px;}
#RSide{ width:670px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;}
.courseRSide{ width:730px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;}
.wrap-big {background:#fff; padding:10px; margin-bottom:10px;}
/*资源库*/
.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right}
.resourcesBanner {width:730px; height:40px; background-color:#eaeaea; margin-bottom:10px;}

View File

@ -143,7 +143,7 @@ a:hover.messages-title{ color:#269ac9;}
.green-cir-btn{ background:#28be6c; padding:1px 5px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
/*右侧内容--动态*/
.project_r_h{ width:670px; height:40px; background:#eaeaea; margin-bottom:10px;}
.project_r_h{ width:100%; height:40px; background:#eaeaea; margin-bottom:10px;}
.project_r_h02{ width:920px; height:40px; background:#eaeaea; margin-bottom:10px;}
.project_h2{ background:#64bdd9; color:#fff; height:33px; width:90px; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}
.project_h2_repository{ background:#64bdd9; color:#fff; height:33px; width:auto; text-align:center; font-weight:normal; padding-top:7px; font-size:16px;}

View File

@ -211,7 +211,7 @@
.clone_btn {width:30px; height:21px; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; outline:none; float:left; background-image:linear-gradient(#FCFCFC, #EEE); text-align:center;}
.vl_btn {height:21px; padding:0px 5px; vertical-align:middle; border:1px solid #dddddd; float:left; line-height:21px; background-image:linear-gradient(#FCFCFC, #EEE);}
.vl_btn_2 {height:21px; padding:0px 5px; vertical-align:middle; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; float:left; line-height:21px;}
.recordBanner {width:670px; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;}
.recordBanner {width:100%; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;}
.vl_copy {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;}
.vl_copy2 {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;}
.vl_zip {background:url(../images/vlicon/graph.png) 0px 2px no-repeat; padding-left:22px;}
@ -220,7 +220,7 @@
.vl_branch {background:url(../images/vlicon/branch_icon.png) 0px -2px no-repeat; padding-left:22px}
.mt1 {margin-top:1px;}
.mt2 {margin-top:2px;}
.commit_content_dec{width: 200px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;}
.commit_content_dec{width: 400px;overflow: hidden; white-space: nowrap;text-overflow: ellipsis;}
/*提交信息列表*/
.col-md-10 {