UI fixes for commits lists

This commit is contained in:
Dmitriy Zaporozhets 2013-09-10 13:15:49 +03:00
parent a30ce86690
commit 94d364e8cc
6 changed files with 30 additions and 28 deletions

View File

@ -469,7 +469,6 @@ li.commit {
}
.commit_short_id {
float: left;
min-width: 65px;
font-family: $monospace_font;
}
@ -494,4 +493,15 @@ li.commit {
@extend .cgray;
}
}
&.inline-commit {
.commit-row-title {
font-size: 13px;
}
.committed_ago {
float: right;
@extend .cgray;
}
}
}

View File

@ -56,10 +56,6 @@
margin-left: 35px;
margin-right: 100px;
.commit p {
color: #666;
padding-top: 5px;
}
.event-info {
color: #666;
}
@ -107,13 +103,6 @@
}
}
ul {
.avatar {
width: 18px;
margin: 2px 4px;
}
}
&:last-child { border:none }
.event_commits {
@ -124,12 +113,14 @@
background: transparent;
padding: 3px;
border: none;
font-size: 12px;
color: #666;
.commit-row-title {
font-size: 12px;
}
}
&.commits-stat {
display: block;
padding: 3px;
margin-top: 3px;
&:hover {
background: none;

View File

@ -64,13 +64,6 @@
margin: 0;
padding: 0;
padding: 5px 0;
.avatar { position:relative }
.commit-author-name,
.dash,
.committed_ago,
.browse_code_link_holder {
display: none;
}
list-style: none;
&:hover {
background: none;

View File

@ -56,8 +56,9 @@ module CommitsHelper
end
end
def commit_to_html commit, project
escape_javascript(render 'projects/commits/commit', commit: commit, project: project) unless commit.nil?
def commit_to_html(commit, project, inline = true)
template = inline ? "inline_commit" : "commit"
escape_javascript(render "projects/commits/#{template}", commit: commit, project: project) unless commit.nil?
end
def diff_line_content(line)

View File

@ -1,7 +1,5 @@
%li.commit
%p
.commit-row-title
= link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: ''
%span= commit[:author][:name]
–
= image_tag gravatar_icon(commit[:author][:email]), class: "avatar", width: 16
= gfm escape_once(truncate(commit[:message], length: 50)) rescue "--broken encoding"
 
= gfm escape_once(truncate(commit[:message], length: 70)) rescue "--broken encoding"

View File

@ -0,0 +1,9 @@
%li.commit.inline-commit
.commit-row-title
= link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id"
 
= link_to_gfm truncate(commit.title, length: 40), project_commit_path(project, commit.id), class: "commit-row-message"
%time.committed_ago{ datetime: commit.committed_date, title: commit.committed_date.stamp("Aug 21, 2011 9:23pm") }
= time_ago_in_words(commit.committed_date)
ago