Commit 788de6f1c8a60e908a584eb251f9c88f5bc8abbd
1 parent
7d56a51b
Exists in
master
and in
4 other branches
Better commit show page
Showing
3 changed files
with
38 additions
and
20 deletions
Show diff stats
app/assets/stylesheets/common.scss
| ... | ... | @@ -1011,23 +1011,37 @@ p.time { |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | 1013 | .issue_box, |
| 1014 | +.commit_box, | |
| 1014 | 1015 | .merge_request_box{ |
| 1015 | 1016 | @extend .padded; |
| 1016 | 1017 | @extend .borders; |
| 1017 | 1018 | @extend .prepend-top-20; |
| 1018 | 1019 | @extend .append-bottom-20; |
| 1020 | + border-width:2px; | |
| 1019 | 1021 | |
| 1020 | 1022 | img { max-width: 100%; } |
| 1021 | 1023 | |
| 1022 | 1024 | pre { |
| 1023 | - background: white !important; | |
| 1024 | - | |
| 1025 | 1025 | code { |
| 1026 | 1026 | background: none !important; |
| 1027 | 1027 | } |
| 1028 | 1028 | } |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | +.commit_box { | |
| 1032 | + .commit_message { | |
| 1033 | + margin: -20px; | |
| 1034 | + padding: 20px; | |
| 1035 | + margin-top:10px; | |
| 1036 | + border-radius:0; | |
| 1037 | + border:none; | |
| 1038 | + font-size:12px; | |
| 1039 | + background-color:#f5f5f5; | |
| 1040 | + border:none; | |
| 1041 | + border-top:1px solid #eee; | |
| 1042 | + } | |
| 1043 | +} | |
| 1044 | + | |
| 1031 | 1045 | .highlight_word { |
| 1032 | 1046 | background:#EEDC94; |
| 1033 | 1047 | } | ... | ... |
app/controllers/commits_controller.rb
| ... | ... | @@ -32,6 +32,8 @@ class CommitsController < ApplicationController |
| 32 | 32 | @note = @project.build_commit_note(@commit) |
| 33 | 33 | @comments_allowed = true |
| 34 | 34 | @line_notes = project.commit_line_notes(@commit) |
| 35 | + | |
| 36 | + @notes_count = @line_notes.count + project.commit_notes(@commit).count | |
| 35 | 37 | end |
| 36 | 38 | |
| 37 | 39 | def compare | ... | ... |
app/views/commits/show.html.haml
| 1 | -.commit | |
| 2 | - = link_to tree_project_ref_path(@project, @commit.id), :class => "btn right small" do | |
| 3 | - Browse Code » | |
| 4 | - = image_tag gravatar_icon(@commit.author_email), :class => "avatar" | |
| 5 | - %code= @commit.id.to_s | |
| 6 | - %h5 | |
| 7 | - = @commit.author_name | |
| 8 | - %small= @commit.created_at.stamp("Aug 21, 2011 9:23pm") | |
| 9 | - - if @commit.author_name != @commit.committer_name or @commit.author_email != @commit.committer_email or @commit.authored_date != @commit.committed_date | |
| 10 | - – | |
| 11 | - %cite committed by | |
| 12 | - = @commit.committer_name | |
| 13 | - %small= @commit.committed_date.stamp("Aug 21, 2011 9:23pm") | |
| 1 | +.commit_box | |
| 2 | + .commit | |
| 3 | + .right | |
| 4 | + - unless @notes_count.zero? | |
| 5 | + %span.btn.small.disabled.padded= pluralize @notes_count, 'note' | |
| 14 | 6 | |
| 15 | -%br | |
| 16 | -%pre.commit_message.prettyprint | |
| 17 | - = commit_msg_with_link_to_issues(@project, @commit.safe_message) | |
| 18 | -.clear | |
| 19 | -%br | |
| 7 | + = link_to tree_project_ref_path(@project, @commit.id), :class => "btn small" do | |
| 8 | + Browse Code » | |
| 9 | + = image_tag gravatar_icon(@commit.author_email), :class => "avatar" | |
| 10 | + %code= @commit.id.to_s | |
| 11 | + %h5 | |
| 12 | + = @commit.author_name | |
| 13 | + %small= @commit.created_at.stamp("Aug 21, 2011 9:23pm") | |
| 14 | + - if @commit.author_name != @commit.committer_name or @commit.author_email != @commit.committer_email or @commit.authored_date != @commit.committed_date | |
| 15 | + – | |
| 16 | + %cite committed by | |
| 17 | + = @commit.committer_name | |
| 18 | + %small= @commit.committed_date.stamp("Aug 21, 2011 9:23pm") | |
| 20 | 19 | |
| 20 | + %pre.commit_message | |
| 21 | + = commit_msg_with_link_to_issues(@project, @commit.safe_message) | |
| 22 | +%br | |
| 21 | 23 | %p.cgray |
| 22 | 24 | Showing #{pluralize(@commit.diffs.count, "changed file")} |
| 23 | 25 | = render "commits/diffs", :diffs => @commit.diffs | ... | ... |