diff --git a/changelog.d/admin_tab.add b/changelog.d/admin_tab.add new file mode 100644 index 000000000..421ce57cd --- /dev/null +++ b/changelog.d/admin_tab.add @@ -0,0 +1 @@ +Most of the remaining AdminFE tabs into Admin Dashboard diff --git a/src/App.scss b/src/App.scss index ee1654bb7..57faf4aa3 100644 --- a/src/App.scss +++ b/src/App.scss @@ -513,6 +513,12 @@ nav { } } +label { + &.-disabled { + color: var(--textFaint); + } +} + input, textarea { border: none; @@ -553,6 +559,10 @@ textarea { &[disabled="disabled"], &.disabled { cursor: not-allowed; + color: var(--textFaint); + + /* stylelint-disable-next-line declaration-no-important */ + background-color: transparent !important; } &[type="range"] { @@ -578,6 +588,8 @@ textarea { & + label::before { opacity: 0.5; } + + background-color: var(--background); } + label::before { @@ -677,7 +689,8 @@ option { list-style: none; display: grid; grid-auto-flow: row dense; - grid-template-columns: 1fr 1fr; + grid-template-columns: repeat(auto-fit, minmax(20em, 1fr)); + grid-gap: 0.5em; li { border: 1px solid var(--border); @@ -692,13 +705,16 @@ option { display: inline-flex; vertical-align: middle; + .Select select { + line-height: 1; + } + > *, > * .button-default { --_roundness-left: 0; --_roundness-right: 0; position: relative; - flex: 1 1 auto; } > *:first-child, diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue index c8bba4c44..1e0f5ad05 100644 --- a/src/components/checkbox/checkbox.vue +++ b/src/components/checkbox/checkbox.vue @@ -1,7 +1,7 @@ + + diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.js b/src/components/settings_modal/admin_tabs/emoji_tab.js index d8f769e0b..7c137e35f 100644 --- a/src/components/settings_modal/admin_tabs/emoji_tab.js +++ b/src/components/settings_modal/admin_tabs/emoji_tab.js @@ -10,6 +10,22 @@ import ModifiedIndicator from '../helpers/modified_indicator.vue' import EmojiEditingPopover from '../helpers/emoji_editing_popover.vue' import { useInterfaceStore } from 'src/stores/interface' +import SharedComputedObject from '../helpers/shared_computed_object.js' +import { library } from '@fortawesome/fontawesome-svg-core' +import { + faArrowsRotate, + faFolderOpen, + faServer, + faDownload +} from '@fortawesome/free-solid-svg-icons' + +library.add( + faArrowsRotate, + faFolderOpen, + faDownload, + faServer +) + const EmojiTab = { components: { TabSwitcher, @@ -44,10 +60,12 @@ const EmojiTab = { }, computed: { + ...SharedComputedObject(), pack () { return this.packName !== '' ? this.knownPacks[this.packName] : undefined }, packMeta () { + if (this.packName === '') return {} if (this.editedMetadata[this.packName] === undefined) { this.editedMetadata[this.packName] = clone(this.pack.pack) } @@ -98,8 +116,6 @@ const EmojiTab = { return Promise.reject(resp) } }).then(() => { - this.$refs.createPackPopover.hidePopover() - this.packName = this.newPackName this.newPackName = '' }) @@ -205,8 +221,6 @@ const EmojiTab = { for (const pack in this.knownRemotePacks[inst]) { this.sortPackFiles(`${pack}@${inst}`) } - - this.$refs.remotePackPopover.hidePopover() }) .catch(data => { this.displayError(data) @@ -223,8 +237,6 @@ const EmojiTab = { .then(data => data.json()) .then(resp => { if (resp === 'ok') { - this.$refs.downloadPackPopover.hidePopover() - return this.refreshPackList() } else { this.displayError(resp.error) @@ -242,8 +254,6 @@ const EmojiTab = { .then(data => data.json()) .then(resp => { if (resp === 'ok') { - this.$refs.additionalRemotePopover.hidePopover() - return this.refreshPackList() } else { this.displayError(resp.error) @@ -262,8 +272,6 @@ const EmojiTab = { .then(data => data.json()) .then(resp => { if (resp === 'ok') { - this.$refs.additionalRemotePopover.hidePopover() - return this.refreshPackList() } else { this.displayError(resp.error) diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.scss b/src/components/settings_modal/admin_tabs/emoji_tab.scss index eefada63a..327d0f376 100644 --- a/src/components/settings_modal/admin_tabs/emoji_tab.scss +++ b/src/components/settings_modal/admin_tabs/emoji_tab.scss @@ -1,10 +1,48 @@ -.emoji-tab { - .btn-group .btn:not(:first-child) { - margin-left: 0.5em; +.EmojiTab { + .setting-list { + padding-left: 0.75em; } - .pack-info-wrapper { + .toolbar { + display: flex; + flex-wrap: wrap; + gap: 0.5em; + + .header-buttons { + display: flex; + flex: 1 0 auto; + justify-content: end; + + &:not(.btn-group) { + gap: 0.5em; + } + + .header-text { + flex: 1 0 auto; + } + } + + .button-default { + flex: 0 0 auto; + padding: 0.5em; + font-size: 1rem; + } + } + + .selector-buttons, + .meta-buttons { + display: flex; + flex-wrap: wrap; + gap: 0.5em; + } + + h5 { margin-top: 1em; + margin-bottom: 0.25em; + } + + h3.toolbar { + align-items: end; } .emoji-info-input { @@ -18,8 +56,8 @@ } .emoji { - width: 32px; - height: 32px; + width: 2em; + height: 2em; } .emoji-unsaved { @@ -30,6 +68,14 @@ display: flex; flex-wrap: wrap; gap: 1em; + + .placeholder { + background: var(--textFaint); + border-radius: 0.5em; + width: 2em; + height: 2em; + opacity: 0.5; + } } } diff --git a/src/components/settings_modal/admin_tabs/emoji_tab.vue b/src/components/settings_modal/admin_tabs/emoji_tab.vue index 9095192fe..fcf03dd97 100644 --- a/src/components/settings_modal/admin_tabs/emoji_tab.vue +++ b/src/components/settings_modal/admin_tabs/emoji_tab.vue @@ -1,168 +1,75 @@