2019-06-03 03:31:38 +00:00
|
|
|
<template>
|
2019-10-28 01:54:37 +00:00
|
|
|
<div class="content">
|
2019-11-13 02:14:24 +00:00
|
|
|
<FilterBar
|
|
|
|
:filter="filter"
|
|
|
|
@set-filter="setFilter"
|
|
|
|
/>
|
2019-10-27 23:58:54 +00:00
|
|
|
|
2019-10-28 01:54:37 +00:00
|
|
|
<div class="content-inner">
|
|
|
|
<ul class="scenes nolist">
|
|
|
|
<li
|
|
|
|
v-for="release in releases"
|
|
|
|
:key="release.id"
|
|
|
|
class="scene"
|
|
|
|
>
|
2019-11-09 03:43:58 +00:00
|
|
|
<ReleaseTile :release="release" />
|
2019-10-28 01:54:37 +00:00
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
2019-06-03 03:31:38 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2019-11-13 02:14:24 +00:00
|
|
|
import FilterBar from './filter.vue';
|
2019-11-09 03:43:58 +00:00
|
|
|
import ReleaseTile from '../tile/release.vue';
|
2019-09-10 14:48:04 +00:00
|
|
|
|
2019-11-13 02:14:24 +00:00
|
|
|
async function fetchReleases() {
|
|
|
|
this.releases = await this.$store.dispatch('fetchReleases', {
|
|
|
|
filter: this.filter,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
async function setFilter(filter) {
|
|
|
|
this.filter = filter;
|
|
|
|
localStorage.setItem('filter', this.filter);
|
|
|
|
|
|
|
|
await this.fetchReleases();
|
|
|
|
}
|
2019-11-11 02:20:00 +00:00
|
|
|
|
2019-11-13 02:14:24 +00:00
|
|
|
async function mounted() {
|
2019-11-09 03:43:58 +00:00
|
|
|
this.pageTitle = '';
|
2019-11-13 02:14:24 +00:00
|
|
|
|
|
|
|
await this.fetchReleases();
|
2019-06-03 03:31:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default {
|
2019-11-09 03:43:58 +00:00
|
|
|
components: {
|
2019-11-13 02:14:24 +00:00
|
|
|
FilterBar,
|
2019-11-09 03:43:58 +00:00
|
|
|
ReleaseTile,
|
|
|
|
},
|
2019-06-03 03:31:38 +00:00
|
|
|
data() {
|
2019-11-13 02:14:24 +00:00
|
|
|
const storedFilter = localStorage.getItem('filter');
|
|
|
|
|
2019-06-03 03:31:38 +00:00
|
|
|
return {
|
2019-11-13 02:14:24 +00:00
|
|
|
filter: storedFilter ? storedFilter.split(',') : ['gay', 'transsexual'],
|
2019-06-03 03:31:38 +00:00
|
|
|
releases: [],
|
2019-11-11 02:20:00 +00:00
|
|
|
networks: [],
|
2019-11-09 03:43:58 +00:00
|
|
|
pageTitle: null,
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted,
|
2019-11-13 02:14:24 +00:00
|
|
|
methods: {
|
|
|
|
fetchReleases,
|
|
|
|
setFilter,
|
|
|
|
},
|
2019-06-03 03:31:38 +00:00
|
|
|
};
|
|
|
|
</script>
|