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
Boxiang Sun
gitlab-ce
Commits
466ca12e
Commit
466ca12e
authored
Apr 11, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helper for using avatars vs icons
parent
71b7461f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
27 deletions
+19
-27
app/helpers/system_note_helper.rb
app/helpers/system_note_helper.rb
+14
-1
app/views/events/event/_common.html.haml
app/views/events/event/_common.html.haml
+1
-7
app/views/events/event/_created_project.html.haml
app/views/events/event/_created_project.html.haml
+1
-7
app/views/events/event/_note.html.haml
app/views/events/event/_note.html.haml
+1
-6
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+2
-6
app/views/shared/icons/_icon_trash_o.svg
app/views/shared/icons/_icon_trash_o.svg
+0
-0
No files found.
app/helpers/system_note_helper.rb
View file @
466ca12e
module
SystemNoteHelper
ICON_NAMES_BY_ACTION
=
{
'commit'
=>
'icon_commit'
,
'push'
=>
'icon_commit'
,
'pushed to'
=>
'icon_commit'
,
'pushed new'
=>
'icon_commit'
,
'merge'
=>
'icon_merge'
,
'merged'
=>
'icon_merged'
,
'opened'
=>
'icon_status_open'
,
...
...
@@ -28,4 +29,16 @@ module SystemNoteHelper
icon_name
=
ICON_NAMES_BY_ACTION
[
note
]
custom_icon
(
icon_name
)
if
icon_name
end
def
icon_for_profile_event
(
event
)
if
current_path?
(
'users#show'
)
content_tag
:div
,
class:
"system-note-image
#{
event
.
action_name
}
-icon"
do
icon_for_system_note
(
event
.
action_name
)
end
else
content_tag
:div
,
class:
'system-note-image user-avatar'
do
author_avatar
(
event
,
size:
32
)
end
end
end
end
app/views/events/event/_common.html.haml
View file @
466ca12e
-
if
current_path?
(
'users#show'
)
-
if
event
.
target
.system-note-image
{
class:
"#{event.action_name}-icon"
}
=
icon_for_system_note
(
event
.
action_name
)
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
=
icon_for_profile_event
(
event
)
.event-title
%span
.author_name
=
link_to_author
event
...
...
app/views/events/event/_created_project.html.haml
View file @
466ca12e
-
if
current_path?
(
'users#show'
)
.system-note-image
{
class:
"#{event.action_name}-icon"
}
=
icon_for_system_note
(
event
.
action_name
)
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
=
icon_for_profile_event
(
event
)
.event-title
%span
.author_name
=
link_to_author
event
...
...
app/views/events/event/_note.html.haml
View file @
466ca12e
-
if
current_path?
(
'users#show'
)
.system-note-image
=
icon_for_system_note
(
event
.
action_name
)
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
=
icon_for_profile_event
(
event
)
.event-title
%span
.author_name
=
link_to_author
event
...
...
app/views/events/event/_push.html.haml
View file @
466ca12e
-
project
=
event
.
project
-
if
current_path?
(
'users#show'
)
.system-note-image
=
icon_for_system_note
(
event
.
data
[
:event_name
])
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
=
icon_for_profile_event
(
event
)
.event-title
%span
.author_name
=
link_to_author
event
...
...
app/views/shared/icons/_trash_o.svg
→
app/views/shared/icons/_
icon_
trash_o.svg
View file @
466ca12e
File moved
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