Commit 844f8fd2131e10832efd05175930944c0ed9df63
1 parent
6055c615
Exists in
master
and in
4 other branches
Show only first line of commit message on dashboard
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing
2 changed files
with
7 additions
and
1 deletions
Show diff stats
app/helpers/events_helper.rb
... | ... | @@ -127,4 +127,10 @@ module EventsHelper |
127 | 127 | text = truncate(text, length: 150) |
128 | 128 | sanitize(markdown(text), tags: %w(a img b pre p)) |
129 | 129 | end |
130 | + | |
131 | + def event_commit_title(message) | |
132 | + escape_once(truncate(message.split("\n").first, length: 70)) | |
133 | + rescue | |
134 | + "--broken encoding" | |
135 | + end | |
130 | 136 | end | ... | ... |
app/views/events/_commit.html.haml
... | ... | @@ -2,4 +2,4 @@ |
2 | 2 | .commit-row-title |
3 | 3 | = link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: '' |
4 | 4 | |
5 | - = gfm escape_once(truncate(commit[:message], length: 70)) rescue "--broken encoding" | |
5 | + = gfm event_commit_title(commit[:message]) | ... | ... |