2019-11-11 04:18:28 +00:00
|
|
|
<template>
|
|
|
|
<div
|
|
|
|
v-if="tag"
|
2019-12-04 20:58:08 +00:00
|
|
|
class="content"
|
2019-11-11 04:18:28 +00:00
|
|
|
>
|
2019-11-15 04:10:59 +00:00
|
|
|
<FilterBar :fetch-releases="fetchReleases" />
|
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
<div class="tag">
|
|
|
|
<div class="sidebar">
|
|
|
|
<a
|
|
|
|
v-if="tag.poster"
|
2019-12-09 04:00:49 +00:00
|
|
|
:href="`/img/${tag.poster.path}`"
|
2019-12-04 20:58:08 +00:00
|
|
|
:title="tag.poster.comment"
|
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<img
|
2019-12-06 04:09:08 +00:00
|
|
|
:src="`/img/${tag.poster.thumbnail}`"
|
2019-12-04 20:58:08 +00:00
|
|
|
class="poster"
|
|
|
|
>
|
|
|
|
</a>
|
2019-12-01 04:32:47 +00:00
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
<span>
|
|
|
|
<h2 class="title">
|
|
|
|
<Icon icon="price-tag4" />
|
|
|
|
{{ tag.name }}
|
|
|
|
</h2>
|
2019-11-11 04:18:28 +00:00
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
<p
|
|
|
|
class="description"
|
|
|
|
v-html="description"
|
|
|
|
/>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
<div class="photos">
|
|
|
|
<a
|
|
|
|
v-for="photo in tag.photos"
|
|
|
|
:key="`photo-${photo.id}`"
|
|
|
|
:title="photo.comment"
|
2019-12-11 01:25:25 +00:00
|
|
|
:href="`/img/${photo.path}`"
|
2019-12-04 20:58:08 +00:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
|
|
|
>
|
|
|
|
<img
|
2019-12-11 01:25:25 +00:00
|
|
|
:src="`/img/${photo.thumbnail}`"
|
2019-12-04 20:58:08 +00:00
|
|
|
class="photo"
|
|
|
|
>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-11-11 04:18:28 +00:00
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
<div class="content-inner">
|
|
|
|
<Releases :releases="releases" />
|
|
|
|
</div>
|
2019-11-11 04:18:28 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</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';
|
|
|
|
|
2019-11-15 04:10:59 +00:00
|
|
|
import FilterBar from '../header/filter-bar.vue';
|
2019-11-16 02:33:36 +00:00
|
|
|
import Releases from '../releases/releases.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() {
|
2019-11-11 04:18:28 +00:00
|
|
|
this.releases = await this.$store.dispatch('fetchTagReleases', this.$route.params.tagSlug);
|
2019-11-15 04:10:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
async function mounted() {
|
2019-12-01 04:32:47 +00:00
|
|
|
[this.tag] = await Promise.all([
|
|
|
|
this.$store.dispatch('fetchTags', { tagId: this.$route.params.tagSlug }),
|
2019-11-15 04:10:59 +00:00
|
|
|
this.fetchReleases(),
|
|
|
|
]);
|
2019-11-11 04:18:28 +00:00
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
this.description = converter.makeHtml(escapeHtml(this.tag.description));
|
|
|
|
|
2019-11-11 04:18:28 +00:00
|
|
|
this.pageTitle = this.tag.name;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
|
|
|
components: {
|
2019-11-15 04:10:59 +00:00
|
|
|
FilterBar,
|
2019-11-16 02:33:36 +00:00
|
|
|
Releases,
|
2019-11-11 04:18:28 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
tag: null,
|
|
|
|
releases: null,
|
|
|
|
pageTitle: null,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted,
|
2019-11-15 04:10:59 +00:00
|
|
|
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 {
|
|
|
|
color: $link;
|
|
|
|
text-decoration: inherit;
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
color: $primary;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
2019-11-11 04:18:28 +00:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
@import 'theme';
|
|
|
|
|
2019-12-04 20:58:08 +00:00
|
|
|
.tag {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
flex-grow: 1;
|
|
|
|
justify-content: stretch;
|
|
|
|
}
|
|
|
|
|
|
|
|
.sidebar {
|
|
|
|
background: $profile;
|
|
|
|
color: $text-contrast;
|
|
|
|
width: 25rem;
|
|
|
|
box-sizing: border-box;
|
|
|
|
padding: 1rem;
|
2019-12-01 04:32:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.poster {
|
2019-12-04 20:58:08 +00:00
|
|
|
width: 100%;
|
|
|
|
height: 15rem;
|
2019-12-01 04:32:47 +00:00
|
|
|
object-fit: cover;
|
2019-11-11 04:18:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.title {
|
2019-12-04 20:58:08 +00:00
|
|
|
padding: 0;
|
|
|
|
margin: 1rem 0;
|
2019-11-11 04:18:28 +00:00
|
|
|
text-transform: capitalize;
|
2019-11-14 04:13:38 +00:00
|
|
|
|
|
|
|
.icon {
|
2019-12-04 20:58:08 +00:00
|
|
|
fill: $text-contrast;
|
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 {
|
|
|
|
padding: 0;
|
|
|
|
margin: 0 0 1rem 0;
|
|
|
|
line-height: 1.5;
|
|
|
|
}
|
|
|
|
|
|
|
|
.photo {
|
|
|
|
width: 100%;
|
|
|
|
}
|
2019-11-11 04:18:28 +00:00
|
|
|
</style>
|