mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 05:59:26 +08:00
When there are 3 or more groups added to the category permissions matrix, this includes a "remove all" button to make it easier to reset them. This is especially useful when creating a new subcategory of a parent with many groups included. <img width="1446" height="578" alt="image" src="https://github.com/user-attachments/assets/803c1630-8769-4bd6-a2c8-16b9fa490bca" />
725 lines
13 KiB
SCSS
Vendored
725 lines
13 KiB
SCSS
Vendored
@use "lib/viewport";
|
|
@use "sass:string";
|
|
|
|
$category-settings-width: string.unquote("min(600px, 90%)");
|
|
$number-input-width: 75px;
|
|
|
|
div.edit-category {
|
|
display: block;
|
|
max-width: 75ch;
|
|
width: 100%;
|
|
margin: 0 auto;
|
|
|
|
@include viewport.until(sm) {
|
|
display: block;
|
|
}
|
|
|
|
.edit-category-title-bar {
|
|
grid-area: header;
|
|
grid-column: 1 / span 2;
|
|
display: flex;
|
|
gap: 1em;
|
|
justify-content: space-between;
|
|
align-self: start;
|
|
background-color: var(--primary-very-low);
|
|
padding: 20px;
|
|
|
|
@include viewport.until(sm) {
|
|
justify-content: start;
|
|
align-items: center;
|
|
padding-bottom: 1em;
|
|
}
|
|
|
|
h2 {
|
|
@include ellipsis;
|
|
|
|
@include viewport.until(sm) {
|
|
order: 2;
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
|
|
.category-back {
|
|
height: 2em;
|
|
align-self: flex-end;
|
|
flex: 0 0 auto;
|
|
}
|
|
}
|
|
|
|
.edit-category-title {
|
|
min-width: 0;
|
|
}
|
|
|
|
.edit-category-nav {
|
|
grid-area: sidebar;
|
|
grid-row: 2 / span 3;
|
|
|
|
@include viewport.until(sm) {
|
|
width: 100%;
|
|
background-color: var(--secondary);
|
|
position: relative;
|
|
border-top: 1px solid var(--content-border-color);
|
|
border-bottom: 1px solid var(--content-border-color);
|
|
margin: 0.5em 0;
|
|
overflow: hidden;
|
|
|
|
&::after {
|
|
background: linear-gradient(
|
|
to right,
|
|
rgb(var(--secondary-rgb), 0),
|
|
rgb(var(--secondary-rgb), 1)
|
|
);
|
|
content: "";
|
|
position: absolute;
|
|
right: 0;
|
|
height: 100%;
|
|
width: 30px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.nav-stacked {
|
|
background-color: var(--secondary);
|
|
|
|
@include viewport.until(sm) {
|
|
white-space: nowrap;
|
|
flex-wrap: nowrap;
|
|
overflow-x: scroll;
|
|
display: inline-flex;
|
|
width: 100%;
|
|
margin-bottom: 0;
|
|
|
|
li {
|
|
font-size: var(--font-down-1);
|
|
border-bottom: none;
|
|
}
|
|
|
|
a.active::after {
|
|
display: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.edit-category-content {
|
|
grid-area: content;
|
|
|
|
@include viewport.until(sm) {
|
|
padding-top: 1em;
|
|
}
|
|
|
|
.edit-category-tab {
|
|
display: none;
|
|
}
|
|
|
|
.edit-category-tab.active {
|
|
display: contents;
|
|
}
|
|
|
|
.form-kit__container-content {
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.category-permission-hint {
|
|
font-size: var(--font-down-1);
|
|
color: var(--primary-high-or-secondary-low);
|
|
}
|
|
}
|
|
|
|
#list-area & h2 {
|
|
margin: 0;
|
|
}
|
|
|
|
section.field {
|
|
margin-bottom: 1em;
|
|
}
|
|
|
|
.category-name-fields {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 1em;
|
|
}
|
|
|
|
.warning {
|
|
background-color: var(--tertiary-low);
|
|
padding: 0.5em 2.5em 0.5em 1em;
|
|
margin-top: 0;
|
|
}
|
|
|
|
.edit-category-tab-general {
|
|
.category-chooser {
|
|
width: min(340px, 90%);
|
|
}
|
|
|
|
.select-kit-header {
|
|
padding-right: 0.65em;
|
|
|
|
&:hover {
|
|
border: 1px solid var(--tertiary);
|
|
}
|
|
|
|
.angle-icon {
|
|
color: var(--primary-high);
|
|
width: 0.85em;
|
|
}
|
|
}
|
|
}
|
|
|
|
.edit-category-tab-security {
|
|
--permission-table-max-width: 450px;
|
|
|
|
.form-kit__container-content {
|
|
flex-direction: column;
|
|
}
|
|
|
|
.alert {
|
|
display: block;
|
|
max-width: var(--permission-table-max-width);
|
|
}
|
|
|
|
.permission-selector {
|
|
margin-right: 0.25em;
|
|
}
|
|
|
|
.pending-permission-change-alert {
|
|
margin-left: auto;
|
|
max-width: 250px;
|
|
background: var(--primary-very-high);
|
|
color: var(--secondary);
|
|
margin-top: 10px;
|
|
padding: 5px 10px;
|
|
position: relative;
|
|
|
|
.arrow-div {
|
|
border: solid transparent;
|
|
content: " ";
|
|
position: absolute;
|
|
border-bottom-color: var(--primary-very-high);
|
|
border-width: 7px;
|
|
top: -13px;
|
|
left: 200px;
|
|
}
|
|
}
|
|
|
|
.permission-list {
|
|
list-style: none;
|
|
margin: 0 0 30px;
|
|
padding: 0;
|
|
|
|
.name {
|
|
margin-right: 20px;
|
|
display: inline-block;
|
|
min-width: 100px;
|
|
}
|
|
|
|
.permission {
|
|
margin-left: 20px;
|
|
}
|
|
|
|
.d-icon-circle-xmark {
|
|
margin-left: 5px;
|
|
color: var(--danger);
|
|
}
|
|
|
|
li {
|
|
margin-bottom: 10px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.edit-category-tab-settings,
|
|
.edit-category-tab-moderation,
|
|
.edit-category-tab-tags,
|
|
.edit-category-tab-topic-template {
|
|
> section {
|
|
margin-bottom: 1.5em;
|
|
}
|
|
|
|
input[type="text"],
|
|
.select-kit {
|
|
width: $category-settings-width;
|
|
}
|
|
|
|
label {
|
|
max-width: $category-settings-width;
|
|
}
|
|
|
|
input[type="number"] {
|
|
width: $number-input-width;
|
|
}
|
|
}
|
|
|
|
.edit-category-tab-tags {
|
|
#category-min-tags-from-group {
|
|
width: $number-input-width;
|
|
min-height: 36px;
|
|
}
|
|
|
|
.select-kit {
|
|
&.tag-chooser {
|
|
width: 250px;
|
|
|
|
.select-kit-filter,
|
|
.filter-input {
|
|
min-width: 250px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.manage-tag-groups {
|
|
display: block;
|
|
}
|
|
}
|
|
|
|
.edit-category-delete-warning {
|
|
grid-area: warning;
|
|
}
|
|
|
|
.edit-category-footer {
|
|
grid-area: footer;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-self: start;
|
|
padding: 0 1.5em 2em 0;
|
|
}
|
|
|
|
.category-topic-auto-close-hours,
|
|
.category-default-slow-mode-seconds {
|
|
width: 200px;
|
|
}
|
|
|
|
.required-tag-groups {
|
|
.required-tag-group-row {
|
|
display: flex;
|
|
gap: 0.5em;
|
|
margin-bottom: 1em;
|
|
|
|
> * {
|
|
margin: 0;
|
|
}
|
|
|
|
input[type="number"] {
|
|
width: 4em;
|
|
}
|
|
}
|
|
}
|
|
|
|
.edit-category-tab-topic-template {
|
|
.select-category-template__info {
|
|
margin-block: 0.25rem;
|
|
font-size: var(--font-down-1);
|
|
}
|
|
}
|
|
}
|
|
|
|
.category-permissions-table {
|
|
--permission-table-max-width: var(--form-kit-max-input);
|
|
width: 100%;
|
|
}
|
|
|
|
div.edit-category {
|
|
.d-page-header__title-row {
|
|
line-height: var(--line-height-medium);
|
|
gap: var(--space-4);
|
|
}
|
|
|
|
.edit-category-tab-security {
|
|
.alert {
|
|
--permission-table-max-width: var(--form-kit-max-input);
|
|
}
|
|
}
|
|
|
|
.edit-category-tab:not(.edit-category-tab-general) {
|
|
.form-kit__container-optional {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
h1 {
|
|
font-size: var(--font-up-3);
|
|
}
|
|
|
|
.form-kit__field-toggle {
|
|
flex-direction: column;
|
|
width: 100%;
|
|
gap: 0.5em;
|
|
align-items: start;
|
|
|
|
.form-kit__container-content {
|
|
align-items: flex-start;
|
|
}
|
|
}
|
|
|
|
.form-kit__conditional-display-content {
|
|
// prevent content shift when changing style options
|
|
min-height: 2.6em;
|
|
|
|
&:has(.badge-category__wrapper) {
|
|
justify-content: center;
|
|
}
|
|
}
|
|
|
|
.--radio-cards {
|
|
.form-kit__container-title {
|
|
max-width: var(--form-kit-max-input);
|
|
width: 100%;
|
|
}
|
|
|
|
.form-kit__conditional-display-content {
|
|
.form-kit__container {
|
|
flex-direction: column;
|
|
}
|
|
}
|
|
}
|
|
|
|
.select-kit.multi-select.group-chooser {
|
|
max-width: var(--form-kit-max-input);
|
|
width: 100%;
|
|
}
|
|
|
|
.edit-category-tab-settings label,
|
|
.edit-category-tab-tags label,
|
|
.edit-category-tab-settings input[type="text"],
|
|
.edit-category-tab-settings .select-kit,
|
|
.edit-category-tab-tags input[type="text"],
|
|
.edit-category-tab-tags .select-kit {
|
|
width: 100%;
|
|
max-width: var(--form-kit-max-input);
|
|
}
|
|
|
|
.add-required-tag-group {
|
|
align-self: start;
|
|
}
|
|
|
|
#control-icon,
|
|
#control-emoji {
|
|
&.form-kit__field .form-kit__container-content {
|
|
width: auto;
|
|
}
|
|
}
|
|
|
|
.edit-category-title-bar {
|
|
box-sizing: border-box;
|
|
width: 100%;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.edit-category-title {
|
|
flex: 1 1 auto;
|
|
|
|
h2 {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.btn-back {
|
|
margin-top: -0.5em;
|
|
margin-left: -0.5em;
|
|
margin-bottom: 0.5em;
|
|
}
|
|
}
|
|
|
|
.edit-category-nav {
|
|
border-bottom: 1px solid var(--content-border-color);
|
|
}
|
|
|
|
.edit-category-page-header {
|
|
margin-bottom: 1.5em;
|
|
}
|
|
|
|
.edit-category-content {
|
|
grid-area: unset;
|
|
}
|
|
|
|
.edit-category-type-schema-fields {
|
|
display: contents;
|
|
|
|
&.--site-settings-only > .form-kit__section.emphasis {
|
|
border: none;
|
|
padding: 0;
|
|
}
|
|
|
|
.--dependent {
|
|
display: flex;
|
|
gap: 0.75em;
|
|
}
|
|
|
|
.--dependent-border {
|
|
flex: 0 0 1lh;
|
|
border-right: 3px solid var(--primary-low);
|
|
}
|
|
|
|
.--dependent-fields {
|
|
flex: 1;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 1em;
|
|
}
|
|
|
|
.schema-site-text {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
align-items: center;
|
|
|
|
.schema-site-text__locale {
|
|
flex: 0 0 auto;
|
|
width: auto;
|
|
}
|
|
|
|
.form-kit__control-input-wrapper {
|
|
flex: 1 1 auto;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.edit-category-title-text {
|
|
display: flex;
|
|
flex-direction: column;
|
|
margin: 0;
|
|
|
|
.edit-category-static-title {
|
|
transition: font-size 0.2s ease-in-out;
|
|
}
|
|
|
|
&:has(.badge-category__wrapper) {
|
|
.edit-category-static-title {
|
|
position: absolute;
|
|
font-size: var(--font-down-3);
|
|
}
|
|
}
|
|
|
|
.badge-category__wrapper {
|
|
font-weight: normal;
|
|
font-size: var(--font-up-2);
|
|
margin-top: var(--space-5);
|
|
}
|
|
}
|
|
|
|
div.edit-category {
|
|
.form-kit__errors-summary {
|
|
width: 100%;
|
|
max-width: var(--form-kit-max-input);
|
|
margin-top: var(--space-4);
|
|
|
|
+ .form-kit__section.edit-category-content {
|
|
margin-top: 0;
|
|
}
|
|
}
|
|
|
|
.form-kit__conditional-display {
|
|
.form-kit__container-content:has(.is-disabled) {
|
|
// select-kit has pointer-events disabled, so we need to style the parent
|
|
cursor: not-allowed;
|
|
}
|
|
}
|
|
|
|
.edit-category-footer {
|
|
padding: 0;
|
|
margin-bottom: var(--space-4);
|
|
}
|
|
|
|
.edit-category-tab-localizations {
|
|
.btn-default {
|
|
align-self: start;
|
|
}
|
|
}
|
|
|
|
.admin-changes-banner {
|
|
max-width: var(--form-kit-max-input);
|
|
flex-direction: row-reverse;
|
|
align-items: center;
|
|
|
|
.controls {
|
|
flex-direction: row-reverse;
|
|
margin-right: auto;
|
|
}
|
|
}
|
|
}
|
|
|
|
#main-outlet:has(.edit-category) + .powered-by-discourse {
|
|
display: none; // hide for now due to alignment
|
|
}
|
|
|
|
.edit-category-description-container {
|
|
.readonly-field {
|
|
width: 100%;
|
|
font-size: var(--font-down-1);
|
|
color: var(--primary-high);
|
|
|
|
> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
}
|
|
|
|
.description-content {
|
|
&.--collapsed {
|
|
max-height: calc(4 * 1.5em);
|
|
overflow: hidden;
|
|
position: relative;
|
|
|
|
&.--overflowing::after {
|
|
content: "";
|
|
position: absolute;
|
|
bottom: 0;
|
|
left: 0;
|
|
right: 0;
|
|
height: 1.5em;
|
|
background: linear-gradient(transparent, var(--secondary, white));
|
|
pointer-events: none;
|
|
}
|
|
}
|
|
}
|
|
|
|
.description-actions {
|
|
width: 100%;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-2);
|
|
margin-top: var(--space-2);
|
|
|
|
.toggle-description {
|
|
color: var(--primary-medium);
|
|
|
|
&:hover {
|
|
color: var(--primary-high);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
.category-permissions-table {
|
|
max-width: var(--permission-table-max-width);
|
|
margin-bottom: 0;
|
|
|
|
.permission-row {
|
|
border-bottom: 1px solid var(--content-border-color);
|
|
display: flex;
|
|
|
|
&.row-header {
|
|
font-weight: bold;
|
|
border-bottom: 2px solid var(--primary-low);
|
|
}
|
|
|
|
.group-name,
|
|
.options {
|
|
display: flex;
|
|
box-sizing: border-box;
|
|
text-align: center;
|
|
width: 50%;
|
|
margin: 0;
|
|
align-items: center;
|
|
}
|
|
|
|
.group-name {
|
|
text-align: left;
|
|
padding: 0.5em;
|
|
padding-left: 0;
|
|
|
|
.group-name-label {
|
|
@include ellipsis;
|
|
}
|
|
}
|
|
|
|
.cell,
|
|
.options.actionable .btn.btn-flat {
|
|
width: 33%;
|
|
padding: 0.5em;
|
|
}
|
|
|
|
.btn-flat:hover {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.btn-flat .d-icon-square-check,
|
|
.btn-flat:hover .d-icon-square-check {
|
|
color: var(--success);
|
|
}
|
|
}
|
|
|
|
.remove-permission {
|
|
margin-left: 0.5em;
|
|
padding: 0.15em;
|
|
|
|
.d-icon {
|
|
color: var(--danger);
|
|
}
|
|
|
|
&:hover {
|
|
color: var(--danger-hover);
|
|
}
|
|
}
|
|
|
|
.row-empty {
|
|
padding: 0.5em 0;
|
|
color: var(--primary-medium);
|
|
}
|
|
}
|
|
|
|
.posting-review-group-chooser {
|
|
margin-top: 0.5em;
|
|
|
|
.form-kit__field & {
|
|
margin-top: 0;
|
|
}
|
|
}
|
|
|
|
.edit-category .add-group {
|
|
display: flex;
|
|
gap: var(--space-2);
|
|
margin: 1em 0 2em;
|
|
|
|
.group-name {
|
|
width: 100%;
|
|
}
|
|
|
|
.remove-all-permissions {
|
|
margin-left: auto;
|
|
}
|
|
}
|
|
|
|
.category-type-selector {
|
|
width: var(--form-kit-max-input);
|
|
|
|
.d-multi-select-trigger__selected-item
|
|
.d-multi-select-trigger__selection-label {
|
|
max-width: unset;
|
|
}
|
|
|
|
&__result {
|
|
&.--unavailable {
|
|
.category-type-selector__icon {
|
|
opacity: 0.5;
|
|
}
|
|
|
|
.category-type-selector__name {
|
|
color: var(--primary-medium);
|
|
}
|
|
|
|
.category-type-selector__description {
|
|
opacity: 0.5;
|
|
}
|
|
}
|
|
}
|
|
|
|
&__content {
|
|
.d-multi-select__search-results {
|
|
min-height: 160px;
|
|
}
|
|
}
|
|
|
|
&__name {
|
|
font-weight: bold;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--space-1);
|
|
line-height: 1em;
|
|
padding: var(--space-1) 0;
|
|
}
|
|
|
|
.d-multi-select__result-label {
|
|
display: flex;
|
|
}
|
|
}
|