devise session templates to haml. Fix problem with missing message in commit
This commit is contained in:
parent
0c5e556922
commit
c7cfe3d83b
5 changed files with 58 additions and 66 deletions
|
@ -16,6 +16,8 @@ class CommitDecorator < ApplicationDecorator
|
|||
# In case this first line is longer than 80 characters, it is cut off
|
||||
# after 70 characters and ellipses (`&hellp;`) are appended.
|
||||
def title
|
||||
return no_commit_message unless safe_message
|
||||
|
||||
title_end = safe_message.index(/\n/)
|
||||
if (!title_end && safe_message.length > 80) || (title_end && title_end > 80)
|
||||
safe_message[0..69] << "…".html_safe
|
||||
|
@ -35,4 +37,10 @@ class CommitDecorator < ApplicationDecorator
|
|||
safe_message.split(/\n/, 2)[1].try(:chomp)
|
||||
end
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def no_commit_message
|
||||
"--no commit message"
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue