Files
wekan/client/components/settings/leftMenu.jade
T
Lauri Ojansivu daaf563910 Docs: implemented designs move to docs/Features, filed the way the menu is.
A design that describes what WeKan already DOES belongs with the feature it
describes, not in the folder for things being proposed. Fifteen docs move:

  Design/Accessibility.md      -> Features/Accessibility/Accessibility-Improvements.md
  Design/Original-Positions.md -> Features/Board/Original-Positions.md
  Design/Page/*                -> Features/Page/*   (thirteen pages that exist)
  Design/AdminPanelProblems.md -> Features/Admin-Panel/Problems/Design.md

What stays in docs/Design is what the folder is for: the principles
(Design-Principles, Monkey-Proof-Software), the comparisons, the roadmap
(Multiverse), and the proposals not yet built (Multitenancy, Autoupdate).

The Admin Panel Problems design is new and covers six changes - summaries, the
per-actor tally, IPv4/IPv6 columns, an API report, a per-address login tally,
and blocking with increasing delays. Three are shipped and three are planned;
it is filed under the feature because the pane exists, with each planned item
marked so it can become plain description as it lands.

Every reference in the repository is rewritten - 152 files, including the CSS
comments that point at the table-page design, which a first pass over .md and
.js alone missed. Two suites asserted the old paths and now assert the new
ones. A moved doc whose links nobody fixed is worse than one nobody moved.

Thanks to xet7 !
2026-08-16 15:15:01 +03:00

136 lines
6.3 KiB
Plaintext

//- The ONE left menu used by every Admin Panel page.
//- Design + the list of pages that use it: docs/Features/Page/Left-Menu.md
//-
//- "Left" is the reading order, not a side: under a right-to-left language the
//- whole panel mirrors and this menu sits on the RIGHT. That comes from logical
//- CSS on .side-menu, not from anything here — see the design doc.
//-
//- The three icon shapes below are the ones the pages already used, reproduced
//- exactly so converting a page changes no pixel:
//- emoji:true an empty span.emoji-icon before the icon (Settings,
//- Features) — the span carries its own font-size rule
//- iconWrapCls:'text-red' the icon wrapped in a coloured span.emoji-icon
//- (People → Locked users)
//- neither a bare i.fa (Problems, People, Translation, Info)
//-
//- Data context: { items } from buildMenuItems() in models/lib/leftMenu.js.
template(name="leftMenu")
//- TWO roots, and the handle is the second on purpose: it is positioned
against the ROW (.content-body), not against the menu, because the menu is
its own scroll area and a handle inside it would scroll away with the
entries. Here rather than in each page's template, so a new Admin Panel page
cannot draw the menu and forget the handle.
docs/Features/Page/Left-Menu.md
.side-menu(class="{{#if isLeftMenuCollapsed}}collapsed{{/if}}")
+leftMenuCollapse
ul
each items
if separator
li.left-menu-separator
hr
else if heading
//- A group title: text, not a row. No anchor, so there is nothing to
//- click and nothing for the page's click handler to read a data-id from.
li.left-menu-heading
if labelKey
| {{_ labelKey}}
else
| {{label}}
else
li(class="{{#if active}}active{{/if}} {{cls}}")
a.js-left-menu-item(class="{{jsClass}}" data-id="{{id}}")
if iconWrapCls
span.emoji-icon(class="{{iconWrapCls}}")
i.fa(class="{{icon}}")
else
if emoji
span.emoji-icon
i.fa(class="{{icon}}")
if labelKey
| {{_ labelKey}}
else
| {{label}}
+leftMenuResize
//- The grip that changes the menu's width, on its INNER edge - the right one
//- while reading left to right, the left one under a right-to-left language,
//- which the CSS mirrors by itself. It is the same gesture the right board
//- sidebar has on its own inner edge (sidebar.jade), and it is dragged the same
//- way: press, move, and the width is saved when let go.
//-
//- `nodragscroll` for the same reason the sidebar's has it: the board pages
//- drag-scroll on mousedown, and without it a drag on the grip would pan the
//- page instead of resizing the menu.
//-
//- It is positioned against the ROW around the menu rather than against the
//- menu, so it does not scroll with a long list of entries, and it follows the
//- menu because both read the same `--wekan-left-menu-width`.
//- client/components/settings/leftMenu.js, docs/Features/Page/Left-Menu.md
template(name="leftMenuResize")
.left-menu-resize-handle.js-left-menu-resize.nodragscroll(
title="{{_ 'drag-to-resize-left-menu'}}"
aria-label="{{_ 'drag-to-resize-left-menu'}}"
role="separator"
aria-orientation="vertical")
//- The title of the open pane, at the top of the content beside the menu. Its text
//- is the ACTIVE menu entry's own label (paneTitle() in models/lib/leftMenu.js), so
//- every Admin Panel pane has a heading, in the same words as the row that opened
//- it and - through the one .admin-pane-title class - at the same size. The shared
//- table page puts that class on its own title, so a table pane and a form pane
//- look the same.
//-
//- FOLDED, this heading is also the way back: the menu is gone entirely - no
//- column, no strip - so the caret moves here, to the inline start of the title,
//- and the caret AND the title are one target that brings the menu back. The
//- whole heading is inside the anchor for exactly that reason.
//-
//- It is drawn even when there is no title. paneTitle() returns {} when no menu
//- entry is active, and an empty heading is better than a folded menu with
//- nothing left to unfold it.
//-
//- Data context: { titleKey } or { label } from paneTitle().
template(name="paneTitle")
if isLeftMenuCollapsed
h1.admin-pane-title.admin-pane-title-folded
+leftMenuCollapse(paneTitleKey=titleKey paneLabel=label)
else if titleKey
h1.admin-pane-title {{_ titleKey}}
else if label
h1.admin-pane-title {{label}}
//- The caret that folds the menu away.
//-
//- The same control a LIST has on a board (listHeader.jade): a caret pointing
//- DOWN while the thing is open and RIGHT once it is folded, clicked to switch.
//- It is the collapse gesture WeKan already has, so there is nothing new to
//- learn, and it uses the same two words - Collapse / Uncollapse - in its
//- tooltip.
//-
//- It is drawn TWICE, and only ever one of them is on screen, because the menu
//- itself is not drawn while it is folded:
//- * at the top of the menu, where it points down and folds the menu away;
//- * at the inline start of the pane title, where it points right and brings
//- the menu back - see `paneTitle` above, which passes the pane's title in
//- so that caret and title are ONE target rather than two.
//- One template for both places and both pages, so the carets cannot drift.
//- client/components/settings/leftMenu.js
template(name="leftMenuCollapse")
a.left-menu-collapse-indicator.js-collapse-left-menu(
title="{{collapseLabel}}"
aria-label="{{collapseLabel}}"
role="button"
tabindex="0")
if isLeftMenuCollapsed
i.fa.fa-caret-right
else
i.fa.fa-caret-down
//- The pane's own title, when this is the caret beside it. `paneTitleKey` /
//- `paneLabel` rather than the `titleKey` / `label` paneTitle() itself uses,
//- so the caret in the MENU - which inherits whatever data context the menu
//- sits in - can never pick a title up by accident.
if paneTitleKey
span.left-menu-collapse-title {{_ paneTitleKey}}
else if paneLabel
span.left-menu-collapse-title {{paneLabel}}