2019-11-11 04:18:28 +00:00
|
|
|
<template>
|
2020-05-18 02:28:38 +00:00
|
|
|
<div
|
|
|
|
v-if="tag"
|
2020-07-05 02:10:35 +00:00
|
|
|
class="tag content"
|
2020-05-18 02:28:38 +00:00
|
|
|
>
|
2020-07-05 02:10:35 +00:00
|
|
|
<div class="header">
|
|
|
|
<h2 class="title">
|
|
|
|
<Icon icon="price-tag4" />
|
|
|
|
{{ tag.name }}
|
|
|
|
</h2>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="content-inner">
|
|
|
|
<div
|
|
|
|
v-if="description"
|
|
|
|
class="description header-description"
|
|
|
|
v-html="description"
|
|
|
|
/>
|
2020-05-18 02:28:38 +00:00
|
|
|
|
2020-07-02 23:28:22 +00:00
|
|
|
<Scroll
|
|
|
|
v-if="hasMedia"
|
2020-12-29 19:02:26 +00:00
|
|
|
v-slot="scroll"
|
2020-07-02 23:28:22 +00:00
|
|
|
:expanded="expanded"
|
|
|
|
class="scroll-light"
|
|
|
|
@expand="(state) => expanded = state"
|
|
|
|
>
|
2020-05-18 02:28:38 +00:00
|
|
|
<Photos
|
|
|
|
:tag="tag"
|
2020-07-02 23:28:22 +00:00
|
|
|
:class="{ expanded }"
|
2020-12-29 19:02:26 +00:00
|
|
|
@load="scroll.loaded"
|
2020-05-18 02:28:38 +00:00
|
|
|
/>
|
2020-07-02 23:28:22 +00:00
|
|
|
</Scroll>
|
2020-05-18 02:28:38 +00:00
|
|
|
|
2020-07-05 02:10:35 +00:00
|
|
|
<FilterBar :fetch-releases="fetchReleases" />
|
2020-09-09 02:22:43 +00:00
|
|
|
<Releases :releases="releases" />
|
|
|
|
|
|
|
|
<Pagination
|
|
|
|
:items-total="totalCount"
|
|
|
|
:items-per-page="limit"
|
|
|
|
class="pagination-bottom"
|
|
|
|
/>
|
2020-08-15 17:04:33 +00:00
|
|
|
|
|
|
|
<Footer />
|
2020-05-18 02:28:38 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-11-11 04:18:28 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-12-04 20:58:08 +00:00
|
|
|
/* eslint-disable no-v-html */
|
|
|
|
import { Converter } from 'showdown';
|
|
|
|
|
|
|
|
import escapeHtml from '../../../src/utils/escape-html';
|
|
|
|
|
2020-07-20 02:20:33 +00:00
|
|
|
import FilterBar from '../filters/filter-bar.vue';
|
2020-01-09 00:59:30 +00:00
|
|
|
import Photos from './photos.vue';
|
2019-11-16 02:33:36 +00:00
|
|
|
import Releases from '../releases/releases.vue';
|
2020-09-09 02:22:43 +00:00
|
|
|
import Pagination from '../pagination/pagination.vue';
|
2020-07-02 23:28:22 +00:00
|
|
|
import Scroll from '../scroll/scroll.vue';
|
2019-11-11 04:18:28 +00:00
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
const converter = new Converter();
|
|
|
|
|
2019-11-15 04:10:59 +00:00
|
|
|
async function fetchReleases() {
|
2020-09-09 02:22:43 +00:00
|
|
|
const { tag, releases, totalCount } = await this.$store.dispatch('fetchTagBySlug', {
|
2020-05-18 02:28:38 +00:00
|
|
|
tagSlug: this.$route.params.tagSlug,
|
2020-09-09 02:22:43 +00:00
|
|
|
pageNumber: Number(this.$route.params.pageNumber),
|
|
|
|
limit: this.limit,
|
2020-05-18 02:28:38 +00:00
|
|
|
range: this.$route.params.range,
|
|
|
|
});
|
2020-01-09 00:59:30 +00:00
|
|
|
|
2020-09-09 02:22:43 +00:00
|
|
|
this.tag = tag;
|
|
|
|
this.releases = releases;
|
|
|
|
this.totalCount = totalCount;
|
|
|
|
|
2020-05-18 02:28:38 +00:00
|
|
|
this.hasMedia = this.tag.poster || this.tag.photos.length > 0;
|
|
|
|
this.description = this.tag.description && converter.makeHtml(escapeHtml(this.tag.description));
|
2019-11-15 04:10:59 +00:00
|
|
|
}
|
|
|
|
|
2020-05-08 23:42:10 +00:00
|
|
|
async function route() {
|
2020-05-18 02:28:38 +00:00
|
|
|
await this.fetchReleases();
|
2020-05-08 23:42:10 +00:00
|
|
|
}
|
|
|
|
|
2019-11-15 04:10:59 +00:00
|
|
|
async function mounted() {
|
2020-05-18 02:28:38 +00:00
|
|
|
await this.fetchReleases();
|
|
|
|
this.pageTitle = this.tag.name;
|
2019-11-11 04:18:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2020-05-18 02:28:38 +00:00
|
|
|
components: {
|
|
|
|
FilterBar,
|
|
|
|
Releases,
|
2020-07-02 23:28:22 +00:00
|
|
|
Photos,
|
2020-09-09 02:22:43 +00:00
|
|
|
Pagination,
|
2020-07-02 23:28:22 +00:00
|
|
|
Scroll,
|
2020-05-18 02:28:38 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tag: null,
|
|
|
|
description: null,
|
|
|
|
releases: null,
|
2020-09-09 02:22:43 +00:00
|
|
|
totalCount: 0,
|
|
|
|
limit: 15,
|
2020-05-18 02:28:38 +00:00
|
|
|
pageTitle: null,
|
|
|
|
hasMedia: false,
|
2020-07-02 23:28:22 +00:00
|
|
|
expanded: false,
|
2020-05-18 02:28:38 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
$route: route,
|
|
|
|
},
|
|
|
|
mounted,
|
|
|
|
methods: {
|
|
|
|
fetchReleases,
|
|
|
|
},
|
2019-11-11 04:18:28 +00:00
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
<style lang="scss">
|
|
|
|
@import 'theme';
|
|
|
|
|
|
|
|
.description a {
|
2020-03-23 00:43:49 +00:00
|
|
|
color: var(--link);
|
2019-12-04 20:58:08 +00:00
|
|
|
text-decoration: inherit;
|
|
|
|
|
|
|
|
&:hover {
|
2020-03-23 00:43:49 +00:00
|
|
|
color: var(--primary);
|
2019-12-04 20:58:08 +00:00
|
|
|
}
|
|
|
|
}
|
2020-05-13 00:56:20 +00:00
|
|
|
|
2020-07-05 02:10:35 +00:00
|
|
|
.description,
|
|
|
|
.description p {
|
2020-05-13 00:56:20 +00:00
|
|
|
padding: 0;
|
|
|
|
margin: 0;
|
|
|
|
}
|
2019-12-04 20:58:08 +00:00
|
|
|
</style>
|
|
|
|
|
2019-11-11 04:18:28 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
2020-01-09 00:59:30 +00:00
|
|
|
.header {
|
2020-03-23 00:43:49 +00:00
|
|
|
background: var(--profile);
|
|
|
|
color: var(--text-light);
|
2020-05-13 00:56:20 +00:00
|
|
|
justify-content: space-between;
|
2019-11-11 04:18:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
2020-08-10 19:39:55 +00:00
|
|
|
padding: .5rem 1rem;
|
2020-01-09 00:59:30 +00:00
|
|
|
margin: 0;
|
|
|
|
flex-shrink: 0;
|
2019-11-11 04:18:28 +00:00
|
|
|
text-transform: capitalize;
|
2019-11-14 04:13:38 +00:00
|
|
|
|
|
|
|
.icon {
|
2020-03-23 00:43:49 +00:00
|
|
|
fill: var(--text-light);
|
2019-11-14 04:13:38 +00:00
|
|
|
width: 1.25rem;
|
|
|
|
height: 1.25rem;
|
|
|
|
}
|
2019-11-11 04:18:28 +00:00
|
|
|
}
|
2019-12-04 20:58:08 +00:00
|
|
|
|
|
|
|
.description {
|
2020-07-05 02:10:35 +00:00
|
|
|
padding: 0 1rem .5rem 1rem;
|
2019-12-04 20:58:08 +00:00
|
|
|
line-height: 1.5;
|
2020-07-05 02:10:35 +00:00
|
|
|
color: var(--text-light);
|
|
|
|
background: var(--profile);
|
2019-12-04 20:58:08 +00:00
|
|
|
}
|
2020-12-29 19:02:26 +00:00
|
|
|
|
|
|
|
.scroll {
|
|
|
|
background: var(--background-dim);
|
|
|
|
}
|
2019-11-11 04:18:28 +00:00
|
|
|
</style>
|