Commit 7300440a74fb476bad454a99d3a39e509d77e70f

Authored by Dmitriy Zaporozhets
1 parent 57b62c2b

Improve Commit#show page UI

app/assets/stylesheets/sections/commits.scss
... ... @@ -440,17 +440,24 @@
440 440 margin-top: 10px;
441 441 }
442 442  
443   -.ui-box.commit-box {
444   - margin-top: 0;
445   -
446   - .commit-committer-link,
447   - .commit-author-link {
448   - color: #333;
  443 +.commit-box {
  444 + margin: 10px 0;
  445 + border-top: 1px solid #ddd;
  446 + border-bottom: 1px solid #ddd;
  447 + padding: 20px 0;
  448 +
  449 + .commit-title {
  450 + margin: 0;
  451 + font-size: 20px;
449 452 font-weight: bold;
450   - text-shadow: 0 1px 1px #FFF;
  453 + }
  454 +
  455 + .commit-description {
  456 + margin-top: 15px;
451 457 }
452 458 }
453 459  
  460 +
454 461 .commit-stat-summary {
455 462 color: #666;
456 463 line-height: 2;
... ... @@ -477,3 +484,15 @@ li.commit {
477 484 .commit-breadcrumb {
478 485 padding: 0;
479 486 }
  487 +
  488 +.commit-info-row {
  489 + margin-bottom: 10px;
  490 + .avatar {
  491 + @extend .avatar-inline;
  492 + }
  493 + .commit-committer-link,
  494 + .commit-author-link {
  495 + color: #444;
  496 + font-weight: bold;
  497 + }
  498 +}
... ...
app/views/projects/commit/_commit_box.html.haml
1   -.ui-box.ui-box-show.commit-box
2   - .ui-box-head
3   - .pull-right
4   - - if @notes_count > 0
5   - %span.btn.disabled.grouped
6   - %i.icon-comment
7   - = @notes_count
8   - .left.btn-group
9   - %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
10   - %i.icon-download-alt
11   - Download as
12   - %span.caret
13   - %ul.dropdown-menu
14   - %li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
15   - %li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
16   - = link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do
17   - %span Browse Code »
18   - %h3.commit-title.page-title
19   - = gfm escape_once(@commit.title)
20   - - if @commit.description.present?
21   - %pre.commit-description
22   - = gfm escape_once(@commit.description)
23   - .ui-box-body
24   - .row
25   - .span5
26   - .author
27   - = commit_author_link(@commit, avatar: true, size: 32)
28   - authored
29   - %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
30   - #{time_ago_in_words(@commit.authored_date)} ago
31   - - if @commit.different_committer?
32   - .committer
33   - →
34   - = commit_committer_link(@commit)
35   - committed
36   - %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
37   - #{time_ago_in_words(@commit.committed_date)} ago
38   - .span6.pull-right
39   - .pull-right
40   - .sha-block
41   - %span.cgray commit
42   - %span.label_commit= @commit.id
43   - .clearfix
44   - .pull-right
45   - .sha-block
46   - %span.cgray= pluralize(@commit.parents.count, "parent")
47   - - @commit.parents.each do |parent|
48   - = link_to parent.id[0...10], project_commit_path(@project, parent)
  1 +.pull-right
  2 + %div
  3 + - if @notes_count > 0
  4 + %span.btn.disabled.grouped
  5 + %i.icon-comment
  6 + = @notes_count
  7 + .pull-left.btn-group
  8 + %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
  9 + %i.icon-download-alt
  10 + Download as
  11 + %span.caret
  12 + %ul.dropdown-menu
  13 + %li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
  14 + %li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
  15 + = link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do
  16 + %span Browse Code »
  17 + %div
49 18  
  19 +%p
  20 + %span.light Commit
  21 + = link_to @commit.id, project_commit_path(@project, @commit)
  22 +.commit-info-row
  23 + %span.light Authored by
  24 + %strong
  25 + = commit_author_link(@commit, avatar: true, size: 24)
  26 + %time{title: @commit.authored_date.stamp("Aug 21, 2011 9:23pm")}
  27 + #{time_ago_in_words(@commit.authored_date)} ago
50 28  
  29 +- if @commit.different_committer?
  30 + .commit-info-row
  31 + %span.light Committed by
  32 + %strong
  33 + = commit_committer_link(@commit, avatar: true, size: 24)
  34 + %time{title: @commit.committed_date.stamp("Aug 21, 2011 9:23pm")}
  35 + #{time_ago_in_words(@commit.committed_date)} ago
  36 +
  37 +.commit-info-row
  38 + %span.cgray= pluralize(@commit.parents.count, "parent")
  39 + - @commit.parents.each do |parent|
  40 + = link_to parent.id[0...10], project_commit_path(@project, parent)
  41 +
  42 +.commit-box
  43 + %h3.commit-title
  44 + = gfm escape_once(@commit.title)
  45 + - if @commit.description.present?
  46 + %pre.commit-description
  47 + = gfm escape_once(@commit.description)
... ...