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
73881224
Commit
73881224
authored
Mar 08, 2016
by
Douwe Maan
Committed by
Robert Speicher
Mar 16, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add label description in tooltip to labels in issue index and sidebar
parent
c280edd3
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
10 deletions
+12
-10
CHANGELOG
CHANGELOG
+1
-0
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+8
-7
app/views/admin/labels/_label.html.haml
app/views/admin/labels/_label.html.haml
+1
-1
app/views/shared/_label_row.html.haml
app/views/shared/_label_row.html.haml
+1
-1
app/views/shared/milestones/_labels_tab.html.haml
app/views/shared/milestones/_labels_tab.html.haml
+1
-1
No files found.
CHANGELOG
View file @
73881224
...
...
@@ -17,6 +17,7 @@ v 8.6.0 (unreleased)
- Memoize @group in Admin::GroupsController (Yatish Mehta)
- Indicate how much an MR diverged from the target branch (Pierre de La Morinerie)
- Added omniauth-auth0 Gem (Daniel Carraro)
- Add label description in tooltip to labels in issue index and sidebar
- Strip leading and trailing spaces in URL validator (evuez)
- Add "last_sign_in_at" and "confirmed_at" to GET /users/* API endpoints for admins (evuez)
- Return empty array instead of 404 when commit has no statuses in commit status API
...
...
app/helpers/labels_helper.rb
View file @
73881224
...
...
@@ -32,7 +32,7 @@ module LabelsHelper
# link_to_label(label) { "My Custom Label Text" }
#
# Returns a String
def
link_to_label
(
label
,
project:
nil
,
type: :issue
,
&
block
)
def
link_to_label
(
label
,
project:
nil
,
type: :issue
,
tooltip:
true
,
&
block
)
project
||=
@project
||
label
.
project
link
=
send
(
"namespace_project_
#{
type
.
to_s
.
pluralize
}
_path"
,
project
.
namespace
,
...
...
@@ -42,7 +42,7 @@ module LabelsHelper
if
block_given?
link_to
link
,
&
block
else
link_to
render_colored_label
(
label
),
link
link_to
render_colored_label
(
label
,
tooltip:
tooltip
),
link
end
end
...
...
@@ -50,23 +50,24 @@ module LabelsHelper
@project
.
labels
.
pluck
(
:title
)
end
def
render_colored_label
(
label
,
label_suffix
=
''
)
def
render_colored_label
(
label
,
label_suffix
=
''
,
tooltip:
true
)
label_color
=
label
.
color
||
Label
::
DEFAULT_COLOR
text_color
=
text_color_for_bg
(
label_color
)
# Intentionally not using content_tag here so that this method can be called
# by LabelReferenceFilter
span
=
%(<span class="label color-label")
+
%(style="background-color: #{label_color}; color: #{text_color}">)
+
span
=
%(<span class="label color-label #{"has_tooltip" if tooltip}" )
+
%(style="background-color: #{label_color}; color: #{text_color}" )
+
%(title="#{escape_once(label.description)}" data-container="body">)
+
%(#{escape_once(label.name)}#{label_suffix}</span>)
span
.
html_safe
end
def
render_colored_cross_project_label
(
label
)
def
render_colored_cross_project_label
(
label
,
tooltip:
true
)
label_suffix
=
label
.
project
.
name_with_namespace
label_suffix
=
" <i>in
#{
escape_once
(
label_suffix
)
}
</i>"
render_colored_label
(
label
,
label_suffix
)
render_colored_label
(
label
,
label_suffix
,
tooltip:
tooltip
)
end
def
suggested_colors
...
...
app/views/admin/labels/_label.html.haml
View file @
73881224
%li
{
id:
dom_id
(
label
)}
.label-row
=
render_colored_label
(
label
)
=
render_colored_label
(
label
,
tooltip:
false
)
=
markdown
(
label
.
description
,
pipeline: :single_line
)
.pull-right
=
link_to
'Edit'
,
edit_admin_label_path
(
label
),
class:
'btn btn-sm'
...
...
app/views/shared/_label_row.html.haml
View file @
73881224
%span
.label-row
=
link_to_label
(
label
)
=
link_to_label
(
label
,
tooltip:
false
)
%span
.prepend-left-10
=
markdown
(
label
.
description
,
pipeline: :single_line
)
app/views/shared/milestones/_labels_tab.html.haml
View file @
73881224
...
...
@@ -5,7 +5,7 @@
%li
%span
.label-row
=
link_to
milestones_label_path
(
options
)
do
-
render_colored_label
(
label
)
-
render_colored_label
(
label
,
tooltip:
false
)
%span
.prepend-left-10
=
markdown
(
label
.
description
,
pipeline: :single_line
)
...
...
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