Commit 94d364e8cc84d82d278fee3881f5fab48a149ed2
1 parent
a30ce866
Exists in
master
and in
4 other branches
UI fixes for commits lists
Showing
6 changed files
with
30 additions
and
28 deletions
Show diff stats
app/assets/stylesheets/sections/commits.scss
... | ... | @@ -469,7 +469,6 @@ li.commit { |
469 | 469 | } |
470 | 470 | |
471 | 471 | .commit_short_id { |
472 | - float: left; | |
473 | 472 | min-width: 65px; |
474 | 473 | font-family: $monospace_font; |
475 | 474 | } |
... | ... | @@ -494,4 +493,15 @@ li.commit { |
494 | 493 | @extend .cgray; |
495 | 494 | } |
496 | 495 | } |
496 | + | |
497 | + &.inline-commit { | |
498 | + .commit-row-title { | |
499 | + font-size: 13px; | |
500 | + } | |
501 | + | |
502 | + .committed_ago { | |
503 | + float: right; | |
504 | + @extend .cgray; | |
505 | + } | |
506 | + } | |
497 | 507 | } | ... | ... |
app/assets/stylesheets/sections/events.scss
... | ... | @@ -56,10 +56,6 @@ |
56 | 56 | margin-left: 35px; |
57 | 57 | margin-right: 100px; |
58 | 58 | |
59 | - .commit p { | |
60 | - color: #666; | |
61 | - padding-top: 5px; | |
62 | - } | |
63 | 59 | .event-info { |
64 | 60 | color: #666; |
65 | 61 | } |
... | ... | @@ -107,13 +103,6 @@ |
107 | 103 | } |
108 | 104 | } |
109 | 105 | |
110 | - ul { | |
111 | - .avatar { | |
112 | - width: 18px; | |
113 | - margin: 2px 4px; | |
114 | - } | |
115 | - } | |
116 | - | |
117 | 106 | &:last-child { border:none } |
118 | 107 | |
119 | 108 | .event_commits { |
... | ... | @@ -124,12 +113,14 @@ |
124 | 113 | background: transparent; |
125 | 114 | padding: 3px; |
126 | 115 | border: none; |
127 | - font-size: 12px; | |
116 | + color: #666; | |
117 | + .commit-row-title { | |
118 | + font-size: 12px; | |
119 | + } | |
128 | 120 | } |
129 | 121 | &.commits-stat { |
130 | 122 | display: block; |
131 | 123 | padding: 3px; |
132 | - margin-top: 3px; | |
133 | 124 | |
134 | 125 | &:hover { |
135 | 126 | background: none; | ... | ... |
app/assets/stylesheets/sections/merge_requests.scss
... | ... | @@ -64,13 +64,6 @@ |
64 | 64 | margin: 0; |
65 | 65 | padding: 0; |
66 | 66 | padding: 5px 0; |
67 | - .avatar { position:relative } | |
68 | - .commit-author-name, | |
69 | - .dash, | |
70 | - .committed_ago, | |
71 | - .browse_code_link_holder { | |
72 | - display: none; | |
73 | - } | |
74 | 67 | list-style: none; |
75 | 68 | &:hover { |
76 | 69 | background: none; | ... | ... |
app/helpers/commits_helper.rb
... | ... | @@ -56,8 +56,9 @@ module CommitsHelper |
56 | 56 | end |
57 | 57 | end |
58 | 58 | |
59 | - def commit_to_html commit, project | |
60 | - escape_javascript(render 'projects/commits/commit', commit: commit, project: project) unless commit.nil? | |
59 | + def commit_to_html(commit, project, inline = true) | |
60 | + template = inline ? "inline_commit" : "commit" | |
61 | + escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil? | |
61 | 62 | end |
62 | 63 | |
63 | 64 | def diff_line_content(line) | ... | ... |
app/views/events/_commit.html.haml
1 | 1 | %li.commit |
2 | - %p | |
2 | + .commit-row-title | |
3 | 3 | = link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: '' |
4 | - %span= commit[:author][:name] | |
5 | - – | |
6 | - = image_tag gravatar_icon(commit[:author][:email]), class: "avatar", width: 16 | |
7 | - = gfm escape_once(truncate(commit[:message], length: 50)) rescue "--broken encoding" | |
4 | + | |
5 | + = gfm escape_once(truncate(commit[:message], length: 70)) rescue "--broken encoding" | ... | ... |
... | ... | @@ -0,0 +1,9 @@ |
1 | +%li.commit.inline-commit | |
2 | + .commit-row-title | |
3 | + = link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id" | |
4 | + | |
5 | + = link_to_gfm truncate(commit.title, length: 40), project_commit_path(project, commit.id), class: "commit-row-message" | |
6 | + %time.committed_ago{ datetime: commit.committed_date, title: commit.committed_date.stamp("Aug 21, 2011 9:23pm") } | |
7 | + = time_ago_in_words(commit.committed_date) | |
8 | + ago | |
9 | + | ... | ... |