BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
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
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
19 additions
and
27 deletions
+19
-27
system_note_helper.rb
app/helpers/system_note_helper.rb
+14
-1
_common.html.haml
app/views/events/event/_common.html.haml
+1
-7
_created_project.html.haml
app/views/events/event/_created_project.html.haml
+1
-7
_note.html.haml
app/views/events/event/_note.html.haml
+1
-6
_push.html.haml
app/views/events/event/_push.html.haml
+2
-6
_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