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
Léo-Paul Géneau
gitlab-ce
Commits
d35f986c
Commit
d35f986c
authored
May 16, 2019
by
Chris Toynbee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #61788 predefined colours dont have descriptive labels
parent
3c5d4d52
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
36 deletions
+104
-36
app/helpers/labels_helper.rb
app/helpers/labels_helper.rb
+33
-23
app/views/admin/labels/_form.html.haml
app/views/admin/labels/_form.html.haml
+1
-4
app/views/shared/issuable/_label_page_create.html.haml
app/views/shared/issuable/_label_page_create.html.haml
+1
-3
app/views/shared/labels/_form.html.haml
app/views/shared/labels/_form.html.haml
+1
-6
changelogs/unreleased/61788-predefined-colours-dont-have-descriptive-labels.yml
...61788-predefined-colours-dont-have-descriptive-labels.yml
+5
-0
locale/gitlab.pot
locale/gitlab.pot
+63
-0
No files found.
app/helpers/labels_helper.rb
View file @
d35f986c
...
@@ -76,29 +76,39 @@ module LabelsHelper
...
@@ -76,29 +76,39 @@ module LabelsHelper
end
end
def
suggested_colors
def
suggested_colors
[
{
'#0033CC'
,
'#0033CC'
=>
s_
(
'SuggestedColors|UA blue'
),
'#428BCA'
,
'#428BCA'
=>
s_
(
'SuggestedColors|Moderate blue'
),
'#44AD8E'
,
'#44AD8E'
=>
s_
(
'SuggestedColors|lime green'
),
'#A8D695'
,
'#A8D695'
=>
s_
(
'SuggestedColors|Feijoa'
),
'#5CB85C'
,
'#5CB85C'
=>
s_
(
'SuggestedColors|Slightly desaturated green'
),
'#69D100'
,
'#69D100'
=>
s_
(
'SuggestedColors|Bright Green'
),
'#004E00'
,
'#004E00'
=>
s_
(
'SuggestedColors|Very dark lime green'
),
'#34495E'
,
'#34495E'
=>
s_
(
'SuggestedColors|Very dark desaturated blue'
),
'#7F8C8D'
,
'#7F8C8D'
=>
s_
(
'SuggestedColors|Dark grayish cyan'
),
'#A295D6'
,
'#A295D6'
=>
s_
(
'SuggestedColors|Slightly desaturated blue'
),
'#5843AD'
,
'#5843AD'
=>
s_
(
'SuggestedColors|Dark moderate blue'
),
'#8E44AD'
,
'#8E44AD'
=>
s_
(
'SuggestedColors|Dark moderate violet'
),
'#FFECDB'
,
'#FFECDB'
=>
s_
(
'SuggestedColors|Very pale orange'
),
'#AD4363'
,
'#AD4363'
=>
s_
(
'SuggestedColors|Dark moderate pink'
),
'#D10069'
,
'#D10069'
=>
s_
(
'SuggestedColors|Strong pink'
),
'#CC0033'
,
'#CC0033'
=>
s_
(
'SuggestedColors|Strong red'
),
'#FF0000'
,
'#FF0000'
=>
s_
(
'SuggestedColors|Pure red'
),
'#D9534F'
,
'#D9534F'
=>
s_
(
'SuggestedColors|Soft red'
),
'#D1D100'
,
'#D1D100'
=>
s_
(
'SuggestedColors|Strong yellow'
),
'#F0AD4E'
,
'#F0AD4E'
=>
s_
(
'SuggestedColors|Soft orange'
),
'#AD8D43'
'#AD8D43'
=>
s_
(
'SuggestedColors|Dark moderate orange'
)
]
}
end
def
render_suggested_colors
colors_html
=
suggested_colors
.
map
do
|
color_hex_value
,
color_name
|
link_to
(
''
,
'#'
,
class:
"has-tooltip"
,
style:
"background-color:
#{
color_hex_value
}
"
,
data:
{
color:
color_hex_value
},
title:
color_name
)
end
content_tag
(
:div
,
class:
'suggest-colors'
)
do
colors_html
.
join
.
html_safe
end
end
end
def
text_color_for_bg
(
bg_color
)
def
text_color_for_bg
(
bg_color
)
...
...
app/views/admin/labels/_form.html.haml
View file @
d35f986c
...
@@ -24,10 +24,7 @@
...
@@ -24,10 +24,7 @@
%br
%br
=
_
(
"Or you can choose one of the suggested colors below"
)
=
_
(
"Or you can choose one of the suggested colors below"
)
.suggest-colors
=
render_suggested_colors
-
suggested_colors
.
each
do
|
color
|
=
link_to
'#'
,
style:
"background-color:
#{
color
}
"
,
data:
{
color:
color
}
do
.form-actions
.form-actions
=
f
.
submit
_
(
'Save'
),
class:
'btn btn-success js-save-button'
=
f
.
submit
_
(
'Save'
),
class:
'btn btn-success js-save-button'
...
...
app/views/shared/issuable/_label_page_create.html.haml
View file @
d35f986c
...
@@ -9,9 +9,7 @@
...
@@ -9,9 +9,7 @@
.dropdown-labels-error.js-label-error
.dropdown-labels-error.js-label-error
%input
#new_label_name
.default-dropdown-input
{
type:
"text"
,
placeholder:
_
(
'Name new label'
)
}
%input
#new_label_name
.default-dropdown-input
{
type:
"text"
,
placeholder:
_
(
'Name new label'
)
}
.suggest-colors.suggest-colors-dropdown
.suggest-colors.suggest-colors-dropdown
-
suggested_colors
.
each
do
|
color
|
=
render_suggested_colors
=
link_to
'#'
,
style:
"background-color:
#{
color
}
"
,
data:
{
color:
color
}
do
&
nbsp
.dropdown-label-color-input
.dropdown-label-color-input
.dropdown-label-color-preview.js-dropdown-label-color-preview
.dropdown-label-color-preview.js-dropdown-label-color-preview
%input
#new_label_color
.default-dropdown-input
{
type:
"text"
,
placeholder:
_
(
'Assign custom color like #FF0000'
)
}
%input
#new_label_color
.default-dropdown-input
{
type:
"text"
,
placeholder:
_
(
'Assign custom color like #FF0000'
)
}
...
...
app/views/shared/labels/_form.html.haml
View file @
d35f986c
...
@@ -25,12 +25,7 @@
...
@@ -25,12 +25,7 @@
Choose any color.
Choose any color.
%br
%br
Or you can choose one of the suggested colors below
Or you can choose one of the suggested colors below
=
render_suggested_colors
.suggest-colors
-
suggested_colors
.
each
do
|
color
|
=
link_to
'#'
,
style:
"background-color:
#{
color
}
"
,
data:
{
color:
color
}
do
.form-actions
.form-actions
-
if
@label
.
persisted?
-
if
@label
.
persisted?
=
f
.
submit
'Save changes'
,
class:
'btn btn-success js-save-button'
=
f
.
submit
'Save changes'
,
class:
'btn btn-success js-save-button'
...
...
changelogs/unreleased/61788-predefined-colours-dont-have-descriptive-labels.yml
0 → 100644
View file @
d35f986c
---
title
:
Adds a text label to color pickers to improve accessibility.
merge_request
:
28343
author
:
Chris Toynbee
type
:
changed
locale/gitlab.pot
View file @
d35f986c
...
@@ -9400,6 +9400,69 @@ msgstr ""
...
@@ -9400,6 +9400,69 @@ msgstr ""
msgid "Suggested change"
msgid "Suggested change"
msgstr ""
msgstr ""
msgid "SuggestedColors|Bright Green"
msgstr ""
msgid "SuggestedColors|Dark grayish cyan"
msgstr ""
msgid "SuggestedColors|Dark moderate blue"
msgstr ""
msgid "SuggestedColors|Dark moderate orange"
msgstr ""
msgid "SuggestedColors|Dark moderate pink"
msgstr ""
msgid "SuggestedColors|Dark moderate violet"
msgstr ""
msgid "SuggestedColors|Feijoa"
msgstr ""
msgid "SuggestedColors|Moderate blue"
msgstr ""
msgid "SuggestedColors|Pure red"
msgstr ""
msgid "SuggestedColors|Slightly desaturated blue"
msgstr ""
msgid "SuggestedColors|Slightly desaturated green"
msgstr ""
msgid "SuggestedColors|Soft orange"
msgstr ""
msgid "SuggestedColors|Soft red"
msgstr ""
msgid "SuggestedColors|Strong pink"
msgstr ""
msgid "SuggestedColors|Strong red"
msgstr ""
msgid "SuggestedColors|Strong yellow"
msgstr ""
msgid "SuggestedColors|UA blue"
msgstr ""
msgid "SuggestedColors|Very dark desaturated blue"
msgstr ""
msgid "SuggestedColors|Very dark lime green"
msgstr ""
msgid "SuggestedColors|Very pale orange"
msgstr ""
msgid "SuggestedColors|lime green"
msgstr ""
msgid "Sunday"
msgid "Sunday"
msgstr ""
msgstr ""
...
...
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