From 65c79567d2eb21ad166ce6a4382c04b891ad4fbe Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sun, 12 Sep 2021 23:21:39 +0200 Subject: [PATCH] Added unstash buttons to non-favorites stash items --- assets/components/actors/tile.vue | 33 +++++++++++++++++++---- assets/components/releases/movie-tile.vue | 29 ++++++++++++++++---- assets/components/releases/releases.vue | 5 ++++ assets/components/releases/scene-tile.vue | 29 ++++++++++++++++---- assets/components/stashes/stash.vue | 16 +++++++---- 5 files changed, 92 insertions(+), 20 deletions(-) diff --git a/assets/components/actors/tile.vue b/assets/components/actors/tile.vue index a6a8745e..56cdaaf5 100644 --- a/assets/components/actors/tile.vue +++ b/assets/components/actors/tile.vue @@ -60,19 +60,26 @@ > + + @@ -145,12 +152,14 @@ async function stashActor() { } async function unstashActor() { - this.favorited = false; + if (!this.stash || this.stash.primary) { + this.favorited = false; + } try { await this.$store.dispatch('unstashActor', { actorId: this.actor.id, - stashId: this.$store.getters.favorites.id, + stashId: this.stash?.id || this.$store.getters.favorites.id, }); this.$emit('stash', false); @@ -176,6 +185,10 @@ export default { type: Object, default: null, }, + stash: { + type: Object, + default: null, + }, }, emits: ['stash'], data() { @@ -209,6 +222,11 @@ export default { display: inline-block; padding-bottom: 150%; } + + &:hover .unstashed, + &:hover .unstash { + fill: var(--lighten); + } } .link { @@ -307,10 +325,15 @@ export default { fill: var(--lighten-weak); filter: drop-shadow(0 0 2px var(--darken)); - &:hover, + &:hover.unstashed, &.stashed { fill: var(--primary); } + + &:hover.unstash { + fill: var(--text-light); + filter: drop-shadow(0 0 2px var(--darken-weak)); + } } .details { diff --git a/assets/components/releases/movie-tile.vue b/assets/components/releases/movie-tile.vue index 20bf1ed2..155680f1 100644 --- a/assets/components/releases/movie-tile.vue +++ b/assets/components/releases/movie-tile.vue @@ -15,18 +15,25 @@ > + +
@@ -88,12 +95,14 @@ async function stashMovie() { } async function unstashMovie() { - this.favorited = false; + if (!this.stash || this.stash.primary) { + this.favorited = false; + } try { await this.$store.dispatch('unstashMovie', { movieId: this.movie.id, - stashId: this.$store.getters.favorites.id, + stashId: this.stash?.id || this.$store.getters.favorites.id, }); this.$emit('stash', false); @@ -115,6 +124,10 @@ export default { type: Object, default: null, }, + stash: { + type: Object, + default: null, + }, }, data() { return { @@ -141,7 +154,8 @@ export default { box-shadow: 0 0 3px var(--darken-weak); font-size: 0; - &:hover .unstashed { + &:hover .unstashed, + &:hover .unstash { fill: var(--lighten); } } @@ -251,6 +265,11 @@ export default { &.stashed { fill: var(--primary); } + + &:hover.unstash { + fill: var(--text-light); + filter: drop-shadow(0 0 2px var(--darken-weak)); + } } @media(max-width: $breakpoint-kilo) { diff --git a/assets/components/releases/releases.vue b/assets/components/releases/releases.vue index f9cd90df..ba222b56 100644 --- a/assets/components/releases/releases.vue +++ b/assets/components/releases/releases.vue @@ -18,6 +18,7 @@ :release="release" :referer="referer" :index="index" + :stash="stash" @stash="isStashed => $emit('stash', isStashed)" /> @@ -63,6 +64,10 @@ export default { type: String, default: null, }, + stash: { + type: Object, + default: null, + }, }, emits: ['stash'], computed: { diff --git a/assets/components/releases/scene-tile.vue b/assets/components/releases/scene-tile.vue index 6e198ca8..b0a18ba5 100644 --- a/assets/components/releases/scene-tile.vue +++ b/assets/components/releases/scene-tile.vue @@ -46,18 +46,25 @@ >No thumbnail available
+ +
@@ -169,12 +176,14 @@ async function stashScene() { } async function unstashScene() { - this.favorited = false; + if (!this.stash || this.stash.primary) { + this.favorited = false; + } try { await this.$store.dispatch('unstashScene', { sceneId: this.release.id, - stashId: this.$store.getters.favorites.id, + stashId: this.stash?.id || this.$store.getters.favorites.id, }); this.$emit('stash', false); @@ -192,6 +201,10 @@ export default { type: Object, default: null, }, + stash: { + type: Object, + default: null, + }, }, emits: ['stash'], data() { @@ -236,7 +249,8 @@ export default { text-shadow: 0 0 2px var(--darken-weak); } - &:hover .unstashed { + &:hover .unstashed, + &:hover .unstash { fill: var(--lighten); } } @@ -295,6 +309,11 @@ export default { fill: var(--primary); filter: drop-shadow(0 0 2px var(--darken-weak)); } + + &:hover.unstash { + fill: var(--text-light); + filter: drop-shadow(0 0 2px var(--darken-weak)); + } } .row { diff --git a/assets/components/stashes/stash.vue b/assets/components/stashes/stash.vue index 3e70963a..aea08ea6 100644 --- a/assets/components/stashes/stash.vue +++ b/assets/components/stashes/stash.vue @@ -60,6 +60,7 @@ @@ -71,7 +72,11 @@
  • + >
    @@ -257,6 +263,7 @@ export default { display: grid; grid-gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); + grid-template-rows: min-content; flex-grow: 1; padding: 1rem; border-top: solid 1px var(--shadow-hint); @@ -272,10 +279,9 @@ export default { border-top: solid 1px var(--shadow-hint); } -.stash-scenes { - .tiles { - grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); - } +.stash-scenes .tiles { + grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr)); + grid-template-rows: min-content; } @media(max-width: $breakpoint-small) {