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
Jérome Perrin
gitlab-ce
Commits
da42b1bb
Commit
da42b1bb
authored
Jul 12, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added author username tooltip in issuable header
Closes #13771
parent
850bb6db
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
app/helpers/issuables_helper.rb
app/helpers/issuables_helper.rb
+1
-1
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+4
-2
No files found.
app/helpers/issuables_helper.rb
View file @
da42b1bb
...
...
@@ -61,7 +61,7 @@ module IssuablesHelper
output
=
content_tag
:strong
,
"
#{
text
}
#{
issuable
.
to_reference
}
"
,
class:
"identifier"
output
<<
" opened
#{
time_ago_with_tooltip
(
issuable
.
created_at
)
}
by "
.
html_safe
output
<<
content_tag
(
:strong
)
do
author_output
=
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
mobile_classes:
"hidden-xs"
)
author_output
=
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
mobile_classes:
"hidden-xs"
,
tooltip:
true
)
author_output
<<
link_to_member
(
project
,
issuable
.
author
,
size:
24
,
by_username:
true
,
avatar:
false
,
mobile_classes:
"hidden-sm hidden-md hidden-lg"
)
end
end
...
...
app/helpers/projects_helper.rb
View file @
da42b1bb
...
...
@@ -19,7 +19,7 @@ module ProjectsHelper
end
def
link_to_member
(
project
,
author
,
opts
=
{},
&
block
)
default_opts
=
{
avatar:
true
,
name:
true
,
size:
16
,
author_class:
'author'
,
title:
":name"
}
default_opts
=
{
avatar:
true
,
name:
true
,
size:
16
,
author_class:
'author'
,
title:
":name"
,
tooltip:
false
}
opts
=
default_opts
.
merge
(
opts
)
return
"(deleted)"
unless
author
...
...
@@ -33,7 +33,9 @@ module ProjectsHelper
if
opts
[
:by_username
]
author_html
<<
content_tag
(
:span
,
sanitize
(
"@
#{
author
.
username
}
"
),
class:
opts
[
:author_class
])
if
opts
[
:name
]
else
author_html
<<
content_tag
(
:span
,
sanitize
(
author
.
name
),
class:
opts
[
:author_class
])
if
opts
[
:name
]
tooltip_data
=
{
placement:
'top'
}
author_html
<<
content_tag
(
:span
,
sanitize
(
author
.
name
),
class:
[
opts
[
:author_class
],
(
'has-tooltip'
if
opts
[
:tooltip
])],
title:
(
author
.
to_reference
if
opts
[
:tooltip
]),
data:
(
tooltip_data
if
opts
[
:tooltip
]))
if
opts
[
:name
]
end
author_html
<<
capture
(
&
block
)
if
block
...
...
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