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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
466ca12e
Commit
466ca12e
authored
7 years ago
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add helper for using avatars vs icons
parent
71b7461f
No related merge requests found
Changes
6
Hide 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
module
SystemNoteHelper
ICON_NAMES_BY_ACTION
=
{
ICON_NAMES_BY_ACTION
=
{
'commit'
=>
'icon_commit'
,
'commit'
=>
'icon_commit'
,
'push'
=>
'icon_commit'
,
'pushed to'
=>
'icon_commit'
,
'pushed new'
=>
'icon_commit'
,
'merge'
=>
'icon_merge'
,
'merge'
=>
'icon_merge'
,
'merged'
=>
'icon_merged'
,
'merged'
=>
'icon_merged'
,
'opened'
=>
'icon_status_open'
,
'opened'
=>
'icon_status_open'
,
...
@@ -28,4 +29,16 @@ module SystemNoteHelper
...
@@ -28,4 +29,16 @@ module SystemNoteHelper
icon_name
=
ICON_NAMES_BY_ACTION
[
note
]
icon_name
=
ICON_NAMES_BY_ACTION
[
note
]
custom_icon
(
icon_name
)
if
icon_name
custom_icon
(
icon_name
)
if
icon_name
end
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
end
This diff is collapsed.
Click to expand it.
app/views/events/event/_common.html.haml
View file @
466ca12e
-
if
current_path?
(
'users#show'
)
=
icon_for_profile_event
(
event
)
-
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
)
.event-title
.event-title
%span
.author_name
=
link_to_author
event
%span
.author_name
=
link_to_author
event
...
...
This diff is collapsed.
Click to expand it.
app/views/events/event/_created_project.html.haml
View file @
466ca12e
-
if
current_path?
(
'users#show'
)
=
icon_for_profile_event
(
event
)
.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
)
.event-title
.event-title
%span
.author_name
=
link_to_author
event
%span
.author_name
=
link_to_author
event
...
...
This diff is collapsed.
Click to expand it.
app/views/events/event/_note.html.haml
View file @
466ca12e
-
if
current_path?
(
'users#show'
)
=
icon_for_profile_event
(
event
)
.system-note-image
=
icon_for_system_note
(
event
.
action_name
)
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
.event-title
.event-title
%span
.author_name
=
link_to_author
event
%span
.author_name
=
link_to_author
event
...
...
This diff is collapsed.
Click to expand it.
app/views/events/event/_push.html.haml
View file @
466ca12e
-
project
=
event
.
project
-
project
=
event
.
project
-
if
current_path?
(
'users#show'
)
.system-note-image
=
icon_for_profile_event
(
event
)
=
icon_for_system_note
(
event
.
data
[
:event_name
])
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
.event-title
.event-title
%span
.author_name
=
link_to_author
event
%span
.author_name
=
link_to_author
event
...
...
This diff is collapsed.
Click to expand it.
app/views/shared/icons/_trash_o.svg
→
app/views/shared/icons/_
icon_
trash_o.svg
View file @
466ca12e
File moved
This diff is collapsed.
Click to expand it.
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