Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
40d61910
Commit
40d61910
authored
Sep 01, 2012
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add link_title to CommitDecorator
parent
8db2a59d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
app/decorators/commit_decorator.rb
app/decorators/commit_decorator.rb
+9
-0
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+1
-1
No files found.
app/decorators/commit_decorator.rb
View file @
40d61910
class
CommitDecorator
<
ApplicationDecorator
decorates
:commit
# Returns a string describing the commit for use in a link title
#
# Example
#
# "Commit: Alex Denisov - Project git clone panel"
def
link_title
"Commit:
#{
author_name
}
-
#{
title
}
"
end
# Returns the commits title.
#
# Usually, the commit title is the first line of the commit message.
...
...
lib/gitlab/markdown.rb
View file @
40d61910
...
...
@@ -100,7 +100,7 @@ module Gitlab
def
reference_commit
(
identifier
)
if
commit
=
@project
.
commit
(
identifier
)
link_to
(
identifier
,
project_commit_path
(
@project
,
id:
commit
.
id
),
html_options
.
merge
(
title:
"Commit:
#{
commit
.
author_name
}
-
#{
CommitDecorator
.
new
(
commit
).
title
}
"
,
class:
"gfm gfm-commit
#{
html_options
[
:class
]
}
"
))
link_to
(
identifier
,
project_commit_path
(
@project
,
id:
commit
.
id
),
html_options
.
merge
(
title:
CommitDecorator
.
new
(
commit
).
link_title
,
class:
"gfm gfm-commit
#{
html_options
[
:class
]
}
"
))
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment