From b5e308562edc610dbe0e35931b3a3ab624bad3e0 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Mon, 28 Nov 2022 03:33:46 +0100 Subject: [PATCH] Merged filters into new settings dialog, added experimental summary field. --- assets/components/container/container.vue | 30 +- assets/components/dialog/dialog.vue | 5 +- assets/components/header/header.vue | 30 +- assets/components/header/menu.vue | 7 +- assets/components/releases/release.vue | 89 +++++- assets/components/settings/filters.vue | 83 ++++++ assets/components/settings/settings.vue | 81 ++++++ assets/components/settings/summary.vue | 327 ++++++++++++++++++++++ assets/components/sidebar/sidebar.vue | 59 ++-- assets/css/_inputs.scss | 9 +- assets/js/ui/actions.js | 6 + assets/js/ui/mutations.js | 5 + assets/js/ui/state.js | 31 ++ assets/js/utils/format-summary.js | 36 +++ src/scrapers/gamma.js | 14 +- 15 files changed, 740 insertions(+), 72 deletions(-) create mode 100644 assets/components/settings/filters.vue create mode 100644 assets/components/settings/settings.vue create mode 100644 assets/components/settings/summary.vue create mode 100644 assets/js/utils/format-summary.js diff --git a/assets/components/container/container.vue b/assets/components/container/container.vue index 9cbb4a36..c70689e5 100755 --- a/assets/components/container/container.vue +++ b/assets/components/container/container.vue @@ -8,17 +8,10 @@ /> - + -
+

- + + + @@ -45,6 +43,7 @@ import Warning from './warning.vue'; import Header from '../header/header.vue'; import Sidebar from '../sidebar/sidebar.vue'; import Filters from '../filters/filters.vue'; +import Settings from '../settings/settings.vue'; function toggleSidebar(state) { this.showSidebar = typeof state === 'boolean' ? state : !this.showSidebar; @@ -55,6 +54,11 @@ function toggleFilters(state) { this.showSidebar = false; } +function toggleSettings(state) { + this.showSettings = state; + this.showSidebar = false; +} + async function setConsent(consent, includeQueer) { if (consent) { this.showWarning = false; @@ -88,6 +92,9 @@ function scrollToTop() { function mounted() { document.addEventListener('click', this.blur); window.addEventListener('resize', this.resize); + + this.events.on('toggleSettings', this.toggleSettings); + this.events.on('toggleSidebar', this.toggleSidebar); } function beforeUnmount() { @@ -101,12 +108,14 @@ export default { Sidebar, Warning, Filters, + Settings, }, data() { return { showSidebar: false, showWarning: localStorage.getItem('consent') !== window.env.sessionId, showFilters: false, + showSettings: false, selected: null, }; }, @@ -115,6 +124,7 @@ export default { methods: { toggleSidebar, toggleFilters, + toggleSettings, setConsent, blur, resize, diff --git a/assets/components/dialog/dialog.vue b/assets/components/dialog/dialog.vue index 9f82f823..2df65231 100755 --- a/assets/components/dialog/dialog.vue +++ b/assets/components/dialog/dialog.vue @@ -114,13 +114,16 @@ export default { } ::v-deep(.dialog-body) { - padding: 1rem; flex-grow: 1; + box-sizing: border-box; + padding: 1rem; overflow-y: auto; } ::v-deep(.dialog-section:not(:last-child)) { + padding-bottom: 1rem; border-bottom: solid 1px var(--shadow-hint); + margin-bottom: 1rem; overflow: auto; } diff --git a/assets/components/header/header.vue b/assets/components/header/header.vue index a481d442..aa7bffcc 100755 --- a/assets/components/header/header.vue +++ b/assets/components/header/header.vue @@ -1,7 +1,7 @@