Files
wekan/client/components/settings/leftMenu.jade
T
Lauri Ojansivu fc0fe31779 Admin Panel / Problems: Broken cards is a report, and the menu says which group is which.
Broken cards was the one entry in this menu with a different set of controls: no
search box, no total, no "page X / N", just a prev/next of its own - because it
ran on the global-search machinery (CardSearchPaged, a session document and the
nextPage/previousPage publications) instead of the shared table page. It is a
column spec in REPORT_TABLES now, like Files, Rules, Boards and Cards, driven by
the same loadReport(): a new admin-only `brokenCardsReport` publication takes a
search term plus limit/skip and publishes ONE page manually (a returned
sorted+limited cursor hangs on FerretDB's OpLog, as with the other reports), and
`getBrokenCardsReportCount` gives the total behind the counter.

What "broken" means - no board, swimlane or list, or a type that is not a card
type - is now one selector shared by the report and by the standalone
/broken-cards page, which still runs on the global search and keeps its own
publication unchanged.

The menu is two named groups. Summary, then a rule and a "Settings" title over the
two panes that came from Admin Panel / Features, then a rule and a "Reports" title
over the reports. A title is a new kind of menu item - `{ heading: true, labelKey }`
- with no id, no icon and no handler class, so there is nothing to click, nothing
for the page's click handler to read a data-id from, and it can never be the active
row (or a group name could end up as a pane title). Both use an i18n key the app
already has, so no language has to translate anything new.

Performance moves down to sit with the Speed, Tests and CPU usage streams it is
about, below Impersonation Report - it was three groups away from them, up with the
other two Features panes.

While there: the separator between groups is styled with the menu itself. The rule
for it lived in adminReports.css, twice, targeting a class the shared menu does not
render - so it had never applied to anything.

Thanks to xet7 !
2026-07-26 01:58:15 +03:00

60 lines
2.5 KiB
Plaintext

//- The ONE left menu used by every Admin Panel page.
//- Design + the list of pages that use it: docs/Design/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")
.side-menu
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}}
//- 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.
//-
//- Data context: { titleKey } or { label } from paneTitle().
template(name="paneTitle")
if titleKey
h1.admin-pane-title {{_ titleKey}}
else if label
h1.admin-pane-title {{label}}