Files
wekan/client/components/lists/listHeader.jade
T
Lauri Ojansivu 7968f522d8 Keep mobile list row heights stable across swimlanes
Scope the mobile list-header selected state to the list whose ID is selected, so compact rows in other swimlanes retain the same controls and height. Extend source and live browser coverage to compare untouched row heights before and after opening another swimlane's list.

Thanks to xet7 !
2026-09-05 16:35:48 +03:00

405 lines
17 KiB
Plaintext

template(name="listHeader")
//- Same rule as the minicard: the list header is the LIST's drag source only
//- when drag handles are OFF, so only then must it opt out of dragscroll.
.list-header.js-list-header(
class="{{#unless isTouchScreenOrShowDesktopDragHandles}}nodragscroll{{/unless}}"
class="{{#if limitToShowCardsCount}}list-header-card-count{{/if}}"
class=colorClass
style=colorStyle)
//- #459: keyboard/screen-reader list reordering (visually hidden, focusable).
.list-move-buttons.sr-only
a.js-list-move-left(href="#" role="button" aria-label="{{_ 'move-list-left'}}") {{_ 'move-list-left'}}
a.js-list-move-right(href="#" role="button" aria-label="{{_ 'move-list-right'}}") {{_ 'move-list-right'}}
+inlinedForm
+editListTitleForm
else
if isMiniScreen
if isCurrentList
a.list-header-left-icon.js-unselect-list
i.fa.fa-caret-left
else
if collapsed
if showCardsCountForList cardsCountWhole
br
span.cardCount {{cardsCount containerSwimlaneId}}
if isMiniScreen
h2.list-header-name(
title="{{ displayDate modifiedAt 'LLL' }}"
class="{{#if currentUser.isBoardMember}}{{#unless currentUser.isCommentOnly}}{{#unless currentUser.isWorker}}js-open-inlined-form is-editable{{/unless}}{{/unless}}{{/if}}")
+viewer
= title
if wipLimit.enabled
| (
span(class="{{#if exceededWipLimit}}highlight{{/if}}") {{cardsCountWhole}}
|/#{wipLimit.value})
if showCardsCountForList cardsCountWhole
span.cardCount {{cardsCount containerSwimlaneId}} {{cardsCountForListIsOne cardsCountWhole}}
if hasNumberFieldsSum
|  
span.list-sum-badge(title="{{_ 'sum-of-number-fields'}}") ∑ {{numberFieldsSum}}
else
a.list-collapse-indicator.js-collapse(title="{{#if collapsed}}{{_ 'uncollapse'}}{{else}}{{_ 'collapse'}}{{/if}}" aria-label="{{#if collapsed}}{{_ 'uncollapse'}}{{else}}{{_ 'collapse'}}{{/if}}")
if collapsed
i.fa.fa-caret-right
else
i.fa.fa-caret-down
div(class="{{#if collapsed}}list-rotated{{/if}}")
h2.list-header-name(
title="{{ displayDate modifiedAt 'LLL' }}"
class="{{#unless collapsed}}{{#if currentUser.isBoardMember}}{{#unless currentUser.isCommentOnly}}{{#unless currentUser.isWorker}}js-open-inlined-form is-editable{{/unless}}{{/unless}}{{/if}}{{/unless}}")
+viewer
= title
if wipLimit.enabled
| (
span(class="{{#if exceededWipLimit}}highlight{{/if}}") {{cardsCountWhole}}
|/#{wipLimit.value})
unless collapsed
if showCardsCountForList cardsCountWhole
span.cardCount {{cardsCount containerSwimlaneId}} {{cardsCountForListIsOne cardsCountWhole}}
if hasNumberFieldsSum
|  
span.list-sum-badge(title="{{_ 'sum-of-number-fields'}}") ∑ {{numberFieldsSum}}
if isMiniScreen
if isCurrentList
if isWatching
i.list-header-watch-icon i.fa.fa-eye
div.list-header-menu
unless currentUser.isCommentOnly
unless currentUser.isReadOnly
unless currentUser.isReadAssignedOnly
if canSeeAddCard
a.js-add-card.list-header-plus-top(title="{{_ 'add-card-to-top-of-list'}}")
i.fa.fa-plus
a.js-open-list-menu(title="{{_ 'listActionPopup-title'}}")
i.fa.fa-bars
else
a.list-header-menu-icon.js-select-list
i.fa.fa-caret-right
//- The add-list + sits BETWEEN the caret and the drag handle, so mobile
//- mode needs no "Add List" row of its own. Same class, same handler and
//- the same Font Awesome icon as the desktop list header uses, so the two
//- are one button in two layouts rather than two lookalikes.
unless currentUser.isCommentOnly
unless currentUser.isReadOnly
unless currentUser.isReadAssignedOnly
unless currentUser.isWorker
a.js-add-list-here.list-header-add-list(title="{{_ 'add-list'}}")
i.fa.fa-plus-square-o
unless currentUser.isWorker
if isTouchScreenOrShowDesktopDragHandles
a.list-header-handle.handle.nodragscroll.js-list-handle
i.fa.fa-arrows
else if currentUser.isBoardMember
if isWatching
i.list-header-watch-icon i.fa.fa-eye
unless currentUser.isCommentOnly
unless currentUser.isReadOnly
unless currentUser.isReadAssignedOnly
if isTouchScreenOrShowDesktopDragHandles
a.list-header-handle-desktop.handle.nodragscroll.js-list-handle(title="{{_ 'drag-list'}}")
i.fa.fa-arrows
unless collapsed
div.list-header-menu
unless currentUser.isCommentOnly
unless currentUser.isReadOnly
unless currentUser.isReadAssignedOnly
//if isBoardAdmin
//
a.fa.js-list-star.list-header-plus-top(class="fa-star{{#unless starred}}-o{{/unless}}")
if isTouchScreenOrShowDesktopDragHandles
a.list-header-handle-desktop.handle.nodragscroll.js-list-handle(title="{{_ 'drag-list'}}")
i.fa.fa-arrows
if canSeeAddCard
a.js-add-card.list-header-plus-top(title="{{_ 'add-card-to-top-of-list'}}")
i.fa.fa-plus
a.js-open-list-menu(title="{{_ 'listActionPopup-title'}}")
i.fa.fa-bars
//- #6465: far-right add-list button. Opens the inline Add List
//- composer AFTER this list (right in LTR / left in RTL).
a.js-add-list-here.list-header-plus-top(title="{{_ 'add-list'}}")
i.fa.fa-plus-square-o
template(name="editListTitleForm")
.list-composer
input.list-name-input.full-line(type="text" value=title autofocus)
.edit-controls.clearfix
button.primary.confirm(type="submit") {{_ 'save'}}
a.js-close-inlined-form
i.fa.fa-times-thin
template(name="listActionPopup")
//- Copy link, FIRST and above every permission check - see the swimlane
popup: copying an address is reading, not editing.
models/lib/boardItemUrl.js, docs/Features/Page/Board-Item-Links.md
ul.pop-over-list
li: a.js-copy-list-link
i.fa.fa-link
span
| {{_ 'copy-link-to-clipboard'}}
span.copied-tooltip {{_ 'copied'}}
//- History of this list and its cards. Reading, like the link above it, so it
is not behind the edit permissions below.
ul.pop-over-list
li: a.js-list-history
i.fa.fa-history
span
| {{_ 'history'}}
hr
//- #1173: exporting a list is the board export restricted to it. Reading, like
the link above it, so it is not behind the edit permissions below. The menu
already says what it is about, so the rows are named "Export" and "Import"
and not "Export list" - the noun was in the heading above them either way.
Import WRITES, so it is offered only to somebody who may change the board;
`canImportIntoBoard` is the same question the popup itself asks
(client/components/boards/exportScope.js).
ul.pop-over-list
li: a.js-export-list
i.fa.fa-upload
span {{_ 'export'}}
if canImportIntoBoard
li: a.js-import-list
i.fa.fa-download
span {{_ 'import'}}
hr
unless currentUser.isReadOnly
unless currentUser.isReadAssignedOnly
ul.pop-over-list
li
a.js-add-card.list-header-plus-top
i.fa.fa-plus
i.fa.fa-arrow-up
| {{_ 'add-card-to-top-of-list'}}
li
a.js-add-card.list-header-plus-bottom
i.fa.fa-plus
i.fa.fa-arrow-down
| {{_ 'add-card-to-bottom-of-list'}}
hr
ul.pop-over-list
li
a.js-add-list
i.fa.fa-plus
| {{_ 'add-list'}}
hr
ul.pop-over-list
li
a.js-set-list-width
i.fa.fa-arrows-h
| {{_ 'set-list-width'}}
ul.pop-over-list
li
a.js-toggle-watch-list
if isWatching
i.fa.fa-eye
| {{_ 'unwatch'}}
else
i.fa.fa-eye-slash
| {{_ 'watch'}}
unless currentUser.isCommentOnly
unless currentUser.isReadOnly
unless currentUser.isReadAssignedOnly
unless currentUser.isWorker
ul.pop-over-list
li
a.js-set-color-list
i.fa.fa-paint-brush
| {{_ 'set-color-list'}}
ul.pop-over-list
if cards.length
li
a.js-select-cards
i.fa.fa-select-square
| {{_ 'list-select-cards'}}
if currentUser.isBoardAdmin
ul.pop-over-list
li
a.js-set-wip-limit
i.fa.fa-ban
| {{#if isWipLimitEnabled }}{{_ 'edit-wip-limit'}}{{else}}{{_ 'setWipLimitPopup-title'}}{{/if}}
hr
ul.pop-over-list
unless currentUser.isWorker
li
a.js-copy-list
i.fa.fa-clipboard
| {{_ 'copyListPopup-title'}}
if currentUser.isBoardAdmin
li
a.js-move-list
i.fa.fa-arrow-right
| {{_ 'moveListPopup-title'}}
unless currentUser.isWorker
hr
ul.pop-over-list
li
a.js-close-list
i.fa.fa-arrow-right
i.fa.fa-archive
| {{_ 'archive-list'}}
hr
ul.pop-over-list
li
a.js-more
i.fa.fa-link
| {{_ 'listMorePopup-title'}}
template(name="boardLists")
ul.pop-over-list
each currentBoard.lists
li
if($eq ../_id _id)
a.disabled {{title}} ({{_ 'current'}})
else
a.js-select-list= title
template(name="listMorePopup")
p.quiet
span.clearfix
span {{_ 'link-list'}}
= ' '
i.fa(class="{{#if currentBoard.isPublic}}fa-globe{{else}}fa-lock{{/if}}")
//- #6459: was {{ rootUrl }}, a helper that does not exist anywhere, so the
//- link input was always empty. absoluteUrl was then resolved through a
//- CARD of this list, so the box showed a card's address - and nothing at
//- all for an empty list. A list has its own address now.
//- models/lib/boardItemUrl.js
input.inline-input(type="text" readonly value="{{ absoluteUrl }}")
| {{_ 'added'}}
span.date(title=list.createdAt) {{ displayDate createdAt 'LLL' }}
//unless currentUser.isWorker
//
if currentUser.isBoardAdmin
//
a.js-delete {{_ 'delete'}}
template(name="listArchivePopup")
p {{_ "list-archive-pop"}}
p {{_ "list-archive-suggest"}}
button.js-confirm.negate.full(type="submit") {{_ 'archive'}}
template(name="listDeletePopup")
p {{_ "list-delete-pop"}}
unless archived
p {{_ "list-delete-suggest-archive"}}
button.js-confirm.negate.full(type="submit") {{_ 'delete'}}
template(name="setWipLimitPopup")
#js-wip-limit-edit
label {{_ 'set-wip-limit-value'}}
ul.pop-over-list
li: a.js-enable-wip-limit {{_ 'enable-wip-limit'}}
if isWipLimitEnabled
i.fa.fa-check
if isWipLimitEnabled
p
input.wip-limit-value(type="number" value="{{ wipLimitValue }}" min="1" max="99")
input.wip-limit-apply(type="submit" value="{{_ 'apply'}}")
input.wip-limit-error
p
.soft-wip-limit
.materialCheckBox(class="{{#if isWipLimitSoft}}is-checked{{/if}}")
label {{_ 'soft-wip-limit'}}
template(name="wipLimitErrorPopup")
.wip-limit-invalid
p {{_ 'wipLimitErrorPopup-dialog-pt1'}}
p {{_ 'wipLimitErrorPopup-dialog-pt2'}}
button.full.js-back-view(type="submit") {{_ 'cancel'}}
template(name="setListWidthPopup")
#js-list-width-edit
unless isAutoWidth
label {{_ 'set-list-width-value'}}
p
input.list-width-value(type="number" value="{{ listWidthValue }}" min="270")
input.list-width-apply(type="submit" value="{{_ 'apply'}}")
input.list-width-error
if canChangeAutoWidth
a.js-toggle-auto-width(title="{{#if isAutoWidth}}{{_ 'click-to-disable-auto-width'}}{{else}}{{_ 'click-to-enable-auto-width'}}{{/if}}")
i.fa(class="{{#if isAutoWidth}}fa-compress{{else}}fa-arrows-h{{/if}}")
span {{_ 'auto-list-width'}}
a.js-toggle-fixed-list-width(title="{{#if isFixedListWidth}}{{_ 'click-to-disable-fixed-list-width'}}{{else}}{{_ 'click-to-enable-fixed-list-width'}}{{/if}}")
i.fa(class="{{#if isFixedListWidth}}fa-check-square-o{{else}}fa-square-o{{/if}}")
span {{_ 'fixed-list-width'}}
p.list-width-scope-note {{ listWidthScopeNote }}
template(name="listWidthErrorPopup")
.list-width-invalid
p {{_ 'list-width-error-message'}} '>=270'
button.full.js-back-view(type="submit") {{_ 'cancel'}}
template(name="setListColorPopup")
form.edit-label
.palette-colors: each colors
// note: we use the swimlane palette to have more than just the border
span.card-label.palette-color.js-palette-color(class="card-details-{{color}}")
if(isSelected color)
i.fa.fa-check
// #5514: native color wheel for picking a custom RGB / hex color
.color-wheel-wrap
label(for="listColorWheel") {{_ 'custom-color'}}
input.js-list-color-wheel#listColorWheel(type="color" value=currentColorHex title="{{_ 'custom-color'}}")
button.primary.confirm.js-submit {{_ 'save'}}
button.js-remove-color.negate.wide.right {{_ 'unset-color'}}
//- WHERE a list goes: the board, the swimlane, which list to put it left or
right of, and Done. Copy list and Move list asked the same question with the
same form; only the title field above it differs, so that stays with each.
The dialog comes from the popup that includes this and is read from the
template INSTANCE, because inside `each boards` the data context is a board.
client/components/lists/listHeader.js
template(name="listDestinationPicker")
label {{_ 'boards'}}:
select.js-select-boards
each boards
option(value="{{_id}}" selected="{{#if isDialogOptionBoardId _id}}selected{{/if}}") {{add @index 1}}. {{title}}
label {{_ 'swimlanes'}}:
select.js-select-swimlanes
each swimlanes
option(value="{{_id}}" selected="{{#if isDialogOptionSwimlaneId _id}}selected{{/if}}") {{add @index 1}}. {{isTitleDefault title}}
label {{_ 'lists'}}:
select.js-select-lists
each lists
option(value="{{_id}}" selected="{{#if isDialogOptionListId _id}}selected{{/if}}") {{add @index 1}}. {{title}}
div
input(type="radio" name="list-position" value="left" checked id="list-position-left" style="display: inline")
label(for="list-position-left") {{_ 'left-of-list'}}
div
input(type="radio" name="list-position" value="right" id="list-position-right" style="display: inline")
label(for="list-position-right") {{_ 'right-of-list'}}
.edit-controls.clearfix
button.primary.confirm.js-done {{_ 'done'}}
template(name="copyListPopup")
label(for='copy-list-title') {{_ 'title'}}:
input#copy-list-title.full-line(type="text" value="{{title}}" autofocus)
+listDestinationPicker(dialog=dialog)
template(name="moveListPopup")
label(for='move-list-title') {{_ 'title'}}:
input#move-list-title.full-line(type="text" value="{{title}}" autofocus)
+listDestinationPicker(dialog=dialog)
template(name="addListPopup")
form.js-add-list-form
input.list-name-input.full-line(type="text" placeholder="{{_ 'add-list'}}" autocomplete="off" autofocus)
if currentSwimlaneData
if swimlaneLists.length
label {{_ 'add-after-list'}}
select.list-position-input.full-line
each swimlaneLists
option(value="{{_id}}" selected="{{$eq _id currentListIdValue}}") {{increment @index}} {{title}}
else
if currentBoard.lists.length
label {{_ 'add-after-list'}}
select.list-position-input.full-line
each currentBoard.lists
option(value="{{_id}}" selected="{{$eq _id currentListIdValue}}") {{increment @index}} {{title}}
.edit-controls.clearfix
button.primary.confirm.js-submit-add-list(type="submit") {{_ 'save'}}
unless currentBoard.isTemplatesBoard
unless currentBoard.isTemplateBoard
span.quiet
| {{_ 'or'}}
a.js-list-template {{_ 'template'}}