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
8124c01c
Commit
8124c01c
authored
Apr 10, 2017
by
Annabel Dunstone Gray
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port of use-avatars-in-activity-view to EE
parent
7a45f05b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
27 deletions
+46
-27
app/assets/stylesheets/pages/events.scss
app/assets/stylesheets/pages/events.scss
+14
-8
app/helpers/events_helper.rb
app/helpers/events_helper.rb
+28
-0
app/views/events/event/_common.html.haml
app/views/events/event/_common.html.haml
+1
-10
app/views/events/event/_created_project.html.haml
app/views/events/event/_created_project.html.haml
+1
-2
app/views/events/event/_note.html.haml
app/views/events/event/_note.html.haml
+1
-2
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+1
-5
app/views/shared/icons/_icon_trash_o.svg
app/views/shared/icons/_icon_trash_o.svg
+0
-0
No files found.
app/assets/stylesheets/pages/events.scss
View file @
8124c01c
...
@@ -10,10 +10,14 @@
...
@@ -10,10 +10,14 @@
position
:
relative
;
position
:
relative
;
&
.event-inline
{
&
.event-inline
{
.
profile-icon
{
.
system-note-image
{
top
:
20px
;
top
:
20px
;
}
}
.user-avatar
{
top
:
14px
;
}
.event-title
,
.event-title
,
.event-item-timestamp
{
.event-item-timestamp
{
line-height
:
40px
;
line-height
:
40px
;
...
@@ -24,7 +28,7 @@
...
@@ -24,7 +28,7 @@
color
:
$gl-text-color
;
color
:
$gl-text-color
;
}
}
.
profile-icon
{
.
system-note-image
{
position
:
absolute
;
position
:
absolute
;
left
:
0
;
left
:
0
;
top
:
14px
;
top
:
14px
;
...
@@ -35,15 +39,18 @@
...
@@ -35,15 +39,18 @@
fill
:
$gl-text-color-secondary
;
fill
:
$gl-text-color-secondary
;
}
}
&
.open-icon
svg
{
&
.opened-icon
,
fill
:
$green-300
;
&
.created-icon
{
svg
{
fill
:
$green-300
;
}
}
}
&
.closed-icon
svg
{
&
.closed-icon
svg
{
fill
:
$red-300
;
fill
:
$red-300
;
}
}
&
.
fork
-icon
svg
{
&
.
accepted
-icon
svg
{
fill
:
$blue-300
;
fill
:
$blue-300
;
}
}
}
}
...
@@ -128,8 +135,7 @@
...
@@ -128,8 +135,7 @@
li
{
li
{
&
.commit
{
&
.commit
{
background
:
transparent
;
background
:
transparent
;
padding
:
3px
;
padding
:
0
;
padding-left
:
0
;
border
:
none
;
border
:
none
;
.commit-row-title
{
.commit-row-title
{
...
@@ -183,7 +189,7 @@
...
@@ -183,7 +189,7 @@
max-width
:
100%
;
max-width
:
100%
;
}
}
.
profile-icon
{
.
system-note-image
{
display
:
none
;
display
:
none
;
}
}
...
...
app/helpers/events_helper.rb
View file @
8124c01c
module
EventsHelper
module
EventsHelper
ICON_NAMES_BY_EVENT_TYPE
=
{
'pushed to'
=>
'icon_commit'
,
'pushed new'
=>
'icon_commit'
,
'created'
=>
'icon_status_open'
,
'opened'
=>
'icon_status_open'
,
'closed'
=>
'icon_status_closed'
,
'accepted'
=>
'icon_code_fork'
,
'commented on'
=>
'icon_comment_o'
,
'deleted'
=>
'icon_trash_o'
}.
freeze
def
link_to_author
(
event
)
def
link_to_author
(
event
)
author
=
event
.
author
author
=
event
.
author
...
@@ -183,4 +194,21 @@ module EventsHelper
...
@@ -183,4 +194,21 @@ module EventsHelper
"event-inline"
"event-inline"
end
end
end
end
def
icon_for_event
(
note
)
icon_name
=
ICON_NAMES_BY_EVENT_TYPE
[
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
.
parameterize
}
-icon"
do
icon_for_event
(
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
app/views/events/event/_common.html.haml
View file @
8124c01c
-
if
event
.
target
=
icon_for_profile_event
(
event
)
-
if
event
.
action_name
==
"opened"
.profile-icon.open-icon
=
custom_icon
(
"icon_status_open"
)
-
elsif
event
.
action_name
==
"closed"
.profile-icon.closed-icon
=
custom_icon
(
"icon_status_closed"
)
-
else
.profile-icon.fork-icon
=
custom_icon
(
"icon_code_fork"
)
.event-title
.event-title
%span
{
class:
event
.
action_name
}
%span
{
class:
event
.
action_name
}
...
...
app/views/events/event/_created_project.html.haml
View file @
8124c01c
.profile-icon.open-icon
=
icon_for_profile_event
(
event
)
=
custom_icon
(
"icon_status_open"
)
.event-title
.event-title
%span
{
class:
event
.
action_name
}
%span
{
class:
event
.
action_name
}
...
...
app/views/events/event/_note.html.haml
View file @
8124c01c
.profile-icon
=
icon_for_profile_event
(
event
)
=
custom_icon
(
"icon_comment_o"
)
.event-title
.event-title
=
event
.
action_name
=
event
.
action_name
...
...
app/views/events/event/_push.html.haml
View file @
8124c01c
-
project
=
event
.
project
-
project
=
event
.
project
.profile-icon
=
icon_for_profile_event
(
event
)
-
if
event
.
action_name
==
"deleted"
=
custom_icon
(
"trash_o"
)
-
else
=
custom_icon
(
"icon_commit"
)
.event-title
.event-title
%span
.pushed
#{
event
.
action_name
}
#{
event
.
ref_type
}
%span
.pushed
#{
event
.
action_name
}
#{
event
.
ref_type
}
...
...
app/views/shared/icons/_trash_o.svg
→
app/views/shared/icons/_
icon_
trash_o.svg
View file @
8124c01c
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