diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index bd6c67f58..891b533d6 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -479,6 +479,9 @@ update def entry entry_and_raw(false) @content = @repository.cat(@path, @rev) + @changesets_latest_coimmit = @g.commit(@project.gpid, @entry.try(:lastrev)) + # 总的提交数 + @changesets_all_count = @g.user_static(@project.gpid, :rev => @rev).count if is_entry_text_data?(@content, @path) render :layout => 'base_projects' end diff --git a/app/views/repositories/_latest_commit.html.erb b/app/views/repositories/_latest_commit.html.erb new file mode 100644 index 000000000..e70e1d763 --- /dev/null +++ b/app/views/repositories/_latest_commit.html.erb @@ -0,0 +1,25 @@ +
+ <% 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") %> + +
提交于 <%= time_tag(@changesets_latest_coimmit.created_at) %> 前:
+
<%= @changesets_latest_coimmit.message %>
+
+ <% else %> + +
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
+
<%= @changesets_latest_coimmit.message %>
+
+ <%end%> + <% end %> + <% if @entry && @entry.kind == 'file' %> + <%= render :partial => 'link_to_functions' %> + <% else %> + <%= @repository.branches.count %> 个分支 + <% end %> + + <%=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}"} %> + + +
\ No newline at end of file diff --git a/app/views/repositories/_link_to_functions.html.erb b/app/views/repositories/_link_to_functions.html.erb index d7ce47783..0e777217f 100644 --- a/app/views/repositories/_link_to_functions.html.erb +++ b/app/views/repositories/_link_to_functions.html.erb @@ -1,10 +1,8 @@ <% if @entry && @entry.kind == 'file' %> - -

-<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | -<% if @repository.supports_cat? %> - <%= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> | -<% end %> +<%= link_to_if action_name != 'changes', l(:label_history), {:action => 'changes', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }, :class =>"fr mr5"%> +<%# if @repository.supports_cat? %> + <%#= link_to_if action_name != 'entry', l(:button_view), {:action => 'entry', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev }, :class =>"fr" %> +<%# end %> <%# if @repository.supports_annotate? %> <%#= link_to_if action_name != 'annotate', l(:button_annotate), {:action => 'annotate', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), :rev => @rev } %> <%# end %> @@ -12,8 +10,6 @@ {:action => 'raw', :id => @project, :repository_id => @repository.identifier_param, :path => to_path_param(@path), - :rev => @rev}) if @repository.supports_cat? %> + :rev => @rev}, :class => "fr mr5") if @repository.supports_cat? %> <%= "(#{number_to_human_size(@entry.size)})" if @entry.size %> -

- <% end %> diff --git a/app/views/repositories/entry.html.erb b/app/views/repositories/entry.html.erb index d463f91b3..14cd1c3e3 100644 --- a/app/views/repositories/entry.html.erb +++ b/app/views/repositories/entry.html.erb @@ -1,14 +1,15 @@ <%= call_hook(:view_repositories_show_contextual, { :repository => @repository, :project => @project }) %>
-
+
<%= render :partial => 'navigation' %>
- -

<%= l(:label_revision_path) %> :<%= @path %>

- - <%= render :partial => 'link_to_functions' %> - + +
+ <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %> +
+
+ <%= render :partial => 'latest_commit' %> <%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %> <% content_for :header_tags do %> diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index 4e9638134..cf6ee0dc8 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -52,29 +52,7 @@ <%= render :partial => 'breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
-
- <% 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") %> - -
提交于 <%= time_tag(@changesets_latest_coimmit.created_at) %> 前:
-
<%= @changesets_latest_coimmit.message %>
-
- <% else %> - -
提交于<%= time_tag(@changesets_latest_coimmit.created_at) %>:
-
<%= @changesets_latest_coimmit.message %>
-
- <%end%> - <% end %> - - <%= @repository.branches.count %> 个分支 - - - - <%=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}"} %> - -
+ <%= render :partial => 'latest_commit' %>
<% end %> diff --git a/public/stylesheets/css/common.css b/public/stylesheets/css/common.css index 223540d50..12fe8ff14 100644 --- a/public/stylesheets/css/common.css +++ b/public/stylesheets/css/common.css @@ -183,6 +183,7 @@ h4{ font-size:14px;}/*color:#3b3b3b;*/ .mt-20 {margin-top:-20px;} .mt-10 {margin-top:-10px;} .mt-4 {margin-top:-4px;} +.mt-5 {margin-top:-5px;} .mt-2 {margin-top:-2px;} .mt0 {margin-top: 0px !important;} .mt1{margin-top: 1px;} diff --git a/public/stylesheets/css/project.css b/public/stylesheets/css/project.css index cb8e4efaf..09dced2ad 100644 --- a/public/stylesheets/css/project.css +++ b/public/stylesheets/css/project.css @@ -216,9 +216,6 @@ p.percent { float: right; white-space: nowrap; line-height: 1.4em; - padding-left: 10px; - padding-right: 10px; - padding-top: 5px; font-size: 0.9em; } diff --git a/public/stylesheets/repository.css b/public/stylesheets/repository.css index 7e41331cb..56ec46e39 100644 --- a/public/stylesheets/repository.css +++ b/public/stylesheets/repository.css @@ -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:100%; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;} +.recordBanner {width:99%; 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;} diff --git a/public/stylesheets/scm.css b/public/stylesheets/scm.css index 46761a46e..f9cb2e7c2 100644 --- a/public/stylesheets/scm.css +++ b/public/stylesheets/scm.css @@ -34,7 +34,7 @@ li.change .copied-from:before { content: " - "} #changes-legend { float: right; font-size: 0.8em; margin:0; margin-right: 10px; }/*by young*/ #changes-legend li { float: left; background-position: 5px 0; } -table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width:98%; background-color: #fafafa; } +table.filecontent { border: 1px solid #e2e2e2; border-collapse: collapse; width:99%; background-color: #fafafa; } table.filecontent tbody {font-family:"Liberation Mono", Courier, monospace; font-size:12px;} table.filecontent th { border: 1px solid #e2e2e2; background-color: #eee; } table.filecontent th.filename { background-color: #e4e4d4; text-align: left; padding:5px;}