mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
Add a native color wheel (<input type="color">) alongside the existing fixed
named-color swatches in the color pickers for card labels, swimlanes, lists and
cards, so any #rrggbb color can be chosen. The schema color fields accept a
custom hex in addition to the named palette (via a validation that allows the
named values or a ^#[0-9a-fA-F]{6}$ hex), and normalizeListColor now passes hex
through, so existing named-color data keeps working. When a stored value is a
hex, elements apply an inline background-color instead of the card-details- /
swimlane- / list-header- / minicard- CSS class.
A new pure, Meteor-free helper models/lib/contrastColor.js computes a readable
text color from sRGB relative luminance (white on dark, black on light),
maps the named palette to hex, and validates/normalizes hex; it is applied as
an inline text color wherever a chosen color is a background behind text (label
chips, swimlane/list headers, minicard, card details header). Covered by
tests/contrastColor.test.cjs (20 assertions).
108 lines
4.9 KiB
Plaintext
108 lines
4.9 KiB
Plaintext
template(name="tableView")
|
|
if currentBoard
|
|
.wrapper
|
|
.table-view-controls
|
|
.table-view-search-box
|
|
input.js-table-view-search(type="text" placeholder="{{_ 'search'}}" aria-label="{{_ 'search'}}")
|
|
button.js-table-view-search-button(type="button")
|
|
i.fa.fa-search
|
|
| {{_ 'search'}}
|
|
.table-view-pagination
|
|
button.js-table-view-prev-page(type="button" class="{{#unless hasPrevPage}}disabled{{/unless}}" aria-label="{{_ 'previous'}}")
|
|
i.fa.fa-chevron-left
|
|
span.table-view-page-info {{currentPage}} / {{totalPages}}
|
|
button.js-table-view-next-page(type="button" class="{{#unless hasNextPage}}disabled{{/unless}}" aria-label="{{_ 'next'}}")
|
|
i.fa.fa-chevron-right
|
|
table.my-cards-board-table
|
|
caption.sr-only {{currentBoard.title}}
|
|
thead
|
|
tr
|
|
th(scope="col")
|
|
th.js-table-view-sort(scope="col" data-sort="card") {{_ "card"}} {{sortIndicator 'card'}}
|
|
th.js-table-view-sort(scope="col" data-sort="list") {{_ "list"}} {{sortIndicator 'list'}}
|
|
th.js-table-view-sort(scope="col" data-sort="swimlane") {{_ "swimlane"}} {{sortIndicator 'swimlane'}}
|
|
unless isMiniScreen
|
|
th(scope="col") {{_ "assignees"}}
|
|
th(scope="col") {{_ "members"}}
|
|
th(scope="col") {{_ "labels"}}
|
|
if showReceivedColumn
|
|
th.js-table-view-sort(scope="col" data-sort="received") {{_ "card-received"}} {{sortIndicator 'received'}}
|
|
if showStartColumn
|
|
th.js-table-view-sort(scope="col" data-sort="start") {{_ "card-start"}} {{sortIndicator 'start'}}
|
|
if showDueColumn
|
|
th.js-table-view-sort(scope="col" data-sort="due") {{_ "card-due"}} {{sortIndicator 'due'}}
|
|
if showEndColumn
|
|
th.js-table-view-sort(scope="col" data-sort="end") {{_ "card-end"}} {{sortIndicator 'end'}}
|
|
tbody
|
|
each row in rows
|
|
tr
|
|
td.table-view-cell-edit
|
|
a.edit-card.js-table-view-edit-card(href=row.card.originRelativeUrl data-card-id=row.card._id title="{{_ 'edit'}}")
|
|
i.fa.fa-pencil-square-o
|
|
| {{_ 'edit'}}
|
|
td.table-view-cell-wrap
|
|
unless isMiniScreen
|
|
.my-cards-board-badge(class=row.colorClass)
|
|
.my-cards-card-title-table
|
|
+viewer
|
|
= row.title
|
|
td.table-view-cell-wrap
|
|
+viewer
|
|
= row.listTitle
|
|
td.table-view-cell-wrap
|
|
+viewer
|
|
= row.swimlaneTitle
|
|
unless isMiniScreen
|
|
td
|
|
.div
|
|
each assignee in row.card.getAssignees
|
|
a.name
|
|
+userAvatar(userId=assignee noRemove=true)
|
|
td
|
|
.div
|
|
each member in row.card.getMembers
|
|
a.name
|
|
+userAvatar(userId=member noRemove=true)
|
|
td.table-view-cell-labels
|
|
.div
|
|
each label in row.labels
|
|
span.card-label(class="{{labelColorClass label.color}}" style="{{labelColorStyle label.color}}" title="{{label.name}}")
|
|
+viewer
|
|
= label.name
|
|
if showReceivedColumn
|
|
td.table-view-cell-date
|
|
with row.card
|
|
if getReceived
|
|
+cardReceivedDate
|
|
else
|
|
if canModifyCard
|
|
a.card-label.add-label.js-received-date(title="{{_ 'card-received'}}")
|
|
i.fa.fa-plus
|
|
if showStartColumn
|
|
td.table-view-cell-date
|
|
with row.card
|
|
if getStart
|
|
+cardStartDate
|
|
else
|
|
if canModifyCard
|
|
a.card-label.add-label.js-start-date(title="{{_ 'card-start'}}")
|
|
i.fa.fa-plus
|
|
if showDueColumn
|
|
td.table-view-cell-date
|
|
with row.card
|
|
if getDue
|
|
+cardDueDate
|
|
else
|
|
if canModifyCard
|
|
a.card-label.add-label.js-due-date(title="{{_ 'card-due'}}")
|
|
i.fa.fa-plus
|
|
if showEndColumn
|
|
td.table-view-cell-date
|
|
with row.card
|
|
if getEnd
|
|
+cardEndDate
|
|
else
|
|
if canModifyCard
|
|
a.card-label.add-label.js-end-date(title="{{_ 'card-end'}}")
|
|
i.fa.fa-plus
|