forked from DebaucheryLibrarian/traxxx
Added sections and pagination to stash page.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<Details :release="movie" />
|
||||
|
||||
<div class="movie">
|
||||
<router-link
|
||||
<RouterLink
|
||||
:to="{ name: 'movie', params: { releaseId: movie.id, releaseSlug: movie.slug } }"
|
||||
class="cover"
|
||||
>
|
||||
@@ -13,15 +13,29 @@
|
||||
:style="{ 'background-image': getBgPath(movie.covers[0], 'lazy') }"
|
||||
loading="lazy"
|
||||
>
|
||||
</router-link>
|
||||
|
||||
<Icon
|
||||
v-show="favorited"
|
||||
icon="heart7"
|
||||
class="stash stashed"
|
||||
@click.prevent.native="unstashMovie"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-show="favorited === false"
|
||||
icon="heart8"
|
||||
class="stash unstashed"
|
||||
@click.prevent.native="stashMovie"
|
||||
/>
|
||||
</RouterLink>
|
||||
|
||||
<div class="info">
|
||||
<router-link
|
||||
<RouterLink
|
||||
:to="{ name: 'movie', params: { releaseId: movie.id, releaseSlug: movie.slug } }"
|
||||
class="title-link"
|
||||
>
|
||||
<h3 class="title">{{ movie.title }}</h3>
|
||||
</router-link>
|
||||
</RouterLink>
|
||||
|
||||
<ul
|
||||
class="actors nolist"
|
||||
@@ -31,10 +45,10 @@
|
||||
v-for="actor in movie.actors"
|
||||
:key="`tag-${movie.id}-${actor.id}`"
|
||||
class="actor"
|
||||
><router-link
|
||||
><RouterLink
|
||||
:to="`/actor/${actor.id}/${actor.slug}`"
|
||||
class="actor-link"
|
||||
>{{ actor.name }}</router-link></li>
|
||||
>{{ actor.name }}</RouterLink></li>
|
||||
</ul>
|
||||
|
||||
<ul
|
||||
@@ -45,10 +59,10 @@
|
||||
v-for="tag in movie.tags"
|
||||
:key="`tag-${movie.id}-${tag.id}`"
|
||||
class="tag"
|
||||
><router-link
|
||||
><RouterLink
|
||||
:to="`/tag/${tag.slug}`"
|
||||
class="tag-link"
|
||||
>{{ tag.name }}</router-link></li>
|
||||
>{{ tag.name }}</RouterLink></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -58,6 +72,36 @@
|
||||
<script>
|
||||
import Details from './tile-details.vue';
|
||||
|
||||
async function stashMovie() {
|
||||
this.favorited = true;
|
||||
|
||||
try {
|
||||
await this.$store.dispatch('stashMovie', {
|
||||
movieId: this.movie.id,
|
||||
stashId: this.$store.getters.favorites.id,
|
||||
});
|
||||
|
||||
this.$emit('stash', true);
|
||||
} catch (error) {
|
||||
this.favorited = false;
|
||||
}
|
||||
}
|
||||
|
||||
async function unstashMovie() {
|
||||
this.favorited = false;
|
||||
|
||||
try {
|
||||
await this.$store.dispatch('unstashMovie', {
|
||||
movieId: this.movie.id,
|
||||
stashId: this.$store.getters.favorites.id,
|
||||
});
|
||||
|
||||
this.$emit('stash', false);
|
||||
} catch (error) {
|
||||
this.favorited = true;
|
||||
}
|
||||
}
|
||||
|
||||
function sfw() {
|
||||
return this.$store.state.ui.sfw;
|
||||
}
|
||||
@@ -72,9 +116,18 @@ export default {
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
favorited: this.movie.isFavorited,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
sfw,
|
||||
},
|
||||
methods: {
|
||||
stashMovie,
|
||||
unstashMovie,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -87,6 +140,10 @@ export default {
|
||||
background: var(--background);
|
||||
box-shadow: 0 0 3px var(--darken-weak);
|
||||
font-size: 0;
|
||||
|
||||
&:hover .unstashed {
|
||||
fill: var(--lighten);
|
||||
}
|
||||
}
|
||||
|
||||
.movie {
|
||||
@@ -101,6 +158,7 @@ export default {
|
||||
|
||||
.cover {
|
||||
height: 100%;
|
||||
position: relative;
|
||||
box-shadow: 0 0 3px var(--darken-weak);
|
||||
|
||||
img {
|
||||
@@ -179,6 +237,22 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.stash {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
padding: .25rem .5rem .5rem .25rem;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
fill: var(--lighten-weak);
|
||||
filter: drop-shadow(0 0 2px var(--darken));
|
||||
|
||||
&:hover,
|
||||
&.stashed {
|
||||
fill: var(--primary);
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: $breakpoint-kilo) {
|
||||
.movie {
|
||||
height: 12rem;
|
||||
|
||||
Reference in New Issue
Block a user