From 62ef041b352eaaf8d2d5a1d3b5838ed28c997e15 Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Mon, 4 Jan 2021 01:30:39 +0100 Subject: [PATCH] Added filter presets to consent warning. Updating scenes when tag filter changes. --- assets/components/actors/actor.vue | 7 +- assets/components/container/container.vue | 11 ++- assets/components/container/filters.vue | 47 +++++---- assets/components/container/warning.vue | 111 ++++++++++++++++++---- assets/components/entities/entity.vue | 1 + assets/components/home/home.vue | 7 +- assets/components/tags/tag.vue | 7 +- assets/js/actors/actions.js | 14 ++- 8 files changed, 153 insertions(+), 52 deletions(-) diff --git a/assets/components/actors/actor.vue b/assets/components/actors/actor.vue index 67fbf7f7..701cf664 100644 --- a/assets/components/actors/actor.vue +++ b/assets/components/actors/actor.vue @@ -384,10 +384,6 @@ function sfw() { return this.$store.state.ui.sfw; } -async function route() { - await this.fetchActor(); -} - async function mounted() { await this.fetchActor(); @@ -422,7 +418,8 @@ export default { sfw, }, watch: { - $route: route, + $route: fetchActor, + '$store.state.ui.tagFilter': fetchActor, }, mounted, methods: { diff --git a/assets/components/container/container.vue b/assets/components/container/container.vue index ef97292d..3b34756e 100644 --- a/assets/components/container/container.vue +++ b/assets/components/container/container.vue @@ -3,7 +3,7 @@ @@ -46,11 +46,18 @@ function toggleFilters(state) { this.showSidebar = false; } -async function setConsent(consent) { +async function setConsent(consent, includeQueer) { if (consent) { this.showWarning = false; localStorage.setItem('consent', window.env.sessionId); } + + if (includeQueer) { + this.$store.dispatch('setTagFilter', this.$store.state.ui.tagFilter.filter(tag => !['gay', 'bisexual', 'transsexual'].includes(tag))); + return; + } + + this.$store.dispatch('setTagFilter', this.$store.state.ui.tagFilter.concat(['gay', 'bisexual', 'transsexual'])); } function blur(event) { diff --git a/assets/components/container/filters.vue b/assets/components/container/filters.vue index 68b5e6af..af44e286 100644 --- a/assets/components/container/filters.vue +++ b/assets/components/container/filters.vue @@ -3,22 +3,26 @@ title="filters" @close="$emit('close')" > -

Show me

+
+

Show me

-
    -
  • - -
  • -
+
    +
  • + +
  • +
+ +

You may incidentally see filtered content

+
@@ -57,13 +61,24 @@ export default { diff --git a/assets/components/container/warning.vue b/assets/components/container/warning.vue index 468407c4..ac50c5e8 100644 --- a/assets/components/container/warning.vue +++ b/assets/components/container/warning.vue @@ -8,7 +8,7 @@ This website contains sexually explicit content - By entering, you agree to the following + By entering, you agree to the following