mirror of
https://github.com/wekan/wekan.git
synced 2025-12-23 19:00:12 +01:00
Add color palette and allow selection
This commit is contained in:
parent
ad759f2f9f
commit
6d9928ea8f
2 changed files with 16 additions and 0 deletions
|
|
@ -34,6 +34,9 @@ template(name="globalSearch")
|
||||||
.global-search-instructions
|
.global-search-instructions
|
||||||
+viewer
|
+viewer
|
||||||
= searchInstructions
|
= searchInstructions
|
||||||
|
.palette-colors: each label in labelColors
|
||||||
|
span.card-label.palette-color.js-palette-color(class="card-label-{{label.color}}")
|
||||||
|
= label.name
|
||||||
|
|
||||||
template(name="globalSearchViewChangePopup")
|
template(name="globalSearchViewChangePopup")
|
||||||
if currentUser
|
if currentUser
|
||||||
|
|
|
||||||
|
|
@ -355,6 +355,14 @@ BlazeComponent.extendComponent({
|
||||||
return text;
|
return text;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
labelColors() {
|
||||||
|
return Boards.simpleSchema()._schema['labels.$.color'].allowedValues.map(
|
||||||
|
color => {
|
||||||
|
return { color, name: TAPi18n.__(`color-${color}`) };
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
events() {
|
events() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|
@ -362,6 +370,11 @@ BlazeComponent.extendComponent({
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
this.searchAllBoards(evt.target.searchQuery.value);
|
this.searchAllBoards(evt.target.searchQuery.value);
|
||||||
},
|
},
|
||||||
|
'click .js-palette-color'(evt) {
|
||||||
|
this.query.set(
|
||||||
|
`${this.query.get()} label:"${evt.currentTarget.textContent}"`,
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue