mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
Reported one after another, all in the Admin Panel, and they turned out to share
two causes: a stylesheet deciding a table's width from outside the design that
owns it, and a pane having to write for itself what every pane needs.
The tables
* Admin Panel / People / People rendered NOTHING - no table, no search box, no
pager. `buildFilters` and `buildActions` were used in peopleTablePageData but
never imported. That is not a build error: it is a ReferenceError thrown inside
a helper while rendering, which Blaze answers by rendering nothing at all.
Organizations, Teams and Domains use neither function, so they drew normally,
which is what made it look like a People-only problem.
* The right-hand side of a table was off screen - reported on Domains, and just
as true of Admin Panel / Version, where the value column was cut off at the
window edge. Two admin stylesheets forced `min-width: 1200px !important;
width: max-content !important` with nowrap cells on a bare `table` selector.
peopleBody.css had no page in the selector at all, so it reached every table in
WeKan, and `!important` beat the shared table page's own width:100% +
table-layout:fixed. The same rules also made a SHORT table shrink to its
content, which is why Domains sat at a third of the panel on a narrow window.
No admin table is forced wide any more: it fits its panel and its cells wrap,
and the phone-width exception that used to undo the floor is simply the rule at
every width. The shared table page's width and wrapping are `!important` now -
a guarantee a stylesheet in another folder can silently override is not a
guarantee.
* An empty table page rendered no table at all, and the "New" link of
Organizations, Teams, People and Translation is a column HEADER - so an empty
pane had no way to create the first row. The table always renders now; the
"no items" message moved below it.
* The controls row: every control shares one height and no margin. forms.css is
`button { display: block; margin-bottom: 14px }`, written for stacked form
buttons, so a button that kept that margin was centred higher than one that did
not - "Unlock all users" sat lower and shorter than "Teams" beside it, since it
also carried a 20px margin and a 28px height from the old hand-written header.
Action buttons are themed with the pager, in the one stylesheet that owns those
colours, every state spelled out, or a bare <button> falls through to the
forms.css fallback, which is literally black.
Admin Panel / Settings / Translation now renders through the shared table page
(docs/Design/Page/Table.md) instead of a hand-written table: four columns, an
interactive row, the "New" link as a column header. It pages ONE page of 25
server-side with limit/skip and a count method, where it used to grow a window by
infinite scroll; the publication publishes the field it is sorted by, so the
client's sort matches the server's page.
The pane title
Every Admin Panel pane opens with the same heading, and the heading is the ACTIVE
LEFT MENU ENTRY's own label - `paneTitle()` in models/lib/leftMenu.js, one class
`.admin-pane-title`, which the shared table page's own title carries too. Before
this only the paginated table pages had a title at all: Domains said "Domains"
while Login, Announcement, Accessibility, PWA and Version opened with no heading.
Deriving it from the menu is what keeps them identical - a pane cannot end up with
a title of a different size or none at all - and it is why a table page inside the
Admin Panel now passes no titleKey: the section already rendered the heading.
The menus
* Version is the FIRST pane of Admin Panel / Settings and the one that opens with
the page, so what an admin sees first is the version, database and system
information they usually came for. Its page, its one-entry menu and its tab are
gone - a page whose menu had a single entry was a page in name only - and
/information redirects to Settings, the same move Translation made.
* Admin Panel / People: Domains moves up beside E-mail, the settings it is about.
* Admin Panel / Attachments: Backup moves to the top.
Tests: tests/tablePage.test.cjs gains the Translation conversion, the empty-table
header, the one-height controls row, the themed actions and a guard that no admin
stylesheet may force a table's width; tests/leftMenu.test.cjs gains the pane title
(helper, template, every page renders it, one shared size) and Version as the
first Settings pane; tests/translationPane.test.cjs is rewritten for the pane that
is left once the shared design owns the table.
Thanks to xet7 !
144 lines
5.5 KiB
CSS
144 lines
5.5 KiB
CSS
/* Shared look for EVERY prev/next pagination control in WeKan.
|
|
Admin Panel reports, People/Org/Team/Domain, All Boards, Board Table view,
|
|
Archived boards and the Cron settings tables all page the same way, so they
|
|
all get the same themed buttons here instead of each stylesheet inventing its
|
|
own greys.
|
|
|
|
Why this file exists at all: the global button rules in
|
|
client/components/forms/forms.css set
|
|
|
|
button { background: var(--theme-accent, #000) }
|
|
button:focus { background: var(--theme-accent, #222) }
|
|
button:active { background: var(--theme-accent, #111) }
|
|
button:active:hover { background: #e6e6e6 }
|
|
|
|
With no custom theme colour chosen those fall back to BLACK / dark grey /
|
|
grey. `button:focus` and `button:active` have the same specificity as a
|
|
`.some-pagination button` rule, and `button:active:hover` has a HIGHER one, so
|
|
the per-page pagination rules lost as soon as the button was clicked: pressing
|
|
"next" left the button sitting there with a black or grey background until it
|
|
lost focus. Every state is therefore spelled out below, at a specificity that
|
|
beats the global button rules, and every colour comes from the theme accent
|
|
(Member Settings -> Change color sets --theme-accent on :root) with the WeKan
|
|
blue as the fallback. */
|
|
|
|
.table-page-pagination button,
|
|
.boards-pagination button,
|
|
.table-view-pagination button,
|
|
.cron-settings .pagination button {
|
|
min-width: 32px;
|
|
height: 30px;
|
|
padding: 0 10px;
|
|
border: 1px solid var(--theme-accent, #01628c);
|
|
border-radius: 6px;
|
|
background: transparent;
|
|
background-image: none;
|
|
color: var(--theme-accent, #01628c);
|
|
font-weight: 700;
|
|
line-height: 1.3;
|
|
cursor: pointer;
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* Hover, keyboard focus and the pressed state all use the accent as the FILL,
|
|
so a clicked "next" button reads as themed instead of black. :focus-visible is
|
|
listed separately so a mouse click does not leave a permanent focus ring, but
|
|
keyboard users still get one. */
|
|
.table-page-pagination button:hover:not(.disabled),
|
|
.table-page-pagination button:focus:not(.disabled),
|
|
.table-page-pagination button:active:not(.disabled),
|
|
.boards-pagination button:hover:not(.disabled),
|
|
.boards-pagination button:focus:not(.disabled),
|
|
.boards-pagination button:active:not(.disabled),
|
|
.table-view-pagination button:hover:not(.disabled),
|
|
.table-view-pagination button:focus:not(.disabled),
|
|
.table-view-pagination button:active:not(.disabled),
|
|
.cron-settings .pagination button:hover,
|
|
.cron-settings .pagination button:focus,
|
|
.cron-settings .pagination button:active {
|
|
background: var(--theme-accent, #01628c);
|
|
background-image: none;
|
|
border-color: var(--theme-accent, #01628c);
|
|
color: #fff;
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* forms.css turns a held-down button grey (#e6e6e6) with a higher specificity
|
|
than a plain `.pagination button` rule - keep the accent instead. */
|
|
.table-page-pagination button:active:hover,
|
|
.table-page-pagination button:active:focus,
|
|
.boards-pagination button:active:hover,
|
|
.boards-pagination button:active:focus,
|
|
.table-view-pagination button:active:hover,
|
|
.table-view-pagination button:active:focus,
|
|
.cron-settings .pagination button:active:hover,
|
|
.cron-settings .pagination button:active:focus {
|
|
background: var(--theme-accent, #01628c);
|
|
background-image: none;
|
|
color: #fff;
|
|
}
|
|
|
|
/* The current page in a numbered pager. */
|
|
.table-page-pagination button.active,
|
|
.boards-pagination button.active,
|
|
.table-view-pagination button.active {
|
|
background: var(--theme-accent, #01628c);
|
|
background-image: none;
|
|
border-color: var(--theme-accent, #01628c);
|
|
color: #fff;
|
|
}
|
|
|
|
/* Disabled = the same themed outline, faded. Not a grey block. */
|
|
.table-page-pagination button.disabled,
|
|
.boards-pagination button.disabled,
|
|
.table-view-pagination button.disabled {
|
|
background: transparent;
|
|
background-image: none;
|
|
border-color: var(--theme-accent, #01628c);
|
|
color: var(--theme-accent, #01628c);
|
|
opacity: 0.4;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* The ACTION buttons of the shared controls row (docs/Design/Page/Table.md):
|
|
Admin Panel / People's "Unlock all users" and "Teams". They sit in the same row
|
|
as the pager and are bare <button>s too, so without a rule here they fell
|
|
through to the forms.css fallbacks above and came out BLACK - then dark grey
|
|
while focused, then grey while held down. Filled with the accent (they are
|
|
actions, not navigation), every state spelled out for the same specificity
|
|
reason, and the WeKan blue when no per-user theme colour is set. */
|
|
.table-page-controls button.js-table-page-action {
|
|
border: 1px solid var(--theme-accent, #01628c);
|
|
border-radius: 6px;
|
|
background: var(--theme-accent, #01628c);
|
|
background-image: none;
|
|
color: #fff;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
box-shadow: none;
|
|
}
|
|
|
|
.table-page-controls button.js-table-page-action:hover,
|
|
.table-page-controls button.js-table-page-action:focus,
|
|
.table-page-controls button.js-table-page-action:active,
|
|
.table-page-controls button.js-table-page-action:active:hover,
|
|
.table-page-controls button.js-table-page-action:active:focus {
|
|
background: var(--theme-accent, #005377);
|
|
background-image: none;
|
|
border-color: var(--theme-accent, #005377);
|
|
color: #fff;
|
|
box-shadow: none;
|
|
}
|
|
|
|
/* "3 / 42" between the buttons: inherit the surrounding text colour so it stays
|
|
readable in both the light and the dark theme (it used to be hard-coded #333,
|
|
which disappears on a dark background). */
|
|
.table-page-page-info,
|
|
.boards-page-info,
|
|
.table-view-page-info,
|
|
.cron-settings .pagination .page-info {
|
|
min-width: 72px;
|
|
text-align: center;
|
|
color: inherit;
|
|
}
|