2021-03-19 01:36:31 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="stash"
|
|
|
|
class="stash content"
|
|
|
|
>
|
|
|
|
<div class="stash-header">
|
2021-03-20 22:40:05 +00:00
|
|
|
<h2
|
|
|
|
:title="stash.name"
|
|
|
|
class="stash-name"
|
|
|
|
>{{ stash.name }}</h2>
|
2021-03-19 01:36:31 +00:00
|
|
|
|
2021-03-20 01:15:31 +00:00
|
|
|
<span class="header-section">
|
2021-09-11 22:05:45 +00:00
|
|
|
<RouterLink
|
2021-03-20 22:03:13 +00:00
|
|
|
v-if="stash.user"
|
|
|
|
:to="{ name: 'user', params: { username: stash.user.username } }"
|
|
|
|
class="header-item stash-username nolink"
|
2021-09-11 22:05:45 +00:00
|
|
|
><Icon icon="user3" /><span class="username-name">{{ stash.user.username }}</span></RouterLink>
|
2021-03-20 22:03:13 +00:00
|
|
|
|
2021-03-20 01:15:31 +00:00
|
|
|
<label
|
|
|
|
v-if="isMine"
|
|
|
|
v-tooltip="'Public'"
|
|
|
|
:class="{ public: stash.public }"
|
|
|
|
class="header-item stash-public"
|
|
|
|
>
|
|
|
|
<Icon
|
|
|
|
v-show="stash.public"
|
|
|
|
icon="eye"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Icon
|
|
|
|
v-show="!stash.public"
|
|
|
|
icon="eye-blocked"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Toggle
|
|
|
|
:checked="stash.public"
|
|
|
|
class="light"
|
|
|
|
@change="checked => publishStash(checked)"
|
|
|
|
/>
|
|
|
|
</label>
|
|
|
|
|
2021-03-20 22:03:13 +00:00
|
|
|
<Icon
|
2021-03-21 02:23:58 +00:00
|
|
|
v-if="isMine && !stash.primary"
|
2021-03-20 22:03:13 +00:00
|
|
|
icon="bin"
|
|
|
|
class="stash-remove"
|
|
|
|
@click.native="showRemoveStash = true"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<RemoveStash
|
|
|
|
v-if="showRemoveStash"
|
|
|
|
:stash="stash"
|
|
|
|
@close="removeStash"
|
|
|
|
/>
|
2021-03-20 01:15:31 +00:00
|
|
|
</span>
|
2021-03-19 01:36:31 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content-inner">
|
2021-09-11 22:05:45 +00:00
|
|
|
<FilterBar :ranges="['scenes', 'actors', 'movies']" />
|
|
|
|
|
2021-03-19 03:18:56 +00:00
|
|
|
<Releases
|
2021-09-11 22:05:45 +00:00
|
|
|
v-if="$route.params.range === 'scenes' && stash.scenes?.length > 0"
|
2021-03-19 03:18:56 +00:00
|
|
|
:releases="stash.scenes.map(item => item.scene)"
|
2021-09-12 21:21:39 +00:00
|
|
|
:stash="stash"
|
2021-03-19 03:18:56 +00:00
|
|
|
class="stash-section stash-scenes"
|
|
|
|
@stash="fetchStash"
|
|
|
|
/>
|
2021-03-19 01:36:31 +00:00
|
|
|
|
|
|
|
<ul
|
2021-09-11 22:05:45 +00:00
|
|
|
v-if="$route.params.range === 'actors'"
|
2021-03-19 01:36:31 +00:00
|
|
|
class="stash-section stash-actors nolist"
|
|
|
|
>
|
|
|
|
<li
|
|
|
|
v-for="item in stash.actors"
|
|
|
|
:key="item.id"
|
2021-09-12 21:21:39 +00:00
|
|
|
><Actor
|
|
|
|
:actor="item.actor"
|
|
|
|
:stash="stash"
|
|
|
|
@stash="fetchStash"
|
|
|
|
/></li>
|
2021-03-19 01:36:31 +00:00
|
|
|
</ul>
|
2021-09-11 22:05:45 +00:00
|
|
|
|
|
|
|
<div
|
|
|
|
v-if="$route.params.range === 'movies'"
|
|
|
|
class="stash-movies"
|
|
|
|
>
|
|
|
|
<Movie
|
|
|
|
v-for="item in stash.movies"
|
|
|
|
:key="`movie-${item.id}`"
|
|
|
|
:movie="item.movie"
|
2021-09-12 21:21:39 +00:00
|
|
|
:stash="stash"
|
2021-09-11 22:05:45 +00:00
|
|
|
@stash="fetchStash"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<Pagination
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
class="pagination-bottom"
|
|
|
|
/>
|
|
|
|
|
|
|
|
<Footer />
|
2021-03-19 01:36:31 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Actor from '../actors/tile.vue';
|
2021-03-19 03:18:56 +00:00
|
|
|
import Releases from '../releases/releases.vue';
|
2021-09-11 22:05:45 +00:00
|
|
|
import Movie from '../releases/movie-tile.vue';
|
2021-04-04 22:48:03 +00:00
|
|
|
import RemoveStash from './remove.vue';
|
2021-03-20 01:15:31 +00:00
|
|
|
import Toggle from '../form/toggle.vue';
|
2021-09-11 22:05:45 +00:00
|
|
|
import FilterBar from '../filters/filter-bar.vue';
|
|
|
|
import Pagination from '../pagination/pagination.vue';
|
2021-03-19 01:36:31 +00:00
|
|
|
|
|
|
|
async function fetchStash() {
|
2021-09-11 22:05:45 +00:00
|
|
|
this.stash = await this.$store.dispatch('fetchStash', {
|
|
|
|
stashId: this.$route.params.stashId,
|
|
|
|
section: this.$route.params.range,
|
|
|
|
pageNumber: this.$route.params.pageNumber || 1,
|
|
|
|
limit: this.limit,
|
|
|
|
});
|
|
|
|
|
2021-03-20 01:15:31 +00:00
|
|
|
this.isMine = this.stash.user?.id === this.$store.state.auth.user?.id;
|
2021-09-11 22:05:45 +00:00
|
|
|
|
|
|
|
if (this.$route.params.range === 'scenes') {
|
|
|
|
this.totalCount = this.stash.sceneTotal;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.$route.params.range === 'actors') {
|
|
|
|
this.totalCount = this.stash.actorTotal;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (this.$route.params.range === 'movies') {
|
|
|
|
this.totalCount = this.stash.movieTotal;
|
|
|
|
}
|
|
|
|
|
|
|
|
this.pageTitle = this.stash.name;
|
2021-03-20 01:15:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function publishStash(isPublic) {
|
|
|
|
await this.$store.dispatch('updateStash', {
|
|
|
|
stashId: this.stash.id,
|
|
|
|
stash: { public: isPublic },
|
|
|
|
});
|
|
|
|
|
|
|
|
this.fetchStash();
|
2021-03-19 01:36:31 +00:00
|
|
|
}
|
|
|
|
|
2021-03-20 22:03:13 +00:00
|
|
|
async function removeStash(removed) {
|
|
|
|
this.showRemoveStash = false;
|
|
|
|
|
|
|
|
if (removed && this.stash.user) {
|
|
|
|
this.$router.replace({ name: 'user', params: { username: this.stash.user.username } });
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (removed) {
|
|
|
|
this.$router.replace({ name: 'home' });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-19 01:36:31 +00:00
|
|
|
async function mounted() {
|
2021-09-11 22:05:45 +00:00
|
|
|
await this.fetchStash();
|
2021-03-19 01:36:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
Actor,
|
2021-09-11 22:05:45 +00:00
|
|
|
Movie,
|
2021-03-19 03:18:56 +00:00
|
|
|
Releases,
|
2021-03-20 22:03:13 +00:00
|
|
|
RemoveStash,
|
2021-09-11 22:05:45 +00:00
|
|
|
Pagination,
|
|
|
|
FilterBar,
|
2021-03-20 01:15:31 +00:00
|
|
|
Toggle,
|
2021-03-19 01:36:31 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
stash: null,
|
2021-09-11 22:05:45 +00:00
|
|
|
limit: Number(this.$route.query.limit) || 20,
|
|
|
|
pageTitle: null,
|
2021-03-20 22:03:13 +00:00
|
|
|
showRemoveStash: false,
|
2021-03-20 01:15:31 +00:00
|
|
|
isMine: false,
|
2021-09-11 22:05:45 +00:00
|
|
|
totalCount: 0,
|
2021-03-19 01:36:31 +00:00
|
|
|
};
|
|
|
|
},
|
2021-09-11 22:05:45 +00:00
|
|
|
watch: {
|
|
|
|
$route: fetchStash,
|
|
|
|
},
|
2021-03-19 01:36:31 +00:00
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
fetchStash,
|
2021-03-20 01:15:31 +00:00
|
|
|
publishStash,
|
2021-03-20 22:03:13 +00:00
|
|
|
removeStash,
|
2021-03-19 01:36:31 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2021-03-20 22:40:05 +00:00
|
|
|
@import 'breakpoints';
|
|
|
|
|
2021-03-19 01:36:31 +00:00
|
|
|
.stash-header {
|
|
|
|
display: flex;
|
|
|
|
justify-content: space-between;
|
|
|
|
align-items: center;
|
|
|
|
background: var(--profile);
|
|
|
|
color: var(--text-light);
|
2021-03-20 01:15:31 +00:00
|
|
|
|
|
|
|
.icon {
|
|
|
|
fill: var(--text-light);
|
|
|
|
margin: -.1rem .5rem 0 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.header-section,
|
|
|
|
.header-item {
|
2021-03-20 01:29:52 +00:00
|
|
|
height: 100%;
|
2021-03-20 01:15:31 +00:00
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
}
|
|
|
|
|
2021-03-20 22:40:05 +00:00
|
|
|
.stash-name,
|
|
|
|
.stash-username {
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: .5rem 1rem;
|
|
|
|
font-weight: bold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.stash-username {
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
margin: 0 .5rem 0 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.stash-name {
|
|
|
|
overflow: hidden;
|
|
|
|
white-space: nowrap;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
margin: 0;
|
2021-03-20 01:15:31 +00:00
|
|
|
}
|
|
|
|
|
2021-03-20 01:29:52 +00:00
|
|
|
.stash-public {
|
2021-03-20 01:15:31 +00:00
|
|
|
cursor: pointer;
|
2021-03-20 22:40:05 +00:00
|
|
|
margin: 0 .5rem 0 0;
|
2021-03-20 01:29:52 +00:00
|
|
|
|
|
|
|
.icon {
|
|
|
|
margin: 0 .75rem 0 0;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
2021-03-19 01:36:31 +00:00
|
|
|
}
|
|
|
|
|
2021-03-20 22:03:13 +00:00
|
|
|
.stash-remove.icon {
|
|
|
|
height: 100%;
|
|
|
|
padding: 0 1rem;
|
|
|
|
fill: var(--lighten-strong);
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
fill: var(--text-light);
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-19 03:18:56 +00:00
|
|
|
.stash-actors {
|
2021-03-19 01:36:31 +00:00
|
|
|
display: grid;
|
|
|
|
grid-gap: .5rem;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
|
2021-09-12 21:21:39 +00:00
|
|
|
grid-template-rows: min-content;
|
2021-03-19 03:18:56 +00:00
|
|
|
flex-grow: 1;
|
|
|
|
padding: 1rem;
|
2021-09-11 22:05:45 +00:00
|
|
|
border-top: solid 1px var(--shadow-hint);
|
2021-03-19 01:36:31 +00:00
|
|
|
}
|
|
|
|
|
2021-09-11 22:05:45 +00:00
|
|
|
.stash-movies {
|
|
|
|
display: grid;
|
|
|
|
flex-grow: 1;
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(25rem, 1fr));
|
|
|
|
grid-template-rows: min-content;
|
|
|
|
grid-gap: 1rem;
|
|
|
|
padding: 1rem;
|
|
|
|
border-top: solid 1px var(--shadow-hint);
|
|
|
|
}
|
2021-03-19 03:18:56 +00:00
|
|
|
|
2021-09-12 21:21:39 +00:00
|
|
|
.stash-scenes .tiles {
|
|
|
|
grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
|
|
|
|
grid-template-rows: min-content;
|
2021-03-19 01:36:31 +00:00
|
|
|
}
|
2021-03-20 22:40:05 +00:00
|
|
|
|
|
|
|
@media(max-width: $breakpoint-small) {
|
|
|
|
.stash-name {
|
|
|
|
font-size: 1.25rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.username-name {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.stash-username {
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
}
|
2021-03-19 01:36:31 +00:00
|
|
|
</style>
|