BigW Consortium Gitlab

Show only first line of commit message on dashboard

parent 6055c615
...@@ -127,4 +127,10 @@ module EventsHelper ...@@ -127,4 +127,10 @@ module EventsHelper
text = truncate(text, length: 150) text = truncate(text, length: 150)
sanitize(markdown(text), tags: %w(a img b pre p)) sanitize(markdown(text), tags: %w(a img b pre p))
end end
def event_commit_title(message)
escape_once(truncate(message.split("\n").first, length: 70))
rescue
"--broken encoding"
end
end end
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
.commit-row-title .commit-row-title
= link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: '' = link_to commit[:id][0..8], project_commit_path(project, commit[:id]), class: "commit_short_id", alt: ''
   
= gfm escape_once(truncate(commit[:message], length: 70)) rescue "--broken encoding" = gfm event_commit_title(commit[:message])
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment