Show only first line of commit message on dashboard

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-11-01 09:36:59 +02:00
parent 6055c615db
commit 844f8fd213
No known key found for this signature in database
GPG key ID: 2CEAFD2671262EC2
2 changed files with 7 additions and 1 deletions

View file

@ -127,4 +127,10 @@ module EventsHelper
text = truncate(text, length: 150)
sanitize(markdown(text), tags: %w(a img b pre p))
end
def event_commit_title(message)
escape_once(truncate(message.split("\n").first, length: 70))
rescue
"--broken encoding"
end
end

View file

@ -2,4 +2,4 @@
.commit-row-title
= link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: ''
&nbsp;
= gfm escape_once(truncate(commit[:message], length: 70)) rescue "--broken encoding"
= gfm event_commit_title(commit[:message])