Removed views in favor of PostGraphile filter and sort plugins. Updated site modules to GraphQL. Added tag posters.

This commit is contained in:
2020-01-04 02:51:58 +01:00
parent 70e27a6cd9
commit 72b175e9e2
46 changed files with 232 additions and 52 deletions

View File

@@ -3,7 +3,7 @@
v-if="actor"
class="content actor"
>
<FilterBar :fetch-releases="fetchReleases" />
<FilterBar :fetch-releases="fetchActor" />
<div class="actor-inner">
<div class="profile">
@@ -243,8 +243,8 @@ import Photos from './photos.vue';
import FilterBar from '../header/filter-bar.vue';
import Releases from '../releases/releases.vue';
async function fetchReleases() {
this.releases = await this.$store.dispatch('fetchActorReleases', this.$route.params.actorSlug);
async function fetchActor() {
this.actor = await this.$store.dispatch('fetchActors', { actorSlug: this.$route.params.actorSlug });
}
function scrollPhotos(event) {
@@ -252,7 +252,7 @@ function scrollPhotos(event) {
}
async function mounted() {
this.actor = await this.$store.dispatch('fetchActors', { actorSlug: this.$route.params.actorSlug });
this.fetchActor();
if (this.actor) {
this.pageTitle = this.actor.name;
@@ -275,7 +275,7 @@ export default {
},
mounted,
methods: {
fetchReleases,
fetchActor,
scrollPhotos,
},
};

View File

@@ -3,7 +3,7 @@
v-if="site"
class="content site"
>
<FilterBar :fetch-releases="fetchReleases" />
<FilterBar :fetch-releases="fetchSite" />
<div class="content-inner">
<div class="header">
@@ -59,15 +59,13 @@
import FilterBar from '../header/filter-bar.vue';
import Releases from '../releases/releases.vue';
async function fetchReleases() {
this.releases = await this.$store.dispatch('fetchSiteReleases', this.$route.params.siteSlug);
async function fetchSite() {
this.site = await this.$store.dispatch('fetchSites', { siteSlug: this.$route.params.siteSlug });
this.releases = this.site.releases;
}
async function mounted() {
[[this.site]] = await Promise.all([
this.$store.dispatch('fetchSites', this.$route.params.siteSlug),
this.fetchReleases(),
]);
await this.fetchSite();
this.pageTitle = this.site.name;
}
@@ -86,7 +84,7 @@ export default {
},
mounted,
methods: {
fetchReleases,
fetchSite,
},
};
</script>

View File

@@ -1,5 +1,15 @@
<template>
<div class="tags">
<h3>Oral Sex</h3>
<div class="tiles">
<Tag
v-for="tag in tags.oral"
:key="`tag-${tag.id}`"
:tag="tag"
/>
</div>
<h3>Ethnicity</h3>
<div class="tiles">
@@ -39,6 +49,16 @@
:tag="tag"
/>
</div>
<h3>Misc</h3>
<div class="tiles">
<Tag
v-for="tag in tags.misc.concat(tags.body)"
:key="`tag-${tag.id}`"
:tag="tag"
/>
</div>
</div>
</template>
@@ -50,40 +70,52 @@ async function mounted() {
slugs: [
'airtight',
'anal',
'anal-creampie',
'asian',
'ass-eating',
'ass-to-mouth',
'blowbang',
'blowjob',
'bukkake',
'caucasian',
'creampie',
'da-tp',
'deepthroat',
'double-anal',
'double-blowjob',
'double-penetration',
'double-vaginal',
'da-tp',
'dv-tp',
'triple-anal',
'blowbang',
'gangbang',
'mff',
'mfm',
'orgy',
'asian',
'caucasian',
'ebony',
'facefuck',
'facial',
'gangbang',
'gapes',
'interracial',
'latina',
'anal-creampie',
'bukkake',
'creampie',
'facial',
'mff',
'mfm',
'oral-creampie',
'orgy',
'pussy-eating',
'swallowing',
'tattoo',
'trainbang',
'triple-anal',
],
});
console.log(tags);
this.tags = tags.reduce((acc, tag) => {
if (!tag.group) {
return { ...acc, misc: [...acc.misc, tag] };
}
if (acc[tag.group.slug]) {
return { ...acc, [tag.group.slug]: [...acc[tag.group.slug], tag] };
}
return { ...acc, [tag.group.slug]: [tag] };
}, {});
}, { misc: [] });
}
export default {

View File

@@ -4,14 +4,14 @@
:title="tag.name"
class="tile"
>
<span class="title">{{ tag.name }}</span>
<img
v-if="tag.poster"
:src="`/img/${tag.poster.thumbnail}`"
:alt="tag.name"
class="poster"
>
<span class="title">{{ tag.name }}</span>
</a>
</template>