Files
wekan/client/components/settings/sharedLabelsSettings.jade
T
Lauri Ojansivu 8c3e80240a Shared labels: the board labels' colour picker, at the size it has on a card.
Admin Panel / Settings / Shared labels chose a colour from a dropdown of
colour names. The board label popup's picker - the palette swatches and the
custom colour wheel - is its own template now, labelColorPicker, and the
popup and every Shared labels row use it; a custom colour is saved as its
hex, which the server already accepted. A pick reaches the row through an
object with set(), because Spacebars calls a function argument instead of
passing it.

The swatches grow to fill their row, so on the wide admin page their width
followed the window. There they have the size they have in an opened card's
label popup, 54 x 33px, at every window width.

tests/sharedLabelsColorPicker.test.cjs pins the shared picker and the size;
tests/playwright/specs/shared-labels-color-picker.e2e.js picks a swatch and a
custom colour, saves both, and measures the swatches at 1366, 1920 and
2560px.

Thanks to xet7 !
2026-10-17 05:32:38 +03:00

27 lines
1.4 KiB
Plaintext

//- Admin Panel / Settings / Labels: shared labels (#2761, #4698). The
//- instance-wide catalog and those of organizations and teams; a board uses
//- them beside its own labels (docs/Features/Admin-Panel/Settings/Shared-Labels.md).
template(name="sharedLabelsSettings")
.shared-labels-settings
p.roles-description {{_ 'shared-labels-desc'}}
ul.setting-detail.shared-labels-list
each rows
li.shared-label-row(data-id="{{id}}")
span.card-label(class="{{labelColorClass color}}" style="{{labelColorStyle color}}") {{name}}
input.js-shared-label-name(type="text" value=name maxlength="100" placeholder="{{_ 'name'}}" aria-label="{{_ 'name'}}")
//- The board labels' own colour picker (cards/labels.jade).
.shared-label-color
+labelColorPicker(color=color onChange=colorSink)
select.js-shared-label-scope(aria-label="{{_ 'shared-labels'}}")
each scopeOptions
option(value=value selected=selected) {{_ labelKey}}
if needsScopeId
select.js-shared-label-scope-id
each scopeIdOptions
option(value=value selected=selected) {{label}}
if isNew
button.js-shared-label-save.primary {{_ 'add-shared-label'}}
else
button.js-shared-label-save.primary {{_ 'save'}}
button.js-shared-label-delete {{_ 'delete'}}