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
1484a7eb
Commit
1484a7eb
authored
Jan 04, 2019
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added User Popovers to Commit Items and Member Lists
parent
4543ef09
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
app/assets/javascripts/diffs/components/commit_item.vue
app/assets/javascripts/diffs/components/commit_item.vue
+19
-1
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+1
-1
app/views/admin/users/_user.html.haml
app/views/admin/users/_user.html.haml
+1
-1
app/views/shared/members/_member.html.haml
app/views/shared/members/_member.html.haml
+1
-1
No files found.
app/assets/javascripts/diffs/components/commit_item.vue
View file @
1484a7eb
...
@@ -5,6 +5,7 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
...
@@ -5,6 +5,7 @@ import ClipboardButton from '~/vue_shared/components/clipboard_button.vue';
import
CIIcon
from
'
~/vue_shared/components/ci_icon.vue
'
;
import
CIIcon
from
'
~/vue_shared/components/ci_icon.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
TimeAgoTooltip
from
'
~/vue_shared/components/time_ago_tooltip.vue
'
;
import
CommitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
CommitPipelineStatus
from
'
~/projects/tree/components/commit_pipeline_status_component.vue
'
;
import
initUserPopovers
from
'
../../user_popovers
'
;
/**
/**
* CommitItem
* CommitItem
...
@@ -38,6 +39,12 @@ export default {
...
@@ -38,6 +39,12 @@ export default {
authorName
()
{
authorName
()
{
return
(
this
.
commit
.
author
&&
this
.
commit
.
author
.
name
)
||
this
.
commit
.
author_name
;
return
(
this
.
commit
.
author
&&
this
.
commit
.
author
.
name
)
||
this
.
commit
.
author_name
;
},
},
authorClass
()
{
return
this
.
commit
.
author
&&
this
.
commit
.
author
.
name
?
'
js-user-link
'
:
''
;
},
authorId
()
{
return
this
.
commit
.
author
&&
this
.
commit
.
author
.
name
?
this
.
commit
.
author
.
id
:
''
;
},
authorUrl
()
{
authorUrl
()
{
return
(
return
(
(
this
.
commit
.
author
&&
this
.
commit
.
author
.
web_url
)
||
`mailto:
${
this
.
commit
.
author_email
}
`
(
this
.
commit
.
author
&&
this
.
commit
.
author
.
web_url
)
||
`mailto:
${
this
.
commit
.
author_email
}
`
...
@@ -49,6 +56,11 @@ export default {
...
@@ -49,6 +56,11 @@ export default {
);
);
},
},
},
},
created
()
{
this
.
$nextTick
(()
=>
{
initUserPopovers
(
this
.
$el
.
querySelectorAll
(
'
.js-user-link
'
));
});
},
};
};
</
script
>
</
script
>
...
@@ -81,7 +93,13 @@ export default {
...
@@ -81,7 +93,13 @@ export default {
</button>
</button>
<div
class=
"commiter"
>
<div
class=
"commiter"
>
<a
:href=
"authorUrl"
v-text=
"authorName"
></a>
{{
s__
(
'
CommitWidget|authored
'
)
}}
<a
:href=
"authorUrl"
:class=
"authorClass"
:data-user-id=
"authorId"
v-text=
"authorName"
></a>
{{
s__
(
'
CommitWidget|authored
'
)
}}
<time-ago-tooltip
:time=
"commit.authored_date"
/>
<time-ago-tooltip
:time=
"commit.authored_date"
/>
</div>
</div>
...
...
app/helpers/commits_helper.rb
View file @
1484a7eb
...
@@ -154,7 +154,7 @@ module CommitsHelper
...
@@ -154,7 +154,7 @@ module CommitsHelper
if
user
.
nil?
if
user
.
nil?
mail_to
(
source_email
,
text
,
link_options
)
mail_to
(
source_email
,
text
,
link_options
)
else
else
link_to
(
text
,
user_path
(
user
),
link_options
)
link_to
(
text
,
user_path
(
user
),
{
class:
"commit-
#{
options
[
:source
]
}
-link js-user-link"
,
data:
{
user_id:
user
.
id
}}
)
end
end
end
end
...
...
app/views/admin/users/_user.html.haml
View file @
1484a7eb
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
=
image_tag
avatar_icon_for_user
(
user
),
class:
"avatar"
,
alt:
''
=
image_tag
avatar_icon_for_user
(
user
),
class:
"avatar"
,
alt:
''
.row-main-content
.row-main-content
.user-name.row-title.str-truncated-100
.user-name.row-title.str-truncated-100
=
link_to
user
.
name
,
[
:admin
,
user
]
=
link_to
user
.
name
,
[
:admin
,
user
]
,
class:
"js-user-link"
,
data:
{
user_id:
user
.
id
}
-
if
user
.
blocked?
-
if
user
.
blocked?
%span
.badge.badge-danger
blocked
%span
.badge.badge-danger
blocked
-
if
user
.
admin?
-
if
user
.
admin?
...
...
app/views/shared/members/_member.html.haml
View file @
1484a7eb
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
-
if
user
-
if
user
=
image_tag
avatar_icon_for_user
(
user
,
40
),
class:
"avatar s40"
,
alt:
''
=
image_tag
avatar_icon_for_user
(
user
,
40
),
class:
"avatar s40"
,
alt:
''
.user-info
.user-info
=
link_to
user
.
name
,
user_path
(
user
),
class:
'member
'
=
link_to
user
.
name
,
user_path
(
user
),
class:
'member
js-user-link'
,
data:
{
user_id:
user
.
id
}
=
user_status
(
user
)
=
user_status
(
user
)
%span
.cgray
=
user
.
to_reference
%span
.cgray
=
user
.
to_reference
...
...
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