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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
08e52a56
Commit
08e52a56
authored
Jun 07, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor event title for notes
parent
d0357f3b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
19 deletions
+29
-19
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+28
-0
app/views/events/event/_note.html.haml
app/views/events/event/_note.html.haml
+1
-19
No files found.
app/helpers/events_helper.rb
View file @
08e52a56
...
...
@@ -91,4 +91,32 @@ module EventsHelper
url_for
([
event
.
project
,
event
.
note_target
])
end
end
def
event_note_title_html
(
event
)
if
event
.
note_target
if
event
.
note_commit?
link_to
project_commit_path
(
event
.
project
,
event
.
note_commit_id
),
class:
"commit_short_id"
do
"
#{
event
.
note_target_type
}
#{
event
.
note_short_commit_id
}
"
end
elsif
event
.
note_project_snippet?
link_to
(
project_snippet_path
(
event
.
project
,
event
.
note_target
))
do
content_tag
:strong
do
"
#{
event
.
note_target_type
}
#
#{
truncate
event
.
note_target_id
}
"
end
end
else
link_to
event_note_target_path
(
event
)
do
content_tag
:strong
do
"
#{
event
.
note_target_type
}
#
#{
truncate
event
.
note_target_id
}
"
end
end
end
elsif
event
.
wall_note?
link_to
'wall'
,
project_wall_path
(
event
.
project
)
else
content_tag
:strong
do
"(deleted)"
end
end
end
end
app/views/events/event/_note.html.haml
View file @
08e52a56
.event-title
%span
.author_name
=
link_to_author
event
%span
.event_label
commented on
-
if
event
.
note_target
-
if
event
.
note_commit?
=
event
.
note_target_type
=
link_to
event
.
note_short_commit_id
,
project_commit_path
(
event
.
project
,
event
.
note_commit_id
),
class:
"commit_short_id"
-
elsif
event
.
note_project_snippet?
=
link_to
project_snippet_path
(
event
.
project
,
event
.
note_target
)
do
%strong
#{
event
.
note_target_type
}
##{truncate event.note_target_id}
-
else
=
link_to
event_note_target_path
(
event
)
do
%strong
#{
event
.
note_target_type
}
##{truncate event.note_target_id}
-
elsif
event
.
wall_note?
=
link_to
'wall'
,
project_wall_path
(
event
.
project
)
-
else
%strong
(deleted)
at
%span
.event_label
commented on
#{
event_note_title_html
(
event
)
}
at
-
if
event
.
project
=
link_to_project
event
.
project
-
else
...
...
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