版本库界面改版及show页面代码优化

This commit is contained in:
huang 2017-01-12 10:11:42 +08:00
parent c97c2b7738
commit 6aa2052c7f
8 changed files with 140 additions and 80 deletions

View File

@ -9,7 +9,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel' %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel', 'css/font-awesome' %>
<%= call_hook :view_layouts_base_html_head %>
<!-- page specific tags -->
<%= yield :header_tags -%>

View File

@ -3,15 +3,13 @@
<% unless @path.blank? %>
<tbody>
<tr style="border: 1px solid #DDD; border-bottom:none;">
<td>
<a href="javascript:history.go(-1)" class="fl linkBlue2 mt3" >
<span class="new_roadmap_icons_back mr5"></span>
返回上级目录
</a>
<td colspan="4">
<!--<a href="javascript:history.go(-1)" class="fl linkBlue2 mt3" >-->
<!--<span class="new_roadmap_icons_back mr5"></span>-->
<!--<span></span>返回上级目录-->
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<!--</a>-->
</td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody>
<% end %>

View File

@ -22,7 +22,7 @@
<% end %>
<%= link_to h(ent_name),
{:action => (entry.is_dir? ? 'show' : 'entry'), :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
:class => (entry.is_dir? ? 'icon icon-folder' : "icon icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
:class => (entry.is_dir? ? 'old-icon old-icon-folder' : "old-icon old-icon-file #{Redmine::MimeType.css_class_of(ent_name)}")%>
</td>
<div id="children_tree">
<td class="tree-author c_grey">

View File

@ -1,25 +1,11 @@
<div class="recordBanner mt3">
<% 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 ml5"><%=link_to get_user_by_mail(@changesets_latest_coimmit.author_email).show_name, user_path(user_commit_rep(@changesets_latest_coimmit.author_email)) %></div>
<div class="fl">提交于 <%= time_tag(@changesets_latest_coimmit.try(:time)) %> 前:</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 ml5"><%= @changesets_latest_coimmit.author_email %></div>
<div class="fl">提交于<%= time_tag(@changesets_latest_coimmit.try(:time)) %></div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.comments %>"><%= @changesets_latest_coimmit.message %></div>
</span>
<%end%>
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.try(:author_email))), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
<%= link_to_user_mail(@changesets_latest_coimmit.try(:author_email), "fb fontGrey3 mr5 fl hidden maxwidth150 ml5") %>
<div class="fl">提交于 <%= time_tag(@changesets_latest_coimmit.try(:time)) %> 前:</div>
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.message %>"><%= @changesets_latest_coimmit.message %></div>
<% end %>
<% if @entry && @entry.kind == 'file' %>
<%= render :partial => 'link_to_functions' %>
<% else %>
<span class="fr mr5 "><font class="fb ml2 mr2 vl_branch mt2"><%= @repository.branches.count %></font> 个分支</span>
<% end %>
<span class="fr mr5"><font class="fb ml2 mr2 vl_commit">
<%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)} 提交", {: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>

View File

@ -17,8 +17,9 @@
{:method => :get, :id => 'revision_selector'}) do -%>
<!-- Branches Dropdown -->
<% if !@repository.branches.nil? && @repository.branches.length > 0 -%>
<%= l(:label_branch) %>:
<%= select_tag :branch, options_for_select(@repository.branches, @rev), :id => 'branch' %>
<label class="pro-fenzhi-label fl">分支</label>
<%= select_tag :branch, options_for_select(@repository.branches, @rev), :id => 'branch', :class => "pro-fenzhi-select fl" %>
<% end -%>
<%# if !@repository.tags.nil? && @repository.tags.length > 0 -%>

View File

@ -1,8 +1,5 @@
<%#= call_hook(:view_repositories_show_contextual, {:repository => @repository, :project => @project}) %>
<div class="wrap-big">
<div class="project_r_h">
<%= render :partial => "top" %>
</div>
<div class="repository_con" style="line-height:1.9;">
<% if @entries.nil? %>
<%# 未提交代码提示 %>
@ -20,33 +17,43 @@
<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>
<!--quality_analysis-->
<% 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 %>
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fr" %>
<% end %>
<ul class="clearfix pro-top-info mb10">
<li><i class="icon-time mr5 c_grey02 f16 fb"></i>
<%=link_to "#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)}",
{:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param,
:rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"}, :class => "linkBlue fb" %> 提交
</li>
<li><i class="icon-sitemap mr5 c_grey02 f16 fb"></i>
<a class="linkBlue fb "><%= @repository.branches.count %></a>分支
</li>
<li><i class="icon-bar-chart mr5 c_grey02 f16 fb"></i>
<%=link_to "贡献统计", stats_repository_project_path(:id => @project.id, :repository_id => @repository.identifier, :rev => @rev,
:creator => @creator, :default_branch => @g_default_branch ) %>
</li>
</ul>
<div class=" clearfix mb10">
<div class=" fl clearfix">
<%= render :partial => 'navigation' %>
</div>
<a href="<%= @zip_path %>" class="btn_zipdown fl ml10" 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 fl ml10" %>
<% 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 fl ml10" %>
<% end %>
<% end %>
<% unless QualityAnalysis.where(:project_id => @project.id).first.nil? %>
<%= link_to "代码分析结果", project_quality_analysis_path(:project_id => @project.id), :class => "btn_zipdown fl ml10" %>
<% end %>
<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>
<div class="cl"></div>
<!--目录跳转-->
<div class="mt3">
<%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
<div class="fr ">
<label class="pro-fenzhi-label fl">克隆网址</label>
<input type="text" id="copy_rep_content" class="pro-fenzhi-input fl" value="<%= @repos_url.to_s.lstrip %>"/>
<a href="javascript:void(0);" alt="点击复制版本库地址" onclick="jsCopy()" title="点击复制版本库地址" class="fl pro-fenzhi-a"><i class="icon-copy"></i></a>
</div>
</div>
<div class="cl"></div>
<%= render :partial => 'latest_commit' %>
<div class="cl"></div>

View File

@ -71,7 +71,7 @@ dt.project { background-image: url(/images/projects.png); }
dt.time-entry { background-image: url(/images/time.png); }
/***** Icons *****/
.icon {
.old-icon {
background-position: 0% 50%;
background-repeat: no-repeat;
font-family: '微软雅黑'; /*modify by men*/
@ -97,7 +97,7 @@ dt.time-entry { background-image: url(/images/time.png); }
.icon-save { background-image: url(/images/save.png); }
.icon-cancel { background-image: url(/images/cancel.png); }
.icon-multiple { background-image: url(/images/table_multiple.png); }
.icon-folder { background-image: url(/images/folder.png); }
.old-icon-folder { background-image: url(/images/folder.png); }
.open .icon-folder { background-image: url(/images/folder_open.png); }
.icon-package { background-image: url(/images/package.png); }
.icon-user { background-image: url(/images/user.png); }
@ -126,24 +126,24 @@ dt.time-entry { background-image: url(/images/time.png); }
.icon-passwd { background-image: url(/images/textfield_key.png); }
.icon-test { background-image: url(/images/bullet_go.png); }
.icon-file { background-image: url(/images/files/default.png); }
.icon-file.text-plain { background-image: url(/images/files/text.png); }
.icon-file.text-x-c { background-image: url(/images/files/c.png); }
.icon-file.text-x-csharp { background-image: url(/images/files/csharp.png); }
.icon-file.text-x-java { background-image: url(/images/files/java.png); }
.icon-file.text-x-javascript { background-image: url(/images/files/js.png); }
.icon-file.text-x-php { background-image: url(/images/files/php.png); }
.icon-file.text-x-ruby { background-image: url(/images/files/ruby.png); }
.icon-file.text-xml { background-image: url(/images/files/xml.png); }
.icon-file.text-css { background-image: url(/images/files/css.png); }
.icon-file.text-html { background-image: url(/images/files/html.png); }
.icon-file.image-gif { background-image: url(/images/files/image.png); }
.icon-file.image-jpeg { background-image: url(/images/files/image.png); }
.icon-file.image-png { background-image: url(/images/files/image.png); }
.icon-file.image-tiff { background-image: url(/images/files/image.png); }
.icon-file.application-pdf { background-image: url(/images/files/pdf.png); }
.icon-file.application-zip { background-image: url(/images/files/zip.png); }
.icon-file.application-x-gzip { background-image: url(/images/files/zip.png); }
.old-icon-file { background-image: url(/images/files/default.png); }
.old-icon-file.text-plain { background-image: url(/images/files/text.png); }
.old-icon-file.text-x-c { background-image: url(/images/files/c.png); }
.old-icon-file.text-x-csharp { background-image: url(/images/files/csharp.png); }
.old-icon-file.text-x-java { background-image: url(/images/files/java.png); }
.old-icon-file.text-x-javascript { background-image: url(/images/files/js.png); }
.old-icon-file.text-x-php { background-image: url(/images/files/php.png); }
.old-icon-file.text-x-ruby { background-image: url(/images/files/ruby.png); }
.old-icon-file.text-xml { background-image: url(/images/files/xml.png); }
.old-icon-file.text-css { background-image: url(/images/files/css.png); }
.old-icon-file.text-html { background-image: url(/images/files/html.png); }
.old-icon-file.image-gif { background-image: url(/images/files/image.png); }
.old-icon-file.image-jpeg { background-image: url(/images/files/image.png); }
.old-icon-file.image-png { background-image: url(/images/files/image.png); }
.old-icon-file.image-tiff { background-image: url(/images/files/image.png); }
.old-icon-file.application-pdf { background-image: url(/images/files/pdf.png); }
.old-icon-file.application-zip { background-image: url(/images/files/zip.png); }
.old-icon-file.application-x-gzip { background-image: url(/images/files/zip.png); }
img.gravatar {
padding: 2px;

View File

@ -223,7 +223,7 @@ p.percent {
float: left;
white-space: nowrap;
line-height: 1.4em;
padding-top: 5px;
/*padding-top: 5px;*/
font-size: 12px;
}
.repositorytitle select{ width: 110px; height: 21px; }
@ -1074,4 +1074,72 @@ a:hover.btn_newpro_grey,a:active.btn_newpro_grey{ background: #eaeaea;}
.my_issues_form_filter{ position: absolute; top:0; right: 0;}
.my_issues_form_filter select{ width:70px; height:30px; border:none; font-size:14px; border:none;border-right:none; color: #888; font-size: 12px; line-height: 30px; text-align:center}
.my_issues_form_filter select.issues_filter_select_min{width:50px; }
.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;}
.my_issues_form_filter select{appearance:none;-moz-appearance:none;-webkit-appearance:none;}
/* 版本库分析20170103byLB*/
#conbox {font-size: 12px; width:100%;}
#tags {padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px; height: 30px}
#tags li { float: left; margin-right: 1px; height:30px;}
#tags li a {float:left; padding:5px 25px; display: block; text-align:center;border:1px solid #dbdbdb; border-bottom:none;-webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background: #f2f2f2;font-size: 14px; }
#tags li.emptyTag {background: none transparent scroll repeat 0% 0%; width: 4px}
#tags li.selectTag {background-position: left top; margin-bottom: -2px; position: relative; height: 25px}
#tags li.selectTag a {background:#fff; color: #333; }
#tagContent {border: #ddd 1px solid; background-color: #fff;}
.tagContent {display: none; color: #474747; }
#tagContent div.selectTag {display: block}
a.pro_new_tabbtn{padding: 3px 10px; font-size: 12px;line-height: 20px; background-image: linear-gradient(#fcfcfc, #eee); border: 1px solid #d5d5d5;border-radius: 3px; color: #333;}
a.pro_new_tabbtn_act { background-image: linear-gradient(#666, #848484); color: #fff;}
.momalselect{border:1px solid #e5e5e5; height:30px; light-height:30px;}
.new_roadmap_table_nobg thead tr th{ border-bottom:1px solid #e5e5e5; font-weight: bold; color: #333;}
.new_roadmap_table_nobg tbody tr td{ line-height: normal;}
.sy_class_users_st img { width: 30px;height: 30px; border: 1px solid #fff; border-radius: 50px; }
a.sy_class_users_st_name { display: inline-block; width: 70px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden;}
.new-conbox{ width: 1000px; }
.icons-commit-list{ display: block; width: 15px; height: 15px; background: url(../images/new_project/icons-commint.png) 0px -1px no-repeat }
.icons-commit-list:hover,.icons-commit-list:active{background: url(../images/new_project/icons-commint.png) -33px -1px no-repeat }
.icons-commit-graph{ display: block; width: 18px; height: 15px; background: url(../images/new_project/icons-commint.png) 0 -31px no-repeat }
.icons-commit-graph:hover,.icons-commit-graph:active{background: url(../images/new_project/icons-commint.png) -33px -31px no-repeat }
.sonar-top{border-bottom:1px solid #e5e5e5; padding:10px; }
.sonar-con{ padding:15px; width: 968px; color: #666; line-height: 1.9;}
.sonar-con-left{ text-align: center;}
.sonar-con-top{margin:15px; width: 100%;}
.sonar-con-map{ margin:15px; margin-top:0; padding:15px; border:1px solid #e5e5e5; width: 938px;}
.level {display: inline-block;width: 80px; height: 24px; line-height: 24px;border-radius: 24px; box-sizing: border-box;color: #fff; text-align: center; text-shadow: 0 0 1px rgba(0,0,0,.35);}
.level-A{background-color: #00aa00;}
.level-B{background-color: #80cc00;}
.level-C{background-color: #ffee00; color: #333;}
.level-D{background-color: #f77700;}
.level-E {background-color: #ee0000;}
.level-OK {background-color: #85bb43;}
.level-ERROR {background-color: #d4333f;}
.level-box{ width:800px; margin:30px auto;}
.level-box li{ float: left; margin-right: 25px;}
.sonar-show-box{ width: 350px; height: 24px;}
.sonar-show-box span{ display:inline-block; height: 20px; color:#666; line-height: 20px; text-align: center;}
.sonar-25 { width: 25%;}
.sonar-35 { width: 35%;}
.sonar-40 { width: 40%;}
.sonar-bg-lgreen{ background:#eee;}
.sonar-bg-green{ background:#ddd;}
.sonar-bg-dgreen{ background:#ccc;}
.sonar-shuju-box{ width: 300px; padding:5px 0; border-left:1px solid #ddd; min-height: 118px;}
.t-c{ text-align:center;}
td.t-l{ text-align:left;}
td.t-r{ text-align:right;}
.sonar-shuju-table{ background: none; margin-left: 40px; margin-right: 40px;}
.sonar-shuju-table td{ width:100px;}
.fontGreen{ color:#85bb43;}
.pro-top-info{border:1px solid #eee; }
.pro-top-info li{ width:295px; padding:10px 15px; font-size: 14px; float: left; text-align: center;}
.pro-top-info li:hover{ background:#f2f2f2;}
a.btn_zipdown{ display:block; height:25px; width:80px; text-align: center; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-left: 5px;}
a:hover.btn_zipdown{color:#269ac9;}
label.pro-fenzhi-label{ height:25px; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);color: #7f7f7f;border-radius:3px; border-top-right-radius: 0;
border-bottom-right-radius: 0; display: inline-block; text-align: center; padding:0 15px; border-right: none;}
select.pro-fenzhi-select{ height: 27px; line-height: 27px; color: #666;}
input.pro-fenzhi-input { height: 25px; line-height: 25px; color: #666; width:300px;}
a.pro-fenzhi-a{height:25px; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);color: #7f7f7f;border-radius:3px; border-top-left-radius: 0;
border-bottom-right-radius: 0; display: inline-block; text-align: center; padding:0 5px; border-left: none;}
a:hover.pro-fenzhi-a{color:#3b94d6;}