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
71b7461f
Commit
71b7461f
authored
Apr 11, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reuse system notes helper for profile event icons
parent
d4c5dc49
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
20 additions
and
25 deletions
+20
-25
app/assets/stylesheets/pages/events.scss
app/assets/stylesheets/pages/events.scss
+6
-3
app/helpers/system_note_helper.rb
app/helpers/system_note_helper.rb
+7
-2
app/views/events/event/_common.html.haml
app/views/events/event/_common.html.haml
+2
-11
app/views/events/event/_created_project.html.haml
app/views/events/event/_created_project.html.haml
+2
-2
app/views/events/event/_note.html.haml
app/views/events/event/_note.html.haml
+1
-1
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+1
-5
app/views/projects/notes/_note.html.haml
app/views/projects/notes/_note.html.haml
+1
-1
No files found.
app/assets/stylesheets/pages/events.scss
View file @
71b7461f
...
...
@@ -39,15 +39,18 @@
fill
:
$gl-text-color-secondary
;
}
&
.open-icon
svg
{
fill
:
$green-300
;
&
.opened-icon
,
&
.created-icon
{
svg
{
fill
:
$green-300
;
}
}
&
.closed-icon
svg
{
fill
:
$red-300
;
}
&
.
fork
-icon
svg
{
&
.
accepted
-icon
svg
{
fill
:
$blue-300
;
}
}
...
...
app/helpers/system_note_helper.rb
View file @
71b7461f
module
SystemNoteHelper
ICON_NAMES_BY_ACTION
=
{
'commit'
=>
'icon_commit'
,
'push'
=>
'icon_commit'
,
'merge'
=>
'icon_merge'
,
'merged'
=>
'icon_merged'
,
'opened'
=>
'icon_status_open'
,
'created'
=>
'icon_status_open'
,
'closed'
=>
'icon_status_closed'
,
'time_tracking'
=>
'icon_stopwatch'
,
'assignee'
=>
'icon_user'
,
...
...
@@ -12,15 +14,18 @@ module SystemNoteHelper
'label'
=>
'icon_tags'
,
'cross_reference'
=>
'icon_random'
,
'branch'
=>
'icon_code_fork'
,
'accepted'
=>
'icon_code_fork'
,
'confidential'
=>
'icon_eye_slash'
,
'visible'
=>
'icon_eye'
,
'milestone'
=>
'icon_clock_o'
,
'discussion'
=>
'icon_comment_o'
,
'moved'
=>
'icon_arrow_circle_o_right'
'commented on'
=>
'icon_comment_o'
,
'moved'
=>
'icon_arrow_circle_o_right'
,
'deleted'
=>
'icon_trash_o'
}.
freeze
def
icon_for_system_note
(
note
)
icon_name
=
ICON_NAMES_BY_ACTION
[
note
.
system_note_metadata
&
.
action
]
icon_name
=
ICON_NAMES_BY_ACTION
[
note
]
custom_icon
(
icon_name
)
if
icon_name
end
end
app/views/events/event/_common.html.haml
View file @
71b7461f
-
if
current_path?
(
'users#show'
)
-
if
event
.
target
-
case
event
.
action_name
-
when
'opened'
.system-note-image.open-icon
=
custom_icon
(
"icon_status_open"
)
-
when
'closed'
.system-note-image.closed-icon
=
custom_icon
(
"icon_status_closed"
)
-
else
.system-note-image.fork-icon
=
custom_icon
(
"icon_code_fork"
)
.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
%span
.author_name
=
link_to_author
event
%span
{
class:
event
.
action_name
}
...
...
app/views/events/event/_created_project.html.haml
View file @
71b7461f
-
if
current_path?
(
'users#show'
)
.system-note-image
.open-icon
=
custom_icon
(
"icon_status_open"
)
.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
)
...
...
app/views/events/event/_note.html.haml
View file @
71b7461f
-
if
current_path?
(
'users#show'
)
.system-note-image
=
custom_icon
(
"icon_comment_o"
)
=
icon_for_system_note
(
event
.
action_name
)
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
...
...
app/views/events/event/_push.html.haml
View file @
71b7461f
-
project
=
event
.
project
-
if
current_path?
(
'users#show'
)
.system-note-image
-
if
event
.
action_name
==
"deleted"
=
custom_icon
(
"trash_o"
)
-
else
=
custom_icon
(
"icon_commit"
)
=
icon_for_system_note
(
event
.
data
[
:event_name
])
-
else
.system-note-image.user-avatar
=
author_avatar
(
event
,
size:
32
)
...
...
app/views/projects/notes/_note.html.haml
View file @
71b7461f
...
...
@@ -6,7 +6,7 @@
.timeline-entry-inner
.timeline-icon
-
if
note
.
system
=
icon_for_system_note
(
note
)
=
icon_for_system_note
(
note
.
system_note_metadata
&
.
action
)
-
else
%a
{
href:
user_path
(
note
.
author
)
}
=
image_tag
avatar_icon
(
note
.
author
),
alt:
''
,
class:
'avatar s40'
...
...
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