Upgraded dependencies, bumped to Node 24.
This commit is contained in:
7
pages/+onHookCall.js
Normal file
7
pages/+onHookCall.js
Normal file
@@ -0,0 +1,7 @@
|
||||
export async function onHookCall(hook, pageContext) {
|
||||
const start = Date.now();
|
||||
|
||||
await hook.call();
|
||||
|
||||
console.log(`TIME ${Date.now() - start}ms ${hook.name}-${pageContext.urlOriginal}`);
|
||||
}
|
||||
@@ -1,3 +1,17 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
defineProps({
|
||||
is404: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { abortReason } = pageContext;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div v-if="is404">
|
||||
@@ -14,20 +28,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
defineProps({
|
||||
is404: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { abortReason } = pageContext;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script setup>
|
||||
import Actors from '#/components/actors/actors.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<Actors />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Actors from '#/components/actors/actors.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
<script setup>
|
||||
import { inject, useId } from 'vue';
|
||||
|
||||
import Bio from '#/components/actors/bio.vue';
|
||||
|
||||
import Gender from '#/components/actors/gender.vue';
|
||||
import Domains from '#/components/domains/domains.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import getPath from '#/src/get-path.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { pageProps, routeParams } = pageContext;
|
||||
const { actor } = pageProps;
|
||||
|
||||
const domain = routeParams.domain;
|
||||
|
||||
const badCredits = ['Pierre Woodman']; // consistently horrible photos
|
||||
const photos = actor.photos.filter((photo) => photo.entropy > 5.5 && !badCredits.includes(photo.credit));
|
||||
const aliasTooltipId = useId();
|
||||
|
||||
console.log(actor);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="actor">
|
||||
<div class="actor-header">
|
||||
@@ -5,6 +30,17 @@
|
||||
<span v-if="actor.entity">{{ actor.name }} ({{ actor.entity.name }})</span>
|
||||
<span v-else>{{ actor.name }}</span>
|
||||
|
||||
<a
|
||||
v-if="actor.alias"
|
||||
v-tooltip="{ content: `Alias for ${actor.alias.name} (#${actor.alias.id})`, ariaId: aliasTooltipId }"
|
||||
:href="`/actor/${actor.alias.id}/${actor.alias.slug}`"
|
||||
>
|
||||
<Icon
|
||||
icon="at-sign"
|
||||
class="header-alias"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<Gender
|
||||
:gender="actor.gender"
|
||||
class="header-gender"
|
||||
@@ -61,28 +97,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import getPath from '#/src/get-path.js';
|
||||
|
||||
import Bio from '#/components/actors/bio.vue';
|
||||
import Gender from '#/components/actors/gender.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import Domains from '#/components/domains/domains.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { pageProps, routeParams } = pageContext;
|
||||
const { actor } = pageProps;
|
||||
|
||||
const domain = routeParams.domain;
|
||||
|
||||
const badCredits = ['Pierre Woodman']; // consistently horrible photos
|
||||
const photos = actor.photos.filter((photo) => photo.entropy > 5.5 && !badCredits.includes(photo.credit));
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.actor {
|
||||
display: flex;
|
||||
@@ -111,6 +125,14 @@ const photos = actor.photos.filter((photo) => photo.entropy > 5.5 && !badCredits
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.header-alias.icon {
|
||||
height: 1.75rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 1rem;
|
||||
fill: var(--primary);
|
||||
}
|
||||
|
||||
.header-social {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { redirect, render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { redirect, render } from 'vike/abort';
|
||||
|
||||
import { fetchActorsById } from '#/src/actors.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { getCampaignIndex, getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { fetchCountries } from '#/src/countries.js';
|
||||
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
|
||||
async function fetchReleases(pageContext) {
|
||||
if (pageContext.routeParams.domain === 'movies') {
|
||||
@@ -47,10 +47,6 @@ export async function onBeforeRender(pageContext) {
|
||||
throw render(404, `Cannot find actor '${pageContext.routeParams.actorId}'.`);
|
||||
}
|
||||
|
||||
if (actor.alias && !Object.hasOwn(pageContext.urlParsed.search, 'inspect')) {
|
||||
throw redirect(`/actor/${actor.alias.id}/${actor.alias.slug}`);
|
||||
}
|
||||
|
||||
const [actorReleases, campaigns, countries] = await Promise.all([
|
||||
fetchReleases(pageContext),
|
||||
getRandomCampaigns([
|
||||
@@ -63,6 +59,10 @@ export async function onBeforeRender(pageContext) {
|
||||
isEditing && fetchCountries(),
|
||||
]);
|
||||
|
||||
if (actor.alias && actorReleases.length === 0 && !Object.hasOwn(pageContext.urlParsed.search, 'inspect')) {
|
||||
throw redirect(`/actor/${actor.alias.id}/${actor.alias.slug}`);
|
||||
}
|
||||
|
||||
const campaignIndex = getCampaignIndex(actorReleases.limit);
|
||||
const [paginationCampaign, sceneCampaign] = campaigns;
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const actor = pageContext.pageProps.actor;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="content">
|
||||
<div class="revs-header">
|
||||
@@ -21,15 +30,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const actor = pageContext.pageProps.actor;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 1rem;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { fetchActorsById, fetchActorRevisions } from '#/src/actors.js';
|
||||
import { fetchActorRevisions, fetchActorsById } from '#/src/actors.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const [actor] = await fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user);
|
||||
|
||||
@@ -1,388 +1,17 @@
|
||||
<template>
|
||||
<div class="editor">
|
||||
<p
|
||||
v-if="submitted"
|
||||
class="submitted"
|
||||
>
|
||||
<template v-if="apply">Your revision has been submitted. Thank you for your contribution!</template>
|
||||
<template v-else>Your revision has been submitted for review. Thank you for your contribution!</template>
|
||||
|
||||
<ul v-if="actor">
|
||||
<li>
|
||||
<a
|
||||
:href="`/actor/${actor.id}/${actor.slug}`"
|
||||
class="link"
|
||||
>{{ creating ? 'Go' : 'Return' }} to actor</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/actor/edit/${actor.id}`"
|
||||
class="link"
|
||||
>Make another edit</a>
|
||||
</li>
|
||||
|
||||
<li v-if="!creating">
|
||||
<a
|
||||
:href="`/actor/revs/${actor.id}/${actor.slug}`"
|
||||
class="link"
|
||||
>Go to actor revisions</a>
|
||||
</li>
|
||||
|
||||
<li v-if="!creating">
|
||||
<a
|
||||
:href="`/user/${user.username}/revisions/actors`"
|
||||
class="link"
|
||||
>Go to user revisions</a>
|
||||
</li>
|
||||
|
||||
<li v-if="user.role !== 'user' && !creating">
|
||||
<a
|
||||
href="/admin/revisions/actors"
|
||||
class="link"
|
||||
>Go to revisions admin</a>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<form
|
||||
v-else
|
||||
@submit.prevent
|
||||
>
|
||||
<div
|
||||
v-if="actor"
|
||||
class="editor-header"
|
||||
>
|
||||
<h2 class="heading ellipsis">Edit actor #{{ actor.id }} - {{ actor.name }}</h2>
|
||||
|
||||
<span class="header-actions">
|
||||
<span
|
||||
v-if="verifyAbility(user, 'actor', 'merge')"
|
||||
target="_blank"
|
||||
class="link noshrink"
|
||||
@click="showMergeDialog = true"
|
||||
>Merge</span>
|
||||
|
||||
<Merge
|
||||
v-if="showMergeDialog"
|
||||
:actors="[actor]"
|
||||
@close="showMergeDialog = false"
|
||||
/>
|
||||
|
||||
<a
|
||||
:href="`/actor/${actor.id}/${actor.slug}`"
|
||||
target="_blank"
|
||||
class="link noshrink"
|
||||
>Go to actor</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else
|
||||
class="editor-header"
|
||||
>
|
||||
<h2 class="heading ellipsis">Add actor</h2>
|
||||
</div>
|
||||
|
||||
<ul class="nolist">
|
||||
<li
|
||||
v-for="item in fields"
|
||||
:key="`item-${item.key}`"
|
||||
class="row"
|
||||
>
|
||||
<div class="item-header">
|
||||
<div class="key">
|
||||
{{ item.label || item.key }}
|
||||
|
||||
<Icon
|
||||
v-if="item.note"
|
||||
v-tooltip="item.note"
|
||||
icon="info2"
|
||||
class="item-note"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="item-actions noselect">
|
||||
<Icon
|
||||
v-if="!item.forced"
|
||||
icon="pencil5"
|
||||
:class="{ active: editing.has(item.key) }"
|
||||
@click="toggleField(item)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="value"
|
||||
:class="{ disabled: !editing.has(item.key) }"
|
||||
>
|
||||
<input
|
||||
v-if="item.type === 'string'"
|
||||
v-model="edits[item.key]"
|
||||
class="string input"
|
||||
:list="item.suggestions && `suggestions-${item.key}`"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<datalist
|
||||
v-if="item.suggestions"
|
||||
:id="`suggestions-${item.key}`"
|
||||
>
|
||||
<option
|
||||
v-for="(suggestion, index) in item.suggestions"
|
||||
:key="`suggestion-${item.key}-${index}`"
|
||||
>{{ suggestion }}</option>
|
||||
</datalist>
|
||||
|
||||
<textarea
|
||||
v-if="item.type === 'text'"
|
||||
v-model="edits[item.key]"
|
||||
:placeholder="item.placeholder"
|
||||
rows="3"
|
||||
class="text input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
/>
|
||||
|
||||
<template v-if="item.type === 'number'">
|
||||
<input
|
||||
v-model="edits[item.key]"
|
||||
type="number"
|
||||
:max="item.max"
|
||||
:min="item.min"
|
||||
class="number input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>{{ item.unit }}
|
||||
</template>
|
||||
|
||||
<input
|
||||
v-if="item.type === 'date'"
|
||||
v-model="edits[item.key]"
|
||||
type="date"
|
||||
class="date input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<select
|
||||
v-if="item.type === 'select'"
|
||||
v-model="edits[item.key]"
|
||||
class="select input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option
|
||||
v-for="option in item.options"
|
||||
:key="`${item.key}-option-${option}`"
|
||||
:value="typeof option?.value === 'undefined' ? option : option.value"
|
||||
>{{ option?.label || option }}</option>
|
||||
</select>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'size'"
|
||||
class="figure size"
|
||||
>
|
||||
<div class="value-section">
|
||||
<span class="value-label">Units</span>
|
||||
|
||||
<select
|
||||
v-model="sizeUnits"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option value="metric">Metric</option>
|
||||
<option value="imperial">Imperial</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<span class="figure-height">
|
||||
<div class="value-section">
|
||||
<span class="value-label">Height</span>
|
||||
|
||||
<span v-if="sizeUnits === 'metric'">
|
||||
<input
|
||||
v-model="edits[item.key].metricHeight"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> cm
|
||||
</span>
|
||||
|
||||
<span v-if="sizeUnits === 'imperial'">
|
||||
<input
|
||||
v-model="edits[item.key].imperialHeight[0]"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> ft
|
||||
|
||||
<input
|
||||
v-model="edits[item.key].imperialHeight[1]"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> in
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span class="figure-weight">
|
||||
<div class="value-section">
|
||||
<span class="value-label">Weight</span>
|
||||
|
||||
<span v-if="sizeUnits === 'metric'">
|
||||
<input
|
||||
v-model="edits[item.key].metricWeight"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> kg
|
||||
</span>
|
||||
|
||||
<span v-if="sizeUnits === 'imperial'">
|
||||
<input
|
||||
v-model="edits[item.key].imperialWeight"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<template v-if="sizeUnits === 'imperial'"> lbs</template>
|
||||
<template v-else> kg</template>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<EditSocials
|
||||
v-if="item.type === 'socials'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@socials="(socials) => edits.socials = socials"
|
||||
/>
|
||||
|
||||
<EditPlace
|
||||
v-if="item.type === 'place'"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@place="(place) => edits[item.key] = place"
|
||||
/>
|
||||
|
||||
<EditFigure
|
||||
v-if="item.type === 'figure'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
:units="figureUnits"
|
||||
@figure="(figure) => edits.figure = figure"
|
||||
@units="(units) => figureUnits = units"
|
||||
/>
|
||||
|
||||
<EditAugmentation
|
||||
v-if="item.type === 'augmentation'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@augmentation="(augmentation) => edits.augmentation = augmentation"
|
||||
/>
|
||||
|
||||
<EditPenis
|
||||
v-if="item.type === 'penis'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
:units="penisUnits"
|
||||
@penis="(penis) => edits.penis = penis"
|
||||
@units="(units) => penisUnits = units"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'has'"
|
||||
class="has"
|
||||
>
|
||||
<select
|
||||
v-model="edits[item.key].has"
|
||||
class="select input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option :value="null" />
|
||||
<option :value="true">Yes</option>
|
||||
<option :value="false">No</option>
|
||||
</select>
|
||||
|
||||
<input
|
||||
v-if="item.hasDescription !== false"
|
||||
v-model="edits[item.key].description"
|
||||
class="description input"
|
||||
placeholder="Description"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'avatar'"
|
||||
class="avatars"
|
||||
:class="{ disabled: !editing.has(item.key) }"
|
||||
>
|
||||
<Avatar
|
||||
v-for="avatar in item.options"
|
||||
:key="`avatar-${avatar.id}`"
|
||||
:avatar="avatar"
|
||||
:class="{ selected: edits[item.key] === avatar.id }"
|
||||
@click="setAvatar(avatar.id)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="editor-footer">
|
||||
<div class="comment">
|
||||
<textarea
|
||||
v-model="comment"
|
||||
rows="3"
|
||||
placeholder="Please provide verifiable information and sources supporting your edits."
|
||||
class="text input noshrink"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="editor-actions">
|
||||
<Checkbox
|
||||
v-if="user.role !== 'user' && actor"
|
||||
label="Approve and apply immediately"
|
||||
:checked="apply"
|
||||
:disabled="editing.size === 0"
|
||||
@change="(checked) => apply = checked"
|
||||
/>
|
||||
|
||||
<Ellipsis v-if="submitting" />
|
||||
|
||||
<!-- we don't want the return key to submit the form -->
|
||||
<button
|
||||
v-else
|
||||
class="button button-primary"
|
||||
type="button"
|
||||
:disabled="editing.size === 0"
|
||||
@click="submit"
|
||||
>
|
||||
<template v-if="apply">Submit</template>
|
||||
<template v-else>Submit for review</template>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, inject } from 'vue';
|
||||
import { format } from 'date-fns';
|
||||
import omit from 'object.omit';
|
||||
import { computed, inject, ref } from 'vue';
|
||||
|
||||
import EditSocials from '#/components/edit/socials.vue';
|
||||
import EditPlace from '#/components/edit/place.vue';
|
||||
import EditFigure from '#/components/edit/figure.vue';
|
||||
import Merge from '#/components/actors/merge.vue';
|
||||
import EditAugmentation from '#/components/edit/augmentation.vue';
|
||||
import EditPenis from '#/components/edit/penis.vue';
|
||||
import Avatar from '#/components/edit/avatar.vue';
|
||||
import EditFigure from '#/components/edit/figure.vue';
|
||||
import EditPenis from '#/components/edit/penis.vue';
|
||||
import EditPlace from '#/components/edit/place.vue';
|
||||
import EditSocials from '#/components/edit/socials.vue';
|
||||
import Checkbox from '#/components/form/checkbox.vue';
|
||||
import Ellipsis from '#/components/loading/ellipsis.vue';
|
||||
import Merge from '#/components/actors/merge.vue';
|
||||
|
||||
import {
|
||||
// get,
|
||||
@@ -397,18 +26,20 @@ const user = pageContext.user;
|
||||
const actor = ref(pageContext.pageProps.actor || null);
|
||||
|
||||
const fields = computed(() => [
|
||||
...(actor.value?.photos.length > 0 ? [{
|
||||
key: 'avatar',
|
||||
type: 'avatar',
|
||||
value: actor.value.avatar?.id,
|
||||
options: actor.value.photos,
|
||||
}] : []),
|
||||
...(actor.value?.photos.length > 0
|
||||
? [{
|
||||
key: 'avatar',
|
||||
type: 'avatar',
|
||||
value: actor.value.avatar?.id,
|
||||
options: actor.value.photos,
|
||||
}]
|
||||
: []),
|
||||
...(user.role === 'admin'
|
||||
? [{
|
||||
key: 'name',
|
||||
type: 'string',
|
||||
value: actor.value?.name,
|
||||
}]
|
||||
key: 'name',
|
||||
type: 'string',
|
||||
value: actor.value?.name,
|
||||
}]
|
||||
: []),
|
||||
{
|
||||
key: 'gender',
|
||||
@@ -707,12 +338,384 @@ async function submit() {
|
||||
submitted.value = true;
|
||||
|
||||
// actor.value = await get(`/actors/${actor.value.id}`);
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="editor">
|
||||
<p
|
||||
v-if="submitted"
|
||||
class="submitted"
|
||||
>
|
||||
<template v-if="apply">Your revision has been submitted. Thank you for your contribution!</template>
|
||||
<template v-else>Your revision has been submitted for review. Thank you for your contribution!</template>
|
||||
|
||||
<ul v-if="actor">
|
||||
<li>
|
||||
<a
|
||||
:href="`/actor/${actor.id}/${actor.slug}`"
|
||||
class="link"
|
||||
>{{ creating ? 'Go' : 'Return' }} to actor</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/actor/edit/${actor.id}`"
|
||||
class="link"
|
||||
>Make another edit</a>
|
||||
</li>
|
||||
|
||||
<li v-if="!creating">
|
||||
<a
|
||||
:href="`/actor/revs/${actor.id}/${actor.slug}`"
|
||||
class="link"
|
||||
>Go to actor revisions</a>
|
||||
</li>
|
||||
|
||||
<li v-if="!creating">
|
||||
<a
|
||||
:href="`/user/${user.username}/revisions/actors`"
|
||||
class="link"
|
||||
>Go to user revisions</a>
|
||||
</li>
|
||||
|
||||
<li v-if="user.role !== 'user' && !creating">
|
||||
<a
|
||||
href="/admin/revisions/actors"
|
||||
class="link"
|
||||
>Go to revisions admin</a>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<form
|
||||
v-else
|
||||
@submit.prevent
|
||||
>
|
||||
<div
|
||||
v-if="actor"
|
||||
class="editor-header"
|
||||
>
|
||||
<h2 class="heading ellipsis">Edit actor #{{ actor.id }} - {{ actor.name }}</h2>
|
||||
|
||||
<span class="header-actions">
|
||||
<span
|
||||
v-if="verifyAbility(user, 'actor', 'merge')"
|
||||
target="_blank"
|
||||
class="link noshrink"
|
||||
@click="showMergeDialog = true"
|
||||
>Merge</span>
|
||||
|
||||
<Merge
|
||||
v-if="showMergeDialog"
|
||||
:actors="[actor]"
|
||||
@close="showMergeDialog = false"
|
||||
/>
|
||||
|
||||
<a
|
||||
:href="`/actor/${actor.id}/${actor.slug}`"
|
||||
target="_blank"
|
||||
class="link noshrink"
|
||||
>Go to actor</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-else
|
||||
class="editor-header"
|
||||
>
|
||||
<h2 class="heading ellipsis">Add actor</h2>
|
||||
</div>
|
||||
|
||||
<ul class="nolist">
|
||||
<li
|
||||
v-for="item in fields"
|
||||
:key="`item-${item.key}`"
|
||||
class="row"
|
||||
>
|
||||
<div class="item-header">
|
||||
<div class="key">
|
||||
{{ item.label || item.key }}
|
||||
|
||||
<Icon
|
||||
v-if="item.note"
|
||||
v-tooltip="{ content: item.note, ariaId: `field-note-${item.key}` }"
|
||||
icon="info2"
|
||||
class="item-note"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="item-actions noselect">
|
||||
<Icon
|
||||
v-if="!item.forced"
|
||||
icon="pencil5"
|
||||
:class="{ active: editing.has(item.key) }"
|
||||
@click="toggleField(item)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="value"
|
||||
:class="{ disabled: !editing.has(item.key) }"
|
||||
>
|
||||
<input
|
||||
v-if="item.type === 'string'"
|
||||
v-model="edits[item.key]"
|
||||
class="string input"
|
||||
:list="item.suggestions && `suggestions-${item.key}`"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<datalist
|
||||
v-if="item.suggestions"
|
||||
:id="`suggestions-${item.key}`"
|
||||
>
|
||||
<option
|
||||
v-for="(suggestion, index) in item.suggestions"
|
||||
:key="`suggestion-${item.key}-${index}`"
|
||||
>{{ suggestion }}</option>
|
||||
</datalist>
|
||||
|
||||
<textarea
|
||||
v-if="item.type === 'text'"
|
||||
v-model="edits[item.key]"
|
||||
:placeholder="item.placeholder"
|
||||
rows="3"
|
||||
class="text input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
/>
|
||||
|
||||
<template v-if="item.type === 'number'">
|
||||
<input
|
||||
v-model="edits[item.key]"
|
||||
type="number"
|
||||
:max="item.max"
|
||||
:min="item.min"
|
||||
class="number input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>{{ item.unit }}
|
||||
</template>
|
||||
|
||||
<input
|
||||
v-if="item.type === 'date'"
|
||||
v-model="edits[item.key]"
|
||||
type="date"
|
||||
class="date input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<select
|
||||
v-if="item.type === 'select'"
|
||||
v-model="edits[item.key]"
|
||||
class="select input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option
|
||||
v-for="option in item.options"
|
||||
:key="`${item.key}-option-${option}`"
|
||||
:value="typeof option?.value === 'undefined' ? option : option.value"
|
||||
>{{ option?.label || option }}</option>
|
||||
</select>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'size'"
|
||||
class="figure size"
|
||||
>
|
||||
<div class="value-section">
|
||||
<span class="value-label">Units</span>
|
||||
|
||||
<select
|
||||
v-model="sizeUnits"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option value="metric">Metric</option>
|
||||
<option value="imperial">Imperial</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<span class="figure-height">
|
||||
<div class="value-section">
|
||||
<span class="value-label">Height</span>
|
||||
|
||||
<span v-if="sizeUnits === 'metric'">
|
||||
<input
|
||||
v-model="edits[item.key].metricHeight"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> cm
|
||||
</span>
|
||||
|
||||
<span v-if="sizeUnits === 'imperial'">
|
||||
<input
|
||||
v-model="edits[item.key].imperialHeight[0]"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> ft
|
||||
|
||||
<input
|
||||
v-model="edits[item.key].imperialHeight[1]"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> in
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<span class="figure-weight">
|
||||
<div class="value-section">
|
||||
<span class="value-label">Weight</span>
|
||||
|
||||
<span v-if="sizeUnits === 'metric'">
|
||||
<input
|
||||
v-model="edits[item.key].metricWeight"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
> kg
|
||||
</span>
|
||||
|
||||
<span v-if="sizeUnits === 'imperial'">
|
||||
<input
|
||||
v-model="edits[item.key].imperialWeight"
|
||||
type="number"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<template v-if="sizeUnits === 'imperial'"> lbs</template>
|
||||
<template v-else> kg</template>
|
||||
</span>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<EditSocials
|
||||
v-if="item.type === 'socials'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@socials="(socials) => edits.socials = socials"
|
||||
/>
|
||||
|
||||
<EditPlace
|
||||
v-if="item.type === 'place'"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@place="(place) => edits[item.key] = place"
|
||||
/>
|
||||
|
||||
<EditFigure
|
||||
v-if="item.type === 'figure'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
:units="figureUnits"
|
||||
@figure="(figure) => edits.figure = figure"
|
||||
@units="(units) => figureUnits = units"
|
||||
/>
|
||||
|
||||
<EditAugmentation
|
||||
v-if="item.type === 'augmentation'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@augmentation="(augmentation) => edits.augmentation = augmentation"
|
||||
/>
|
||||
|
||||
<EditPenis
|
||||
v-if="item.type === 'penis'"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
:units="penisUnits"
|
||||
@penis="(penis) => edits.penis = penis"
|
||||
@units="(units) => penisUnits = units"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'has'"
|
||||
class="has"
|
||||
>
|
||||
<select
|
||||
v-model="edits[item.key].has"
|
||||
class="select input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option :value="null" />
|
||||
<option :value="true">Yes</option>
|
||||
<option :value="false">No</option>
|
||||
</select>
|
||||
|
||||
<input
|
||||
v-if="item.hasDescription !== false"
|
||||
v-model="edits[item.key].description"
|
||||
class="description input"
|
||||
placeholder="Description"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'avatar'"
|
||||
class="avatars"
|
||||
:class="{ disabled: !editing.has(item.key) }"
|
||||
>
|
||||
<Avatar
|
||||
v-for="avatar in item.options"
|
||||
:key="`avatar-${avatar.id}`"
|
||||
:avatar="avatar"
|
||||
:class="{ selected: edits[item.key] === avatar.id }"
|
||||
@click="setAvatar(avatar.id)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="editor-footer">
|
||||
<div class="comment">
|
||||
<textarea
|
||||
v-model="comment"
|
||||
rows="3"
|
||||
placeholder="Please provide verifiable information and sources supporting your edits."
|
||||
class="text input noshrink"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="editor-actions">
|
||||
<Checkbox
|
||||
v-if="user.role !== 'user' && actor"
|
||||
label="Approve and apply immediately"
|
||||
:checked="apply"
|
||||
:disabled="editing.size === 0"
|
||||
@change="(checked) => apply = checked"
|
||||
/>
|
||||
|
||||
<Ellipsis v-if="submitting" />
|
||||
|
||||
<!-- we don't want the return key to submit the form -->
|
||||
<button
|
||||
v-else
|
||||
class="button button-primary"
|
||||
type="button"
|
||||
:disabled="editing.size === 0"
|
||||
@click="submit"
|
||||
>
|
||||
<template v-if="apply">Submit</template>
|
||||
<template v-else>Submit for review</template>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
.editor {
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { redirect } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { redirect } from 'vike/abort';
|
||||
|
||||
import { fetchActorsById } from '#/src/actors.js';
|
||||
import { fetchCountries } from '#/src/countries.js';
|
||||
|
||||
@@ -10,9 +10,11 @@ export default (pageContext) => {
|
||||
|
||||
if (matched) {
|
||||
return {
|
||||
routeParams: matched.params.actorId ? {
|
||||
actorId: matched.params.actorId,
|
||||
} : {},
|
||||
routeParams: matched.params.actorId
|
||||
? {
|
||||
actorId: matched.params.actorId,
|
||||
}
|
||||
: {},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
<script setup>
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Admin>
|
||||
<h2 class="heading">Admin Panel</h2>
|
||||
@@ -34,10 +38,6 @@
|
||||
</Admin>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.menu {
|
||||
margin: 0;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
export function onBeforeRender(pageContext) {
|
||||
if (pageContext.user.role === 'user') {
|
||||
|
||||
@@ -1,3 +1,75 @@
|
||||
<script setup>
|
||||
import { inject, onMounted, ref } from 'vue';
|
||||
|
||||
import AddActor from '#/components/actors/add.vue';
|
||||
import MergeActors from '#/components/actors/merge.vue';
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
import Checkbox from '#/components/form/checkbox.vue';
|
||||
|
||||
import getPath from '#/src/get-path.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
// import { get } from '#/src/api.js';
|
||||
|
||||
const { pageProps, urlParsed } = inject('pageContext');
|
||||
|
||||
const actors = ref(pageProps.actors);
|
||||
const selectedActors = ref(new Set([]));
|
||||
const activeActor = ref(null);
|
||||
const actorQuery = ref(urlParsed.search.q || null);
|
||||
const showAliased = ref(Object.hasOwn(urlParsed.search, 'alias'));
|
||||
|
||||
const lastSelectedIndex = ref(null);
|
||||
const holdingShift = ref(false);
|
||||
const showMergeDialog = ref(false);
|
||||
const showAddDialog = ref(false);
|
||||
|
||||
function selectActors(selectedActor, isChecked, index) {
|
||||
const [start, end] = holdingShift.value
|
||||
? [index, lastSelectedIndex.value].toSorted((indexA, indexB) => indexA - indexB)
|
||||
: [index, index];
|
||||
|
||||
const actorIds = actors.value
|
||||
.slice(start, end + 1)
|
||||
.map((actor) => actor.id);
|
||||
|
||||
actorIds.forEach((actorId) => {
|
||||
if (isChecked) {
|
||||
selectedActors.value.add(actorId);
|
||||
}
|
||||
else {
|
||||
selectedActors.value.delete(actorId);
|
||||
}
|
||||
});
|
||||
|
||||
lastSelectedIndex.value = index;
|
||||
}
|
||||
|
||||
async function searchActors() {
|
||||
navigate('/admin/actors', {
|
||||
q: actorQuery.value || undefined,
|
||||
alias: showAliased.value || undefined,
|
||||
}, { redirect: true });
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Shift') {
|
||||
holdingShift.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('keyup', (event) => {
|
||||
if (event.key === 'Shift') {
|
||||
holdingShift.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('blur', () => {
|
||||
holdingShift.value = false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Admin class="page">
|
||||
<div class="header">
|
||||
@@ -73,7 +145,7 @@
|
||||
</td>
|
||||
|
||||
<td
|
||||
v-tooltip="actor.alias ? `#${actor.alias.id} ${actor.alias.name}` : (actor.entity?.name || 'Global')"
|
||||
v-tooltip="{ content: actor.alias ? `#${actor.alias.id} ${actor.alias.name}` : (actor.entity?.name || 'Global'), ariaId: `actor-entity-${actor.id}` }"
|
||||
class="actor-entity ellipsis"
|
||||
>
|
||||
<Icon
|
||||
@@ -125,14 +197,14 @@
|
||||
target="_blank"
|
||||
>
|
||||
<Icon
|
||||
v-tooltip="'Edit bio'"
|
||||
v-tooltip="{ content: 'Edit bio', ariaId: `actor-edit-${actor.id}` }"
|
||||
icon="pencil5"
|
||||
class="actor-action action-merge"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<Icon
|
||||
v-tooltip="'Merge'"
|
||||
v-tooltip="{ content: 'Merge', ariaId: `actor-merge-${actor.id}` }"
|
||||
icon="make-group"
|
||||
class="actor-action action-merge"
|
||||
@click="activeActor = actor; showMergeDialog = true;"
|
||||
@@ -164,77 +236,6 @@
|
||||
</Admin>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject, onMounted } from 'vue';
|
||||
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
import Checkbox from '#/components/form/checkbox.vue';
|
||||
import MergeActors from '#/components/actors/merge.vue';
|
||||
import AddActor from '#/components/actors/add.vue';
|
||||
|
||||
import getPath from '#/src/get-path.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
// import { get } from '#/src/api.js';
|
||||
|
||||
const { pageProps, urlParsed } = inject('pageContext');
|
||||
|
||||
const actors = ref(pageProps.actors);
|
||||
const selectedActors = ref(new Set([]));
|
||||
const activeActor = ref(null);
|
||||
const actorQuery = ref(urlParsed.search.q || null);
|
||||
const showAliased = ref(Object.hasOwn(urlParsed.search, 'alias'));
|
||||
|
||||
const lastSelectedIndex = ref(null);
|
||||
const holdingShift = ref(false);
|
||||
const showMergeDialog = ref(false);
|
||||
const showAddDialog = ref(false);
|
||||
|
||||
function selectActors(selectedActor, isChecked, index) {
|
||||
const [start, end] = holdingShift.value
|
||||
? [index, lastSelectedIndex.value].toSorted((indexA, indexB) => indexA - indexB)
|
||||
: [index, index];
|
||||
|
||||
const actorIds = actors.value
|
||||
.slice(start, end + 1)
|
||||
.map((actor) => actor.id);
|
||||
|
||||
actorIds.forEach((actorId) => {
|
||||
if (isChecked) {
|
||||
selectedActors.value.add(actorId);
|
||||
} else {
|
||||
selectedActors.value.delete(actorId);
|
||||
}
|
||||
});
|
||||
|
||||
lastSelectedIndex.value = index;
|
||||
}
|
||||
|
||||
async function searchActors() {
|
||||
navigate('/admin/actors', {
|
||||
q: actorQuery.value || undefined,
|
||||
alias: showAliased.value || undefined,
|
||||
}, { redirect: true });
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
window.addEventListener('keydown', (event) => {
|
||||
if (event.key === 'Shift') {
|
||||
holdingShift.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('keyup', (event) => {
|
||||
if (event.key === 'Shift') {
|
||||
holdingShift.value = false;
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('blur', () => {
|
||||
holdingShift.value = false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search {
|
||||
display: flex;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchActors } from '#/src/actors.js';
|
||||
import { curateActorsQuery } from '#/src/web/actors.js';
|
||||
|
||||
@@ -1,3 +1,56 @@
|
||||
<script setup>
|
||||
import { format, subMonths, subWeeks } from 'date-fns';
|
||||
|
||||
import {
|
||||
computed,
|
||||
inject,
|
||||
ref,
|
||||
watch,
|
||||
} from 'vue';
|
||||
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const {
|
||||
pageProps,
|
||||
urlParsed,
|
||||
meta,
|
||||
} = inject('pageContext');
|
||||
|
||||
const { entities } = pageProps;
|
||||
|
||||
const alertThreshold = ref(Number(urlParsed.search.alert) || 12);
|
||||
const deadThreshold = ref(Number(urlParsed.search.dead) || 36);
|
||||
const order = urlParsed.search.order || 'desc';
|
||||
|
||||
const alertDate = computed(() => subWeeks(meta.now, alertThreshold.value));
|
||||
const deadDate = computed(() => subMonths(meta.now, deadThreshold.value));
|
||||
|
||||
const alertEntities = computed(() => entities.filter((entity) => entity.latestReleaseDate > deadDate.value && entity.latestReleaseDate < alertDate.value));
|
||||
|
||||
function sort(sorting) {
|
||||
navigate('/admin/entities', {
|
||||
sort: sorting,
|
||||
order: order === 'desc' ? 'asc' : 'desc',
|
||||
alert: alertThreshold.value,
|
||||
dead: deadThreshold.value,
|
||||
}, {
|
||||
redirect: true,
|
||||
});
|
||||
}
|
||||
|
||||
watch([alertThreshold, deadThreshold], () => {
|
||||
navigate('/admin/entities', {
|
||||
...urlParsed.search,
|
||||
alert: alertThreshold.value,
|
||||
dead: deadThreshold.value,
|
||||
}, {
|
||||
redirect: false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Admin class="page">
|
||||
<div class="header">
|
||||
@@ -84,59 +137,6 @@
|
||||
</Admin>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {
|
||||
ref,
|
||||
computed,
|
||||
watch,
|
||||
inject,
|
||||
} from 'vue';
|
||||
|
||||
import { format, subMonths, subWeeks } from 'date-fns';
|
||||
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
|
||||
const {
|
||||
pageProps,
|
||||
urlParsed,
|
||||
meta,
|
||||
} = inject('pageContext');
|
||||
|
||||
const { entities } = pageProps;
|
||||
|
||||
const alertThreshold = ref(Number(urlParsed.search.alert) || 12);
|
||||
const deadThreshold = ref(Number(urlParsed.search.dead) || 36);
|
||||
const order = urlParsed.search.order || 'desc';
|
||||
|
||||
const alertDate = computed(() => subWeeks(meta.now, alertThreshold.value));
|
||||
const deadDate = computed(() => subMonths(meta.now, deadThreshold.value));
|
||||
|
||||
const alertEntities = computed(() => entities.filter((entity) => entity.latestReleaseDate > deadDate.value && entity.latestReleaseDate < alertDate.value));
|
||||
|
||||
function sort(sorting) {
|
||||
navigate('/admin/entities', {
|
||||
sort: sorting,
|
||||
order: order === 'desc' ? 'asc' : 'desc',
|
||||
alert: alertThreshold.value,
|
||||
dead: deadThreshold.value,
|
||||
}, {
|
||||
redirect: true,
|
||||
});
|
||||
}
|
||||
|
||||
watch([alertThreshold, deadThreshold], () => {
|
||||
navigate('/admin/entities', {
|
||||
...urlParsed.search,
|
||||
alert: alertThreshold.value,
|
||||
dead: deadThreshold.value,
|
||||
}, {
|
||||
redirect: false,
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
import { fetchEntityHealths } from '#/src/entities.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
<script setup>
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Admin class="page">
|
||||
<Revisions
|
||||
@@ -6,11 +11,6 @@
|
||||
</Admin>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Admin from '#/components/admin/admin.vue';
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchActorRevisions } from '#/src/actors.js';
|
||||
import verifyAbility from '#/utils/verify-ability.js';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchSceneRevisions } from '#/src/scenes.js';
|
||||
import verifyAbility from '#/utils/verify-ability.js';
|
||||
|
||||
@@ -1,3 +1,47 @@
|
||||
<script setup>
|
||||
import { inject, onMounted, ref } from 'vue';
|
||||
|
||||
import { post } from '#/src/api.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const user = pageContext.user;
|
||||
const allowSignup = pageContext.env.allowSignup;
|
||||
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
|
||||
const submitted = ref(false);
|
||||
const errorMsg = ref(null);
|
||||
const userInput = ref(null);
|
||||
const showPassword = ref(false);
|
||||
|
||||
async function login() {
|
||||
submitted.value = true;
|
||||
errorMsg.value = null;
|
||||
|
||||
try {
|
||||
const loginUser = await post('/session', {
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
redirect: pageContext.urlParsed.search.r,
|
||||
});
|
||||
|
||||
navigate(pageContext.urlParsed.search.r ? decodeURIComponent(pageContext.urlParsed.search.r) : `/user/${loginUser.username}`, null, { redirect: true });
|
||||
}
|
||||
catch (error) {
|
||||
errorMsg.value = error.message;
|
||||
}
|
||||
finally {
|
||||
submitted.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
userInput.value?.focus();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="login-container">
|
||||
<div v-if="user">
|
||||
@@ -13,14 +57,14 @@
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/updates`"
|
||||
href="/updates"
|
||||
class="link"
|
||||
>Check out latest porn updates</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/actors`"
|
||||
href="/actors"
|
||||
class="link"
|
||||
>Browse the hottest porn stars</a>
|
||||
</li>
|
||||
@@ -84,48 +128,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, inject } from 'vue';
|
||||
|
||||
import { post } from '#/src/api.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const user = pageContext.user;
|
||||
const allowSignup = pageContext.env.allowSignup;
|
||||
|
||||
const username = ref('');
|
||||
const password = ref('');
|
||||
|
||||
const submitted = ref(false);
|
||||
const errorMsg = ref(null);
|
||||
const userInput = ref(null);
|
||||
const showPassword = ref(false);
|
||||
|
||||
async function login() {
|
||||
submitted.value = true;
|
||||
errorMsg.value = null;
|
||||
|
||||
try {
|
||||
const loginUser = await post('/session', {
|
||||
username: username.value,
|
||||
password: password.value,
|
||||
redirect: pageContext.urlParsed.search.r,
|
||||
});
|
||||
|
||||
navigate(pageContext.urlParsed.search.r ? decodeURIComponent(pageContext.urlParsed.search.r) : `/user/${loginUser.username}`, null, { redirect: true });
|
||||
} catch (error) {
|
||||
errorMsg.value = error.message;
|
||||
} finally {
|
||||
submitted.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
userInput.value?.focus();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-container {
|
||||
display: flex;
|
||||
|
||||
@@ -1,3 +1,62 @@
|
||||
<script setup>
|
||||
import VueHCaptcha from '@hcaptcha/vue3-hcaptcha';
|
||||
import { inject, onMounted, ref } from 'vue';
|
||||
|
||||
import { post } from '#/src/api.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { user, env } = pageContext;
|
||||
|
||||
const username = ref('');
|
||||
const email = ref('');
|
||||
const password = ref('');
|
||||
const passwordConfirm = ref('');
|
||||
|
||||
const errorMsg = ref(null);
|
||||
const submitted = ref(false);
|
||||
const userInput = ref(null);
|
||||
const showPassword = ref(false);
|
||||
const captcha = ref(null);
|
||||
|
||||
async function signup() {
|
||||
errorMsg.value = null;
|
||||
submitted.value = true;
|
||||
|
||||
if (password.value !== passwordConfirm.value) {
|
||||
errorMsg.value = 'Passwords do not match';
|
||||
return;
|
||||
}
|
||||
|
||||
if (env.captcha.enabled && !captcha.value) {
|
||||
errorMsg.value = 'Please complete the CAPTCHA';
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const newUser = await post('/users', {
|
||||
username: username.value,
|
||||
email: email.value,
|
||||
password: password.value,
|
||||
redirect: pageContext.urlParsed.search.r,
|
||||
captcha: captcha.value,
|
||||
});
|
||||
|
||||
navigate(`/user/${newUser.username}`, null, { redirect: true });
|
||||
}
|
||||
catch (error) {
|
||||
errorMsg.value = error.message;
|
||||
}
|
||||
finally {
|
||||
submitted.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
userInput.value.focus();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="login-container">
|
||||
<div v-if="user">
|
||||
@@ -13,14 +72,14 @@
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/updates`"
|
||||
href="/updates"
|
||||
class="link"
|
||||
>Check out latest porn updates</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/actors`"
|
||||
href="/actors"
|
||||
class="link"
|
||||
>Browse the hottest porn stars</a>
|
||||
</li>
|
||||
@@ -133,63 +192,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, inject } from 'vue';
|
||||
import VueHCaptcha from '@hcaptcha/vue3-hcaptcha';
|
||||
|
||||
import { post } from '#/src/api.js';
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { user, env } = pageContext;
|
||||
|
||||
const username = ref('');
|
||||
const email = ref('');
|
||||
const password = ref('');
|
||||
const passwordConfirm = ref('');
|
||||
|
||||
const errorMsg = ref(null);
|
||||
const submitted = ref(false);
|
||||
const userInput = ref(null);
|
||||
const showPassword = ref(false);
|
||||
const captcha = ref(null);
|
||||
|
||||
async function signup() {
|
||||
errorMsg.value = null;
|
||||
submitted.value = true;
|
||||
|
||||
if (password.value !== passwordConfirm.value) {
|
||||
errorMsg.value = 'Passwords do not match';
|
||||
return;
|
||||
}
|
||||
|
||||
if (env.captcha.enabled && !captcha.value) {
|
||||
errorMsg.value = 'Please complete the CAPTCHA';
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const newUser = await post('/users', {
|
||||
username: username.value,
|
||||
email: email.value,
|
||||
password: password.value,
|
||||
redirect: pageContext.urlParsed.search.r,
|
||||
captcha: captcha.value,
|
||||
});
|
||||
|
||||
navigate(`/user/${newUser.username}`, null, { redirect: true });
|
||||
} catch (error) {
|
||||
errorMsg.value = error.message;
|
||||
} finally {
|
||||
submitted.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
userInput.value.focus();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-container {
|
||||
display: flex;
|
||||
|
||||
@@ -1,3 +1,72 @@
|
||||
<script setup>
|
||||
import { inject, ref } from 'vue';
|
||||
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const { pageProps } = pageContext;
|
||||
const { networks } = pageProps;
|
||||
|
||||
const networksBySlug = Object.fromEntries(networks.map((network) => [network.slug, network]));
|
||||
|
||||
const popularNetworks = [
|
||||
'21sextury',
|
||||
'adulttime',
|
||||
'analvids',
|
||||
'bamvisions',
|
||||
'bang',
|
||||
'bangbros',
|
||||
'blowpass',
|
||||
'brazzers',
|
||||
'digitalplayground',
|
||||
'dogfartnetwork',
|
||||
'dorcel',
|
||||
'elegantangel',
|
||||
'evilangel',
|
||||
'fakehub',
|
||||
'hentaied',
|
||||
'hookuphotshot',
|
||||
'hussiepass',
|
||||
'julesjordan',
|
||||
'kink',
|
||||
'mikeadriano',
|
||||
'mofos',
|
||||
'naughtyamerica',
|
||||
'newsensations',
|
||||
'pervcity',
|
||||
'pornpros',
|
||||
'pornworld',
|
||||
'private',
|
||||
'realitykings',
|
||||
'rickysroom',
|
||||
'score',
|
||||
'teamskeet',
|
||||
'kellymadison',
|
||||
'vixen',
|
||||
'xempire',
|
||||
].map((slug) => networksBySlug[slug]).filter(Boolean);
|
||||
|
||||
const query = ref(pageContext.urlParsed.search.q || null);
|
||||
|
||||
const sections = [
|
||||
!query.value && {
|
||||
label: 'Popular',
|
||||
networks: popularNetworks,
|
||||
},
|
||||
{
|
||||
label: query.value ? 'Results' : 'All networks',
|
||||
networks,
|
||||
},
|
||||
].filter(Boolean);
|
||||
|
||||
// const tags = Object.values(Object.fromEntries(networks.flatMap((entity) => entity.tags).map((tag) => [tag.id, tag])));
|
||||
|
||||
async function search() {
|
||||
navigate('/channels', { q: query.value || undefined }, { redirect: true });
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<form
|
||||
@@ -67,75 +136,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject } from 'vue';
|
||||
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const { pageProps } = pageContext;
|
||||
const { networks } = pageProps;
|
||||
|
||||
const networksBySlug = Object.fromEntries(networks.map((network) => [network.slug, network]));
|
||||
|
||||
const popularNetworks = [
|
||||
'21sextury',
|
||||
'adulttime',
|
||||
'analvids',
|
||||
'bamvisions',
|
||||
'bang',
|
||||
'bangbros',
|
||||
'blowpass',
|
||||
'brazzers',
|
||||
'digitalplayground',
|
||||
'dogfartnetwork',
|
||||
'dorcel',
|
||||
'elegantangel',
|
||||
'evilangel',
|
||||
'fakehub',
|
||||
'hentaied',
|
||||
'hookuphotshot',
|
||||
'hussiepass',
|
||||
'julesjordan',
|
||||
'kink',
|
||||
'mikeadriano',
|
||||
'mofos',
|
||||
'naughtyamerica',
|
||||
'newsensations',
|
||||
'pervcity',
|
||||
'pornpros',
|
||||
'pornworld',
|
||||
'private',
|
||||
'realitykings',
|
||||
'rickysroom',
|
||||
'score',
|
||||
'teamskeet',
|
||||
'kellymadison',
|
||||
'vixen',
|
||||
'xempire',
|
||||
].map((slug) => networksBySlug[slug]).filter(Boolean);
|
||||
|
||||
const query = ref(pageContext.urlParsed.search.q || null);
|
||||
|
||||
const sections = [
|
||||
!query.value && {
|
||||
label: 'Popular',
|
||||
networks: popularNetworks,
|
||||
},
|
||||
{
|
||||
label: query.value ? 'Results' : 'All networks',
|
||||
networks,
|
||||
},
|
||||
].filter(Boolean);
|
||||
|
||||
// const tags = Object.values(Object.fromEntries(networks.flatMap((entity) => entity.tags).map((tag) => [tag.id, tag])));
|
||||
|
||||
async function search() {
|
||||
navigate('/channels', { q: query.value || undefined }, { redirect: true });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
<script setup>
|
||||
import { computed, inject, ref } from 'vue';
|
||||
|
||||
import Domains from '#/components/domains/domains.vue';
|
||||
import EntityTile from '#/components/entities/tile.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
|
||||
const { pageProps, routeParams, user } = inject('pageContext');
|
||||
const { entity } = pageProps;
|
||||
|
||||
const children = ref(null);
|
||||
const expanded = ref(false);
|
||||
|
||||
const scrollable = computed(() => children.value?.scrollWidth > children.value?.clientWidth);
|
||||
const domain = routeParams.domain;
|
||||
|
||||
const entityUrl = entity.affiliateUrl || entity.url || null;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="header">
|
||||
@@ -153,27 +174,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, inject } from 'vue';
|
||||
|
||||
import EntityTile from '#/components/entities/tile.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Domains from '#/components/domains/domains.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
|
||||
const { pageProps, routeParams, user } = inject('pageContext');
|
||||
const { entity } = pageProps;
|
||||
|
||||
const children = ref(null);
|
||||
const expanded = ref(false);
|
||||
|
||||
const scrollable = computed(() => children.value?.scrollWidth > children.value?.clientWidth);
|
||||
const domain = routeParams.domain;
|
||||
|
||||
const entityUrl = entity.affiliateUrl || entity.url || null;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchEntitiesById } from '#/src/entities.js';
|
||||
import entityPrefixes from '#/src/entities-prefixes.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
|
||||
import redis from '#/src//redis.js';
|
||||
import { getCampaignIndex, getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import entityPrefixes from '#/src/entities-prefixes.js';
|
||||
import { fetchEntitiesById } from '#/src/entities.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
|
||||
async function fetchReleases(pageContext, entityId) {
|
||||
if (pageContext.routeParams.domain === 'movies') {
|
||||
@@ -72,12 +72,14 @@ export async function onBeforeRender(pageContext) {
|
||||
minRatio: 3,
|
||||
allowRandomFallback: false,
|
||||
},
|
||||
pageContext.routeParams.domain === 'scenes' ? {
|
||||
entityIds,
|
||||
minRatio: 0.75,
|
||||
maxRatio: 1.25,
|
||||
allowRandomFallback: false,
|
||||
} : null,
|
||||
pageContext.routeParams.domain === 'scenes'
|
||||
? {
|
||||
entityIds,
|
||||
minRatio: 0.75,
|
||||
maxRatio: 1.25,
|
||||
allowRandomFallback: false,
|
||||
}
|
||||
: null,
|
||||
].filter(Boolean), { tagFilter: pageContext.tagFilter });
|
||||
|
||||
const releases = entityReleases.scenes || entityReleases.movies;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<script setup>
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<Movies />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
|
||||
import Banner from '#/components/media/banner.vue';
|
||||
import SceneTile from '#/components/scenes/tile.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import { formatDate, formatDuration } from '#/utils/format.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const movie = pageContext.pageProps.movie;
|
||||
const scenes = pageContext.pageProps.scenes;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="content">
|
||||
@@ -191,22 +207,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import { formatDate, formatDuration } from '#/utils/format.js';
|
||||
|
||||
import Banner from '#/components/media/banner.vue';
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
import SceneTile from '#/components/scenes/tile.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const movie = pageContext.pageProps.movie;
|
||||
const scenes = pageContext.pageProps.scenes;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchMoviesById } from '#/src/movies.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
|
||||
@@ -1,458 +1,23 @@
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="content">
|
||||
<Banner
|
||||
:release="scene"
|
||||
/>
|
||||
|
||||
<div class="meta">
|
||||
<div class="entity">
|
||||
<Link
|
||||
v-if="scene.channel"
|
||||
:href="`/${scene.channel.type}/${scene.channel.slug}`"
|
||||
class="channel-link entity-link nolink"
|
||||
>
|
||||
<img
|
||||
v-if="scene.channel.hasLogo"
|
||||
:src="scene.channel.isIndependent
|
||||
|| scene.channel.type === 'network'
|
||||
|| !scene.network
|
||||
? `/logos/${scene.channel.slug}/thumbs/network.png`
|
||||
: `/logos/${scene.network.slug}/thumbs/${scene.channel.slug}.png`"
|
||||
class="channel-logo entity-logo"
|
||||
>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="name"
|
||||
>{{ scene.channel.name }}</span>
|
||||
</Link>
|
||||
|
||||
<span
|
||||
v-if="!scene.channel.isIndependent && scene.channel.type !== 'network' && scene.network"
|
||||
class="network-container"
|
||||
>
|
||||
by
|
||||
<Link
|
||||
:href="`/${scene.network.type}/${scene.network.slug}`"
|
||||
class="network-link entity-link nolink"
|
||||
>
|
||||
<img
|
||||
v-if="scene.network.hasLogo"
|
||||
:src="`/logos/${scene.network.slug}/thumbs/network.png`"
|
||||
class="network-logo entity-logo"
|
||||
>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="name"
|
||||
>{{ scene.network.name }}</span>
|
||||
</Link>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
:href="verifyAbility(user, 'plainUrls') ? scene.url : scene.watchUrl"
|
||||
:title="scene.date ? formatDate(scene.date.toISOString(), 'y-MM-dd hh:mm') : `Release date unknown, added ${formatDate(scene.createdAt, 'y-MM-dd')}`"
|
||||
target="_blank"
|
||||
class="date nolink"
|
||||
:class="{ nodate: !scene.date }"
|
||||
:data-umami-event="scene.affiliate ? 'scene-date-click-aff' : 'scene-date-click'"
|
||||
:data-umami-event-aff-id="scene.affiliate?.id"
|
||||
:data-umami-event-scene-id="scene.id"
|
||||
>
|
||||
<time
|
||||
:datetime="scene.effectiveDate.toISOString()"
|
||||
class="ellipsis compact-hide"
|
||||
>{{ formatDate(scene.effectiveDate, {
|
||||
month: 'MMMM y',
|
||||
year: 'y',
|
||||
}[scene.datePrecision] || 'MMMM d, y') }}</time>
|
||||
|
||||
<time
|
||||
:datetime="scene.effectiveDate.toISOString()"
|
||||
class="ellipsis compact-show"
|
||||
>{{ formatDate(scene.effectiveDate, {
|
||||
month: 'MMM y',
|
||||
year: 'y',
|
||||
}[scene.datePrecision] || 'MMM d, y') }}</time>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h2
|
||||
v-if="scene.title"
|
||||
:title="scene.title"
|
||||
class="title"
|
||||
>{{ scene.title }}</h2>
|
||||
|
||||
<h2
|
||||
v-else-if="scene.actors.length > 0"
|
||||
class="title notitle"
|
||||
>Scene featuring {{ scene.actors.map((actor) => actor.name).join(', ') }}</h2>
|
||||
|
||||
<h2
|
||||
v-else
|
||||
class="title notitle"
|
||||
>No title</h2>
|
||||
|
||||
<div class="actions">
|
||||
<Heart
|
||||
domain="scenes"
|
||||
:item="scene"
|
||||
/>
|
||||
|
||||
<div class="view">
|
||||
<!--
|
||||
<button
|
||||
v-if="scene.photos.length > 0"
|
||||
class="button view nolink"
|
||||
>View photos</button>
|
||||
-->
|
||||
|
||||
<a
|
||||
v-if="scene.watchUrl"
|
||||
:href="scene.watchUrl"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="button button-primary watch nolink"
|
||||
:data-umami-event="scene.affiliate ? 'watch-click-aff' : 'watch-click'"
|
||||
:data-umami-event-scene-id="`${(scene.channel || scene.network).slug}:scene:${scene.id}`"
|
||||
:data-umami-event-aff-id="scene.affiliate && `aff:${scene.affiliate.id}`"
|
||||
:data-umami-event-channel="scene.channel?.slug"
|
||||
:data-umami-event-network="scene.network?.slug"
|
||||
>Watch full video</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<ul
|
||||
v-if="scene.actors.length > 0"
|
||||
class="actors nolist nobar"
|
||||
>
|
||||
<li
|
||||
v-for="actor in scene.actors"
|
||||
:key="`actor-${actor.id}`"
|
||||
class="actor"
|
||||
>
|
||||
<ActorTile :actor="actor" />
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="tags nolist">
|
||||
<li
|
||||
v-for="tag in tags"
|
||||
:key="`tag-${tag.id}`"
|
||||
class="tag"
|
||||
:class="{ 'has-actors': tag.actors.length > 0 }"
|
||||
>
|
||||
<Link
|
||||
:href="`/tag/${tag.slug}`"
|
||||
class="tag-name nolink"
|
||||
>{{ tag.name }}</Link>
|
||||
|
||||
<span
|
||||
v-if="tag.actors.length > 0"
|
||||
v-tooltip="{
|
||||
content: `${tag.name} for ${new Intl.ListFormat('en', { style: 'long', type: 'conjunction' }).format(tag.actors.map((actor) => actor.name))}`,
|
||||
triggers: ['hover', 'click'],
|
||||
}"
|
||||
class="tag-actors"
|
||||
>
|
||||
<template
|
||||
v-for="tagActor in tag.actors"
|
||||
>
|
||||
<div
|
||||
v-if="tagActor.avatar"
|
||||
:key="`tagactor-${tagActor.id}`"
|
||||
class="tag-avatar"
|
||||
:style="tagActor.avatarStyle"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-else
|
||||
:key="`tagactor-${tagActor.id}`"
|
||||
icon="star-full"
|
||||
class="tag-star"
|
||||
/>
|
||||
</template>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div
|
||||
v-if="scene.movies.length > 0 || scene.series.length > 0"
|
||||
class="section"
|
||||
>
|
||||
<h3 class="heading">Part of</h3>
|
||||
|
||||
<div class="movies">
|
||||
<MovieTile
|
||||
v-for="movie in scene.movies"
|
||||
:key="`movie-${movie.id}`"
|
||||
:movie="movie"
|
||||
:show-details="false"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="series">
|
||||
<SerieTile
|
||||
v-for="serie in scene.series"
|
||||
:key="`serie-${serie.id}`"
|
||||
:serie="serie"
|
||||
:details="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.duration || scene.directors.length > 0 || scene.shootId || scene.qualities.length > 0"
|
||||
class="section details"
|
||||
>
|
||||
<div
|
||||
v-if="scene.directors.length > 0"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Director</h3>
|
||||
{{ scene.directors.map((director) => director.name).join(', ') }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.duration"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Duration</h3>
|
||||
{{ formatDuration(scene.duration) }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.shootId"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Shoot</h3>
|
||||
{{ scene.shootId }}
|
||||
</div>
|
||||
|
||||
<time
|
||||
v-if="scene.productionDate"
|
||||
:datetime="formatDate(scene.productionDate, 'yyyy-MM-dd')"
|
||||
:title="formatDate(scene.productionDate, 'yyyy-MM-dd')"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Shoot date</h3>
|
||||
{{ formatDate(scene.productionDate, 'MMMM d, yyyy') }}
|
||||
</time>
|
||||
|
||||
<div
|
||||
v-if="scene.studio"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Studio</h3>
|
||||
|
||||
<a
|
||||
:href="`/studio/${scene.studio.slug}`"
|
||||
class="link"
|
||||
>{{ scene.studio.name }}</a>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.qualities.length > 0"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Quality</h3>
|
||||
|
||||
<template v-if="qualities[scene.qualities[0]]">{{ qualities[scene.qualities[0]] }} ({{ scene.qualities[0] }}p)</template>
|
||||
<template v-else>{{ scene.qualities[0] }}p</template>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.photoCount"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Photos</h3>
|
||||
{{ scene.photoCount }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.description"
|
||||
class="section"
|
||||
>
|
||||
<h3 class="heading">Description</h3>
|
||||
|
||||
<p class="description">{{ scene.description }}</p>
|
||||
</div>
|
||||
|
||||
<section
|
||||
v-if="scene.chapters.length > 0"
|
||||
class="section"
|
||||
>
|
||||
<h3 class="heading">Chapters</h3>
|
||||
|
||||
<Chapters
|
||||
:chapters="scene.chapters"
|
||||
class="section"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<div
|
||||
v-if="campaigns?.scene"
|
||||
class="section"
|
||||
>
|
||||
<Campaign
|
||||
:campaign="campaigns.scene"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="section details">
|
||||
<div class="detail">
|
||||
<h3 class="heading">Added</h3>
|
||||
|
||||
<span>
|
||||
<span class="added-date">{{ formatDate(scene.createdAt, 'yyyy-MM-dd') }}</span>
|
||||
<span
|
||||
:title="`Batch ${scene.createdBatchId}`"
|
||||
class="added-batch"
|
||||
>#{{ scene.createdBatchId }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.comment"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Comment</h3>
|
||||
{{ scene.comment }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section summary">
|
||||
<h3 class="heading">Summary</h3>
|
||||
|
||||
<div class="detail">
|
||||
<input
|
||||
class="input"
|
||||
:value="summary"
|
||||
@focus="$event.target.select()"
|
||||
>
|
||||
|
||||
<a
|
||||
v-if="user"
|
||||
class="icon-link"
|
||||
target="_blank"
|
||||
:href="`/user/${user.username}/templates?t=${selectedTemplate}`"
|
||||
>
|
||||
<Icon
|
||||
v-tooltip="'Edit templates'"
|
||||
icon="pencil5"
|
||||
class="edit"
|
||||
@click="showSummaryDialog = true"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<Icon
|
||||
v-tooltip="'Copy to clipboard'"
|
||||
icon="copy"
|
||||
class="copy"
|
||||
@click="copySummary"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ul
|
||||
v-if="templates.length > 0"
|
||||
class="nolist templates"
|
||||
>
|
||||
<Icon icon="markup" />
|
||||
|
||||
<li
|
||||
v-for="userTemplate in templates"
|
||||
:key="`template-${userTemplate.id}`"
|
||||
class="template"
|
||||
:class="{ selected: userTemplate.id === selectedTemplate }"
|
||||
@click="selectTemplate(userTemplate.id)"
|
||||
>{{ userTemplate.name }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="user && scene.fingerprints.length > 0"
|
||||
class="section fingerprints"
|
||||
>
|
||||
<h3 class="heading">Fingerprints</h3>
|
||||
|
||||
<div class="fingerprints-container">
|
||||
<table class="fingerprints-table">
|
||||
<thead class="fingerprints-head">
|
||||
<tr class="fingerprints-header">
|
||||
<th class="fingerprints-heading">Hash</th>
|
||||
<th class="fingerprints-heading">Type</th>
|
||||
<th class="fingerprints-heading">Duration</th>
|
||||
<th class="fingerprints-heading">Submissions</th>
|
||||
<th class="fingerprints-heading">Source</th>
|
||||
<th class="fingerprints-heading">First added</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="fingerprints-body">
|
||||
<tr
|
||||
v-for="fingerprint in scene.fingerprints"
|
||||
:key="`fingerprint-${fingerprint.hash}`"
|
||||
class="fingerprint"
|
||||
>
|
||||
<td class="fingerprint-field fingerprint-hash">{{ fingerprint.hash }}</td>
|
||||
<td class="fingerprint-field fingerprint-type">{{ fingerprint.type.toUpperCase() }}</td>
|
||||
<td class="fingerprint-field fingerprint-duration">{{ formatDuration(fingerprint.duration) }}</td>
|
||||
<td class="fingerprint-field fingerprint-submission">{{ fingerprint.submissions }}</td>
|
||||
<td class="fingerprint-field fingerprint-source">{{ fingerprint.source || 'traxxx' }}</td>
|
||||
<td class="fingerprint-field fingerprint-date">{{ formatDate(fingerprint.createdAt, 'yyyy-MM-dd') }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="scene-actions section"
|
||||
>
|
||||
<a
|
||||
v-if="user && user.role !== 'user'"
|
||||
:href="`/scene/edit/${scene.id}/${scene.slug}`"
|
||||
target="_blank"
|
||||
class="link"
|
||||
>Edit scene</a>
|
||||
|
||||
<a
|
||||
:href="`/scene/revs/${scene.id}/${scene.slug}`"
|
||||
target="_blank"
|
||||
class="link"
|
||||
>Revisions</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject } from 'vue';
|
||||
import Cookies from 'js-cookie';
|
||||
import { inject, ref, useId } from 'vue';
|
||||
|
||||
import { formatDate, formatDuration } from '#/utils/format.js';
|
||||
import events from '#/src/events.js';
|
||||
import processSummaryTemplate from '#/utils/process-summary-template.js';
|
||||
import getPath from '#/src/get-path.js';
|
||||
import verifyAbility from '#/utils/verify-ability.js';
|
||||
|
||||
import Banner from '#/components/media/banner.vue';
|
||||
import markdownTemplate from '#/assets/markdown.yaml?raw';
|
||||
import defaultTemplate from '#/assets/summary.yaml?raw';
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
import MovieTile from '#/components/movies/tile.vue';
|
||||
import SerieTile from '#/components/series/tile.vue';
|
||||
import Chapters from '#/components/scenes/chapters.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import Campaign from '#/components/campaigns/campaign.vue';
|
||||
import Banner from '#/components/media/banner.vue';
|
||||
|
||||
import defaultTemplate from '#/assets/summary.yaml?raw'; // eslint-disable-line import/no-unresolved
|
||||
import markdownTemplate from '#/assets/markdown.yaml?raw'; // eslint-disable-line import/no-unresolved
|
||||
import MovieTile from '#/components/movies/tile.vue';
|
||||
import Chapters from '#/components/scenes/chapters.vue';
|
||||
import SerieTile from '#/components/series/tile.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import events from '#/src/events.js';
|
||||
import getPath from '#/src/get-path.js';
|
||||
import { formatDate, formatDuration } from '#/utils/format.js';
|
||||
|
||||
import processSummaryTemplate from '#/utils/process-summary-template.js';
|
||||
import verifyAbility from '#/utils/verify-ability.js';
|
||||
|
||||
const cookies = Cookies.withConverter({
|
||||
write: (value) => value,
|
||||
@@ -472,6 +37,8 @@ const avatarFrameSize = 36;
|
||||
const avatarMargin = 2.75;
|
||||
const avatarVerticalOffset = 0.1; // fraction of crop size; positive shifts crop down (frames more chin, less forehead)
|
||||
const fallbackZoom = 2.25; // zoom level when no biometrics are available
|
||||
const editTemplatesTooltipId = useId();
|
||||
const copySummaryTooltipId = useId();
|
||||
|
||||
function clampCrop(crop) {
|
||||
const size = Math.min(crop.size, crop.imageWidth, crop.imageHeight);
|
||||
@@ -675,7 +242,8 @@ function selectTemplate(templateId, allowFallback = true) {
|
||||
selectedTemplate.value = template.id;
|
||||
|
||||
cookies.set('selectedTemplate', String(templateId));
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`Failed to process summary template: ${error.message}`);
|
||||
summary.value = null;
|
||||
}
|
||||
@@ -693,6 +261,442 @@ function copySummary() {
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="content">
|
||||
<Banner
|
||||
:release="scene"
|
||||
/>
|
||||
|
||||
<div class="meta">
|
||||
<div class="entity">
|
||||
<Link
|
||||
v-if="scene.channel"
|
||||
:href="`/${scene.channel.type}/${scene.channel.slug}`"
|
||||
class="channel-link entity-link nolink"
|
||||
>
|
||||
<img
|
||||
v-if="scene.channel.hasLogo"
|
||||
:src="scene.channel.isIndependent
|
||||
|| scene.channel.type === 'network'
|
||||
|| !scene.network
|
||||
? `/logos/${scene.channel.slug}/thumbs/network.png`
|
||||
: `/logos/${scene.network.slug}/thumbs/${scene.channel.slug}.png`"
|
||||
class="channel-logo entity-logo"
|
||||
>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="name"
|
||||
>{{ scene.channel.name }}</span>
|
||||
</Link>
|
||||
|
||||
<span
|
||||
v-if="!scene.channel.isIndependent && scene.channel.type !== 'network' && scene.network"
|
||||
class="network-container"
|
||||
>
|
||||
on
|
||||
<Link
|
||||
:href="`/${scene.network.type}/${scene.network.slug}`"
|
||||
class="network-link entity-link nolink"
|
||||
>
|
||||
<img
|
||||
v-if="scene.network.hasLogo"
|
||||
:src="`/logos/${scene.network.slug}/thumbs/network.png`"
|
||||
class="network-logo entity-logo"
|
||||
>
|
||||
|
||||
<span
|
||||
v-else
|
||||
class="name"
|
||||
>{{ scene.network.name }}</span>
|
||||
</Link>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Link
|
||||
:href="verifyAbility(user, 'plainUrls') ? scene.url : scene.watchUrl"
|
||||
:title="scene.date ? formatDate(scene.date.toISOString(), 'y-MM-dd hh:mm') : `Release date unknown, added ${formatDate(scene.createdAt, 'y-MM-dd')}`"
|
||||
target="_blank"
|
||||
class="date nolink"
|
||||
:class="{ nodate: !scene.date }"
|
||||
:data-umami-event="scene.affiliate ? 'scene-date-click-aff' : 'scene-date-click'"
|
||||
:data-umami-event-aff-id="scene.affiliate?.id"
|
||||
:data-umami-event-scene-id="scene.id"
|
||||
>
|
||||
<time
|
||||
:datetime="scene.effectiveDate.toISOString()"
|
||||
class="ellipsis compact-hide"
|
||||
>{{ formatDate(scene.effectiveDate, {
|
||||
month: 'MMMM y',
|
||||
year: 'y',
|
||||
}[scene.datePrecision] || 'MMMM d, y') }}</time>
|
||||
|
||||
<time
|
||||
:datetime="scene.effectiveDate.toISOString()"
|
||||
class="ellipsis compact-show"
|
||||
>{{ formatDate(scene.effectiveDate, {
|
||||
month: 'MMM y',
|
||||
year: 'y',
|
||||
}[scene.datePrecision] || 'MMM d, y') }}</time>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<h2
|
||||
v-if="scene.title"
|
||||
:title="scene.title"
|
||||
class="title"
|
||||
>{{ scene.title }}</h2>
|
||||
|
||||
<h2
|
||||
v-else-if="scene.actors.length > 0"
|
||||
class="title notitle"
|
||||
>Scene featuring {{ scene.actors.map((actor) => actor.name).join(', ') }}</h2>
|
||||
|
||||
<h2
|
||||
v-else
|
||||
class="title notitle"
|
||||
>No title</h2>
|
||||
|
||||
<div class="actions">
|
||||
<Heart
|
||||
domain="scenes"
|
||||
:item="scene"
|
||||
/>
|
||||
|
||||
<div class="view">
|
||||
<!--
|
||||
<button
|
||||
v-if="scene.photos.length > 0"
|
||||
class="button view nolink"
|
||||
>View photos</button>
|
||||
-->
|
||||
|
||||
<a
|
||||
v-if="scene.watchUrl"
|
||||
:href="scene.watchUrl"
|
||||
target="_blank"
|
||||
rel="noopener"
|
||||
class="button button-primary watch nolink"
|
||||
:data-umami-event="scene.affiliate ? 'watch-click-aff' : 'watch-click'"
|
||||
:data-umami-event-scene-id="`${(scene.channel || scene.network).slug}:scene:${scene.id}`"
|
||||
:data-umami-event-aff-id="scene.affiliate && `aff:${scene.affiliate.id}`"
|
||||
:data-umami-event-channel="scene.channel?.slug"
|
||||
:data-umami-event-network="scene.network?.slug"
|
||||
>Watch full video</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="info">
|
||||
<ul
|
||||
v-if="scene.actors.length > 0"
|
||||
class="actors nolist nobar"
|
||||
>
|
||||
<li
|
||||
v-for="actor in scene.actors"
|
||||
:key="`actor-${actor.id}`"
|
||||
class="actor"
|
||||
>
|
||||
<ActorTile :actor="actor" />
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<ul class="tags nolist">
|
||||
<li
|
||||
v-for="tag in tags"
|
||||
:key="`tag-${tag.id}`"
|
||||
class="tag"
|
||||
:class="{ 'has-actors': tag.actors.length > 0 }"
|
||||
>
|
||||
<Link
|
||||
:href="`/tag/${tag.slug}`"
|
||||
class="tag-name nolink"
|
||||
>{{ tag.name }}</Link>
|
||||
|
||||
<span
|
||||
v-if="tag.actors.length > 0"
|
||||
v-tooltip="{
|
||||
content: `${tag.name} for ${new Intl.ListFormat('en', { style: 'long', type: 'conjunction' }).format(tag.actors.map((actor) => actor.name))}`,
|
||||
triggers: ['hover', 'click'],
|
||||
ariaId: `tag-actors-${tag.id}`,
|
||||
}"
|
||||
class="tag-actors"
|
||||
>
|
||||
<template
|
||||
v-for="tagActor in tag.actors"
|
||||
>
|
||||
<div
|
||||
v-if="tagActor.avatar"
|
||||
:key="`tagactor-${tagActor.id}`"
|
||||
class="tag-avatar"
|
||||
:style="tagActor.avatarStyle"
|
||||
/>
|
||||
|
||||
<Icon
|
||||
v-else
|
||||
:key="`tagactor-${tagActor.id}`"
|
||||
icon="star-full"
|
||||
class="tag-star"
|
||||
/>
|
||||
</template>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div
|
||||
v-if="scene.movies.length > 0 || scene.series.length > 0"
|
||||
class="section"
|
||||
>
|
||||
<h3 class="heading">Part of</h3>
|
||||
|
||||
<div class="movies">
|
||||
<MovieTile
|
||||
v-for="movie in scene.movies"
|
||||
:key="`movie-${movie.id}`"
|
||||
:movie="movie"
|
||||
:show-details="false"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="series">
|
||||
<SerieTile
|
||||
v-for="serie in scene.series"
|
||||
:key="`serie-${serie.id}`"
|
||||
:serie="serie"
|
||||
:details="false"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.duration || scene.directors.length > 0 || scene.shootId || scene.qualities.length > 0"
|
||||
class="section details"
|
||||
>
|
||||
<div
|
||||
v-if="scene.directors.length > 0"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Director</h3>
|
||||
{{ scene.directors.map((director) => director.name).join(', ') }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.duration"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Duration</h3>
|
||||
{{ formatDuration(scene.duration) }}
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.shootId"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Shoot</h3>
|
||||
{{ scene.shootId }}
|
||||
</div>
|
||||
|
||||
<time
|
||||
v-if="scene.productionDate"
|
||||
:datetime="formatDate(scene.productionDate, 'yyyy-MM-dd')"
|
||||
:title="formatDate(scene.productionDate, 'yyyy-MM-dd')"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Shoot date</h3>
|
||||
{{ formatDate(scene.productionDate, 'MMMM d, yyyy') }}
|
||||
</time>
|
||||
|
||||
<div
|
||||
v-if="scene.studio"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Studio</h3>
|
||||
|
||||
<a
|
||||
:href="`/studio/${scene.studio.slug}`"
|
||||
class="link"
|
||||
>{{ scene.studio.name }}</a>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.qualities.length > 0"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Quality</h3>
|
||||
|
||||
<template v-if="qualities[scene.qualities[0]]">{{ qualities[scene.qualities[0]] }} ({{ scene.qualities[0] }}p)</template>
|
||||
<template v-else>{{ scene.qualities[0] }}p</template>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.photoCount"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Photos</h3>
|
||||
{{ scene.photoCount }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.description"
|
||||
class="section"
|
||||
>
|
||||
<h3 class="heading">Description</h3>
|
||||
|
||||
<p class="description">{{ scene.description }}</p>
|
||||
</div>
|
||||
|
||||
<section
|
||||
v-if="scene.chapters.length > 0"
|
||||
class="section"
|
||||
>
|
||||
<h3 class="heading">Chapters</h3>
|
||||
|
||||
<Chapters
|
||||
:chapters="scene.chapters"
|
||||
class="section"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<div
|
||||
v-if="campaigns?.scene"
|
||||
class="section"
|
||||
>
|
||||
<Campaign
|
||||
:campaign="campaigns.scene"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="section details">
|
||||
<div class="detail">
|
||||
<h3 class="heading">Added</h3>
|
||||
|
||||
<span>
|
||||
<span class="added-date">{{ formatDate(scene.createdAt, 'yyyy-MM-dd') }}</span>
|
||||
<span
|
||||
:title="`Batch ${scene.createdBatchId}`"
|
||||
class="added-batch"
|
||||
>#{{ scene.createdBatchId }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="scene.comment"
|
||||
class="detail"
|
||||
>
|
||||
<h3 class="heading">Comment</h3>
|
||||
{{ scene.comment }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section summary">
|
||||
<h3 class="heading">Summary</h3>
|
||||
|
||||
<div class="detail">
|
||||
<input
|
||||
class="input"
|
||||
:value="summary"
|
||||
@focus="$event.target.select()"
|
||||
>
|
||||
|
||||
<a
|
||||
v-if="user"
|
||||
class="icon-link"
|
||||
target="_blank"
|
||||
:href="`/user/${user.username}/templates?t=${selectedTemplate}`"
|
||||
>
|
||||
<Icon
|
||||
v-tooltip="{ content: 'Edit templates', ariaId: editTemplatesTooltipId }"
|
||||
icon="pencil5"
|
||||
class="edit"
|
||||
@click="showSummaryDialog = true"
|
||||
/>
|
||||
</a>
|
||||
|
||||
<Icon
|
||||
v-tooltip="{ content: 'Copy to clipboard', ariaId: copySummaryTooltipId }"
|
||||
icon="copy"
|
||||
class="copy"
|
||||
@click="copySummary"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<ul
|
||||
v-if="templates.length > 0"
|
||||
class="nolist templates"
|
||||
>
|
||||
<Icon icon="markup" />
|
||||
|
||||
<li
|
||||
v-for="userTemplate in templates"
|
||||
:key="`template-${userTemplate.id}`"
|
||||
class="template"
|
||||
:class="{ selected: userTemplate.id === selectedTemplate }"
|
||||
@click="selectTemplate(userTemplate.id)"
|
||||
>{{ userTemplate.name }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="user && scene.fingerprints.length > 0"
|
||||
class="section fingerprints"
|
||||
>
|
||||
<h3 class="heading">Fingerprints</h3>
|
||||
|
||||
<div class="fingerprints-container">
|
||||
<table class="fingerprints-table">
|
||||
<thead class="fingerprints-head">
|
||||
<tr class="fingerprints-header">
|
||||
<th class="fingerprints-heading">Hash</th>
|
||||
<th class="fingerprints-heading">Type</th>
|
||||
<th class="fingerprints-heading">Duration</th>
|
||||
<th class="fingerprints-heading">Submissions</th>
|
||||
<th class="fingerprints-heading">Source</th>
|
||||
<th class="fingerprints-heading">First added</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody class="fingerprints-body">
|
||||
<tr
|
||||
v-for="fingerprint in scene.fingerprints"
|
||||
:key="`fingerprint-${fingerprint.hash}`"
|
||||
class="fingerprint"
|
||||
>
|
||||
<td class="fingerprint-field fingerprint-hash">{{ fingerprint.hash }}</td>
|
||||
<td class="fingerprint-field fingerprint-type">{{ fingerprint.type.toUpperCase() }}</td>
|
||||
<td class="fingerprint-field fingerprint-duration">{{ formatDuration(fingerprint.duration) }}</td>
|
||||
<td class="fingerprint-field fingerprint-submission">{{ fingerprint.submissions }}</td>
|
||||
<td class="fingerprint-field fingerprint-source">{{ fingerprint.source || 'traxxx' }}</td>
|
||||
<td class="fingerprint-field fingerprint-date">{{ formatDate(fingerprint.createdAt, 'yyyy-MM-dd') }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="scene-actions section"
|
||||
>
|
||||
<a
|
||||
v-if="user && user.role !== 'user'"
|
||||
:href="`/scene/edit/${scene.id}/${scene.slug}`"
|
||||
target="_blank"
|
||||
class="link"
|
||||
>Edit scene</a>
|
||||
|
||||
<a
|
||||
:href="`/scene/revs/${scene.id}/${scene.slug}`"
|
||||
target="_blank"
|
||||
class="link"
|
||||
>Revisions</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render, redirect } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { fetchScenesById } from '#/src/scenes.js';
|
||||
import { getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { redirect, render } from 'vike/abort';
|
||||
import { getIdsBySlug } from '#/src/cache.js';
|
||||
import { getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { fetchScenesById } from '#/src/scenes.js';
|
||||
|
||||
function getTitle(scene) {
|
||||
if (scene.title) {
|
||||
|
||||
@@ -1,255 +1,10 @@
|
||||
<template>
|
||||
<div class="editor">
|
||||
<p
|
||||
v-if="submitted"
|
||||
class="submitted"
|
||||
>
|
||||
<template v-if="apply">Your revision has been submitted. Thank you for your contribution!</template>
|
||||
<template v-else>Your revision has been submitted for review. Thank you for your contribution!</template>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
:href="`/scene/${scene.id}/${scene.slug}`"
|
||||
class="link"
|
||||
>Return to scene</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/scene/edit/${scene.id}`"
|
||||
class="link"
|
||||
>Make another edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/scene/revs/${scene.id}/${scene.slug}`"
|
||||
class="link"
|
||||
>Go to scene revisions</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/user/${user.username}/revisions/scenes`"
|
||||
class="link"
|
||||
>Go to user revisions</a>
|
||||
</li>
|
||||
|
||||
<li v-if="user.role !== 'user'">
|
||||
<a
|
||||
href="/admin/revisions/scenes"
|
||||
class="link"
|
||||
>Go to revisions admin</a>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<form
|
||||
v-else
|
||||
@submit.prevent
|
||||
>
|
||||
<div class="editor-header">
|
||||
<h2 class="heading ellipsis">Edit scene #{{ scene.id }} - {{ scene.title }}</h2>
|
||||
|
||||
<a
|
||||
:href="`/scene/${scene.id}/${scene.slug}`"
|
||||
target="_blank"
|
||||
class="link noshrink"
|
||||
>Go to scene</a>
|
||||
</div>
|
||||
|
||||
<ul class="nolist">
|
||||
<li
|
||||
v-for="item in fields"
|
||||
:key="`item-${item.key}`"
|
||||
class="row"
|
||||
>
|
||||
<div class="item-header">
|
||||
<div class="key">
|
||||
{{ item.label || item.key }}
|
||||
|
||||
<Icon
|
||||
v-if="item.note"
|
||||
v-tooltip="item.note"
|
||||
icon="info2"
|
||||
class="item-note noselect"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="item-actions">
|
||||
<Icon
|
||||
v-if="!item.forced"
|
||||
icon="pencil5"
|
||||
class="noselect"
|
||||
:class="{ active: editing.has(item.key) }"
|
||||
@click="toggleField(item)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="value"
|
||||
:class="{ disabled: !editing.has(item.key) }"
|
||||
>
|
||||
<EditActors
|
||||
v-if="item.type === 'actors'"
|
||||
:scene="scene"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@actors="(actors) => { edits.actors = actors; }"
|
||||
/>
|
||||
|
||||
<EditTags
|
||||
v-if="item.type === 'tags'"
|
||||
:scene="scene"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@tags="(tags) => { edits.tags = tags; }"
|
||||
/>
|
||||
|
||||
<EditMovies
|
||||
v-if="item.type === 'movies'"
|
||||
:scene="scene"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@movies="(movies) => { edits.movies = movies; }"
|
||||
/>
|
||||
|
||||
<input
|
||||
v-if="item.type === 'string'"
|
||||
v-model="edits[item.key]"
|
||||
class="string input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<textarea
|
||||
v-if="item.type === 'text'"
|
||||
v-model="edits[item.key]"
|
||||
:placeholder="item.placeholder"
|
||||
rows="3"
|
||||
class="text input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
v-if="item.type === 'checkbox'"
|
||||
:label="item.checkboxLabel"
|
||||
:checked="edits[item.key]"
|
||||
:disabled="!editing.has(item.key)"
|
||||
class="checkbox delete"
|
||||
@change="(checked) => setDelete(checked)"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'date'"
|
||||
class="date"
|
||||
>
|
||||
<input
|
||||
v-model="edits[item.key].date"
|
||||
type="datetime-local"
|
||||
class="date input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<select
|
||||
v-if="item.value.precision"
|
||||
v-model="edits[item.key].precision"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option value="minute">Minute</option>
|
||||
<option value="hour">Hour</option>
|
||||
<option value="day">Day</option>
|
||||
<option value="month">Month</option>
|
||||
<option value="year">Year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'duration'"
|
||||
class="duration"
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
:value="edits[item.key]?.[0] ?? item.value[0]"
|
||||
min="0"
|
||||
max="100"
|
||||
:disabled="!editing.has(item.key)"
|
||||
@change="setDuration('h', $event)"
|
||||
>H
|
||||
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
:value="edits[item.key]?.[1] ?? item.value[1]"
|
||||
min="0"
|
||||
max="59"
|
||||
:disabled="!editing.has(item.key)"
|
||||
@change="setDuration('m', $event)"
|
||||
>M
|
||||
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
:value="edits[item.key]?.[2] ?? item.value[2]"
|
||||
min="0"
|
||||
max="59"
|
||||
:disabled="!editing.has(item.key)"
|
||||
@change="setDuration('s', $event)"
|
||||
>S
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="editor-footer">
|
||||
<div class="comment">
|
||||
<textarea
|
||||
v-model="comment"
|
||||
rows="3"
|
||||
placeholder="Please provide verifiable information supporting your edits."
|
||||
class="text input"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="editor-actions">
|
||||
<Checkbox
|
||||
v-if="user.role !== 'user'"
|
||||
v-tooltip="isApplyDisabled && editing.has('delete') ? 'Delete must be approved by an admin' : null"
|
||||
label="Approve and apply immediately"
|
||||
:checked="apply"
|
||||
:disabled="isApplyDisabled"
|
||||
@change="(checked) => apply = checked"
|
||||
/>
|
||||
|
||||
<!-- we don't want the return key to submit the form -->
|
||||
<button
|
||||
class="button button-primary"
|
||||
type="button"
|
||||
:disabled="editing.size === 0"
|
||||
@click="submit"
|
||||
>
|
||||
<template v-if="apply">Submit</template>
|
||||
<template v-else>Submit for review</template>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, inject } from 'vue';
|
||||
import { format } from 'date-fns';
|
||||
import { computed, inject, ref, useId } from 'vue';
|
||||
|
||||
import EditActors from '#/components/edit/actors.vue';
|
||||
import EditTags from '#/components/edit/tags.vue';
|
||||
import EditMovies from '#/components/edit/movies.vue';
|
||||
import EditTags from '#/components/edit/tags.vue';
|
||||
import Checkbox from '#/components/form/checkbox.vue';
|
||||
|
||||
import { post } from '#/src/api.js';
|
||||
@@ -259,6 +14,7 @@ const pageContext = inject('pageContext');
|
||||
|
||||
const user = pageContext.user;
|
||||
const scene = ref(pageContext.pageProps.scene);
|
||||
const applyTooltipId = useId();
|
||||
|
||||
const fields = computed(() => [
|
||||
{
|
||||
@@ -423,12 +179,258 @@ async function submit() {
|
||||
submitted.value = true;
|
||||
|
||||
// scene.value = await get(`/scenes/${scene.value.id}`);
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="editor">
|
||||
<p
|
||||
v-if="submitted"
|
||||
class="submitted"
|
||||
>
|
||||
<template v-if="apply">Your revision has been submitted. Thank you for your contribution!</template>
|
||||
<template v-else>Your revision has been submitted for review. Thank you for your contribution!</template>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a
|
||||
:href="`/scene/${scene.id}/${scene.slug}`"
|
||||
class="link"
|
||||
>Return to scene</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/scene/edit/${scene.id}`"
|
||||
class="link"
|
||||
>Make another edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/scene/revs/${scene.id}/${scene.slug}`"
|
||||
class="link"
|
||||
>Go to scene revisions</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a
|
||||
:href="`/user/${user.username}/revisions/scenes`"
|
||||
class="link"
|
||||
>Go to user revisions</a>
|
||||
</li>
|
||||
|
||||
<li v-if="user.role !== 'user'">
|
||||
<a
|
||||
href="/admin/revisions/scenes"
|
||||
class="link"
|
||||
>Go to revisions admin</a>
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
|
||||
<form
|
||||
v-else
|
||||
@submit.prevent
|
||||
>
|
||||
<div class="editor-header">
|
||||
<h2 class="heading ellipsis">Edit scene #{{ scene.id }} - {{ scene.title }}</h2>
|
||||
|
||||
<a
|
||||
:href="`/scene/${scene.id}/${scene.slug}`"
|
||||
target="_blank"
|
||||
class="link noshrink"
|
||||
>Go to scene</a>
|
||||
</div>
|
||||
|
||||
<ul class="nolist">
|
||||
<li
|
||||
v-for="item in fields"
|
||||
:key="`item-${item.key}`"
|
||||
class="row"
|
||||
>
|
||||
<div class="item-header">
|
||||
<div class="key">
|
||||
{{ item.label || item.key }}
|
||||
|
||||
<Icon
|
||||
v-if="item.note"
|
||||
v-tooltip="{ content: item.note, ariaId: `field-note-${item.key}` }"
|
||||
icon="info2"
|
||||
class="item-note noselect"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="item-actions">
|
||||
<Icon
|
||||
v-if="!item.forced"
|
||||
icon="pencil5"
|
||||
class="noselect"
|
||||
:class="{ active: editing.has(item.key) }"
|
||||
@click="toggleField(item)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
class="value"
|
||||
:class="{ disabled: !editing.has(item.key) }"
|
||||
>
|
||||
<EditActors
|
||||
v-if="item.type === 'actors'"
|
||||
:scene="scene"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@actors="(actors) => { edits.actors = actors; }"
|
||||
/>
|
||||
|
||||
<EditTags
|
||||
v-if="item.type === 'tags'"
|
||||
:scene="scene"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@tags="(tags) => { edits.tags = tags; }"
|
||||
/>
|
||||
|
||||
<EditMovies
|
||||
v-if="item.type === 'movies'"
|
||||
:scene="scene"
|
||||
:item="item"
|
||||
:edits="edits"
|
||||
:editing="editing"
|
||||
@movies="(movies) => { edits.movies = movies; }"
|
||||
/>
|
||||
|
||||
<input
|
||||
v-if="item.type === 'string'"
|
||||
v-model="edits[item.key]"
|
||||
class="string input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<textarea
|
||||
v-if="item.type === 'text'"
|
||||
v-model="edits[item.key]"
|
||||
:placeholder="item.placeholder"
|
||||
rows="3"
|
||||
class="text input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
/>
|
||||
|
||||
<Checkbox
|
||||
v-if="item.type === 'checkbox'"
|
||||
:label="item.checkboxLabel"
|
||||
:checked="edits[item.key]"
|
||||
:disabled="!editing.has(item.key)"
|
||||
class="checkbox delete"
|
||||
@change="(checked) => setDelete(checked)"
|
||||
/>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'date'"
|
||||
class="date"
|
||||
>
|
||||
<input
|
||||
v-model="edits[item.key].date"
|
||||
type="datetime-local"
|
||||
class="date input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
|
||||
<select
|
||||
v-if="item.value.precision"
|
||||
v-model="edits[item.key].precision"
|
||||
class="input"
|
||||
:disabled="!editing.has(item.key)"
|
||||
>
|
||||
<option value="minute">Minute</option>
|
||||
<option value="hour">Hour</option>
|
||||
<option value="day">Day</option>
|
||||
<option value="month">Month</option>
|
||||
<option value="year">Year</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="item.type === 'duration'"
|
||||
class="duration"
|
||||
>
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
:value="edits[item.key]?.[0] ?? item.value[0]"
|
||||
min="0"
|
||||
max="100"
|
||||
:disabled="!editing.has(item.key)"
|
||||
@change="setDuration('h', $event)"
|
||||
>H
|
||||
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
:value="edits[item.key]?.[1] ?? item.value[1]"
|
||||
min="0"
|
||||
max="59"
|
||||
:disabled="!editing.has(item.key)"
|
||||
@change="setDuration('m', $event)"
|
||||
>M
|
||||
|
||||
<input
|
||||
type="number"
|
||||
class="input"
|
||||
:value="edits[item.key]?.[2] ?? item.value[2]"
|
||||
min="0"
|
||||
max="59"
|
||||
:disabled="!editing.has(item.key)"
|
||||
@change="setDuration('s', $event)"
|
||||
>S
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="editor-footer">
|
||||
<div class="comment">
|
||||
<textarea
|
||||
v-model="comment"
|
||||
rows="3"
|
||||
placeholder="Please provide verifiable information supporting your edits."
|
||||
class="text input"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="editor-actions">
|
||||
<Checkbox
|
||||
v-if="user.role !== 'user'"
|
||||
v-tooltip="isApplyDisabled && editing.has('delete') ? { content: 'Delete must be approved by an admin', ariaId: applyTooltipId } : null"
|
||||
label="Approve and apply immediately"
|
||||
:checked="apply"
|
||||
:disabled="isApplyDisabled"
|
||||
@change="(checked) => apply = checked"
|
||||
/>
|
||||
|
||||
<!-- we don't want the return key to submit the form -->
|
||||
<button
|
||||
class="button button-primary"
|
||||
type="button"
|
||||
:disabled="editing.size === 0"
|
||||
@click="submit"
|
||||
>
|
||||
<template v-if="apply">Submit</template>
|
||||
<template v-else>Submit for review</template>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.editor {
|
||||
flex-grow: 1;
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const scene = pageContext.pageProps.scene;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="content">
|
||||
<div class="revs-header">
|
||||
@@ -21,15 +30,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const scene = pageContext.pageProps.scene;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 1rem;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { fetchScenesById, fetchSceneRevisions } from '#/src/scenes.js';
|
||||
import { fetchSceneRevisions, fetchScenesById } from '#/src/scenes.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const [scene] = await fetchScenesById([Number(pageContext.routeParams.sceneId)], {
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
<script setup>
|
||||
// import { inject } from 'vue';
|
||||
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
|
||||
// const pageContext = inject('pageContext');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="updates">
|
||||
<Scenes
|
||||
@@ -8,14 +16,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// import { inject } from 'vue';
|
||||
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
|
||||
// const pageContext = inject('pageContext');
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.updates {
|
||||
display: flex;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getCampaignIndex, getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const [
|
||||
|
||||
@@ -1,3 +1,26 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
import EntityTile from '#/components/entities/tile.vue';
|
||||
import MovieTile from '#/components/movies/tile.vue';
|
||||
import SceneTile from '#/components/scenes/tile.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const {
|
||||
actors,
|
||||
scenes,
|
||||
movies,
|
||||
entities,
|
||||
actorTotal,
|
||||
sceneTotal,
|
||||
movieTotal,
|
||||
} = pageContext.pageProps;
|
||||
|
||||
const query = pageContext.urlParsed.search.q;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="row">
|
||||
@@ -104,29 +127,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
import SceneTile from '#/components/scenes/tile.vue';
|
||||
import MovieTile from '#/components/movies/tile.vue';
|
||||
import EntityTile from '#/components/entities/tile.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const {
|
||||
actors,
|
||||
scenes,
|
||||
movies,
|
||||
entities,
|
||||
actorTotal,
|
||||
sceneTotal,
|
||||
movieTotal,
|
||||
} = pageContext.pageProps;
|
||||
|
||||
const query = pageContext.urlParsed.search.q;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { fetchActors } from '#/src/actors.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { fetchEntities } from '#/src/entities.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateActorsQuery } from '#/src/web/actors.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const [searchScenes, searchActors, searchMovies, entities] = await Promise.all([
|
||||
|
||||
@@ -1,3 +1,20 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
import SceneTile from '#/components/scenes/tile.vue';
|
||||
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import Player from '#/components/video/player.vue';
|
||||
import getPath from '#/src/get-path.js';
|
||||
import { formatDate, formatDuration } from '#/utils/format.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const serie = pageContext.pageProps.serie;
|
||||
const scenes = pageContext.pageProps.scenes;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="content">
|
||||
@@ -257,23 +274,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import { formatDate, formatDuration } from '#/utils/format.js';
|
||||
import getPath from '#/src/get-path.js';
|
||||
|
||||
import ActorTile from '#/components/actors/tile.vue';
|
||||
import SceneTile from '#/components/scenes/tile.vue';
|
||||
import Player from '#/components/video/player.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const serie = pageContext.pageProps.serie;
|
||||
const scenes = pageContext.pageProps.scenes;
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchSeriesById } from '#/src/series.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { fetchSeriesById } from '#/src/series.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
|
||||
function getTitle(serie) {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup>
|
||||
import Actors from '#/components/actors/actors.vue';
|
||||
import Stash from '#/components/stashes/stash.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Stash>
|
||||
<Actors />
|
||||
</Stash>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Stash from '#/components/stashes/stash.vue';
|
||||
import Actors from '#/components/actors/actors.vue';
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchStashByUsernameAndSlug } from '#/src/stashes.js';
|
||||
import { fetchActors } from '#/src/actors.js';
|
||||
import { curateActorsQuery } from '#/src/web/actors.js';
|
||||
import { HttpError } from '#/src/errors.js';
|
||||
import { fetchStashByUsernameAndSlug } from '#/src/stashes.js';
|
||||
import { curateActorsQuery } from '#/src/web/actors.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
try {
|
||||
@@ -39,7 +39,8 @@ export async function onBeforeRender(pageContext) {
|
||||
},
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof HttpError) {
|
||||
throw render(error.httpCode, error.message);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup>
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Stash from '#/components/stashes/stash.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Stash>
|
||||
<Movies />
|
||||
</Stash>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Stash from '#/components/stashes/stash.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchStashByUsernameAndSlug } from '#/src/stashes.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { HttpError } from '#/src/errors.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { fetchStashByUsernameAndSlug } from '#/src/stashes.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
try {
|
||||
@@ -28,7 +28,8 @@ export async function onBeforeRender(pageContext) {
|
||||
},
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof HttpError) {
|
||||
throw render(error.httpCode, error.message);
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<script setup>
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Stash from '#/components/stashes/stash.vue';
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Stash>
|
||||
<Scenes />
|
||||
</Stash>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import Stash from '#/components/stashes/stash.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
</script>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchStashByUsernameAndSlug } from '#/src/stashes.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { HttpError } from '#/src/errors.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { fetchStashByUsernameAndSlug } from '#/src/stashes.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
try {
|
||||
@@ -29,7 +29,8 @@ export async function onBeforeRender(pageContext) {
|
||||
},
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof HttpError) {
|
||||
throw render(error.httpCode, error.message);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,91 @@
|
||||
<script setup>
|
||||
import { inject, onMounted, ref } from 'vue';
|
||||
|
||||
import Logo from '#/components/tags/logo.vue';
|
||||
import events from '#/src/events.js';
|
||||
import getPath from '#/src/get-path.js';
|
||||
|
||||
import navigate from '#/src/navigate.js';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const showcase = pageContext.pageProps.tagShowcase;
|
||||
|
||||
const categories = ref(null);
|
||||
const content = ref(null);
|
||||
const searchInput = ref(null);
|
||||
const query = ref(pageContext.urlParsed.search.q);
|
||||
|
||||
const categoryTitles = {
|
||||
lgbt: 'LGBT',
|
||||
};
|
||||
|
||||
const activeCategory = ref(null);
|
||||
|
||||
function calculateActiveCategory() {
|
||||
const newCategory = Array.from(document.querySelectorAll('.tags')).reduce((closest, element) => {
|
||||
const { top } = element.getBoundingClientRect();
|
||||
|
||||
if (!closest || Math.abs(top - 200) < Math.abs(closest.top)) { // slight offset to include bottom category
|
||||
return { category: element.dataset.category, top };
|
||||
}
|
||||
|
||||
return closest;
|
||||
}, null).category;
|
||||
|
||||
if (newCategory === activeCategory.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
activeCategory.value = newCategory;
|
||||
|
||||
/* this understandably causes jittering in Firefox, why the need to scroll into the category we're already in?
|
||||
const activeLink = document.querySelector(`a[href="#${activeCategory.value}"]`);
|
||||
|
||||
activeLink.scrollIntoView({
|
||||
inline: 'center',
|
||||
});
|
||||
*/
|
||||
|
||||
navigate(`#${activeCategory.value}`, null, { replace: true });
|
||||
}
|
||||
|
||||
async function search() {
|
||||
navigate('/tags', { q: query.value || undefined }, { redirect: true });
|
||||
}
|
||||
|
||||
function focusSearch() {
|
||||
events.emit('scrollUp'); // scrollIntoView on search input does not reveal it fully
|
||||
searchInput.value?.focus();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
categories.value.addEventListener('wheel', (event) => {
|
||||
categories.value.scrollLeft += event.deltaY;
|
||||
});
|
||||
|
||||
document.querySelector('#content').addEventListener('scroll', () => calculateActiveCategory());
|
||||
|
||||
window.addEventListener('popstate', () => {
|
||||
if (window.location.hash) {
|
||||
const categoryTitle = document.querySelector(window.location.hash);
|
||||
|
||||
activeCategory.value = window.location.hash.slice(1);
|
||||
categoryTitle?.scrollIntoView();
|
||||
}
|
||||
});
|
||||
|
||||
// div doesn't scroll automatically on page load, reset hash to scroll
|
||||
if (window.location.hash) {
|
||||
const hash = window.location.hash;
|
||||
|
||||
window.location.hash = undefined;
|
||||
window.location.hash = hash;
|
||||
|
||||
calculateActiveCategory();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<ul
|
||||
@@ -114,94 +202,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted, inject } from 'vue';
|
||||
|
||||
import navigate from '#/src/navigate.js';
|
||||
import events from '#/src/events.js';
|
||||
import getPath from '#/src/get-path.js';
|
||||
|
||||
import Logo from '#/components/tags/logo.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const showcase = pageContext.pageProps.tagShowcase;
|
||||
|
||||
const categories = ref(null);
|
||||
const content = ref(null);
|
||||
const searchInput = ref(null);
|
||||
const query = ref(pageContext.urlParsed.search.q);
|
||||
|
||||
const categoryTitles = {
|
||||
lgbt: 'LGBT',
|
||||
};
|
||||
|
||||
const activeCategory = ref(null);
|
||||
|
||||
function calculateActiveCategory() {
|
||||
const newCategory = Array.from(document.querySelectorAll('.tags')).reduce((closest, element) => {
|
||||
const { top } = element.getBoundingClientRect();
|
||||
|
||||
if (!closest || Math.abs(top - 200) < Math.abs(closest.top)) { // slight offset to include bottom category
|
||||
return { category: element.dataset.category, top };
|
||||
}
|
||||
|
||||
return closest;
|
||||
}, null).category;
|
||||
|
||||
if (newCategory === activeCategory.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
activeCategory.value = newCategory;
|
||||
|
||||
/* this understandably causes jittering in Firefox, why the need to scroll into the category we're already in?
|
||||
const activeLink = document.querySelector(`a[href="#${activeCategory.value}"]`);
|
||||
|
||||
activeLink.scrollIntoView({
|
||||
inline: 'center',
|
||||
});
|
||||
*/
|
||||
|
||||
navigate(`#${activeCategory.value}`, null, { replace: true });
|
||||
}
|
||||
|
||||
async function search() {
|
||||
navigate('/tags', { q: query.value || undefined }, { redirect: true });
|
||||
}
|
||||
|
||||
function focusSearch() {
|
||||
events.emit('scrollUp'); // scrollIntoView on search input does not reveal it fully
|
||||
searchInput.value?.focus();
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
categories.value.addEventListener('wheel', (event) => {
|
||||
categories.value.scrollLeft += event.deltaY;
|
||||
});
|
||||
|
||||
document.querySelector('#content').addEventListener('scroll', () => calculateActiveCategory());
|
||||
|
||||
window.addEventListener('popstate', () => {
|
||||
if (window.location.hash) {
|
||||
const categoryTitle = document.querySelector(window.location.hash);
|
||||
|
||||
activeCategory.value = window.location.hash.slice(1);
|
||||
categoryTitle?.scrollIntoView();
|
||||
}
|
||||
});
|
||||
|
||||
// div doesn't scroll automatically on page load, reset hash to scroll
|
||||
if (window.location.hash) {
|
||||
const hash = window.location.hash;
|
||||
|
||||
window.location.hash = undefined;
|
||||
window.location.hash = hash;
|
||||
|
||||
calculateActiveCategory();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page {
|
||||
display: flex;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { fetchTags, fetchTagsById } from '#/src/tags.js';
|
||||
import { censor } from '#/src/censor.js';
|
||||
import { fetchTags, fetchTagsById } from '#/src/tags.js';
|
||||
|
||||
const tagSlugs = {
|
||||
popular: [
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Domains from '#/components/domains/domains.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
import Photos from '#/components/tags/photos.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { tag, description } = pageContext.pageProps;
|
||||
|
||||
const domain = pageContext.routeParams.domain;
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="header">
|
||||
@@ -39,21 +54,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
|
||||
import Photos from '#/components/tags/photos.vue';
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
import Movies from '#/components/movies/movies.vue';
|
||||
import Domains from '#/components/domains/domains.vue';
|
||||
import Heart from '#/components/stashes/heart.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
const { tag, description } = pageContext.pageProps;
|
||||
|
||||
const domain = pageContext.routeParams.domain;
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.description .link {
|
||||
color: var(--primary);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { redirect } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import markdownIt from 'markdown-it';
|
||||
import markdownItClass from '@toycode/markdown-it-class';
|
||||
import markdownIt from 'markdown-it';
|
||||
import { redirect } from 'vike/abort';
|
||||
|
||||
import { fetchTagsById } from '#/src/tags.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { getCampaignIndex, getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { fetchMovies } from '#/src/movies.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { fetchTagsById } from '#/src/tags.js';
|
||||
import { curateMoviesQuery } from '#/src/web/movies.js';
|
||||
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
|
||||
const md = markdownIt().use(markdownItClass, { a: 'link' });
|
||||
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
<script setup>
|
||||
// import { inject } from 'vue';
|
||||
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
|
||||
// const pageContext = inject('pageContext');
|
||||
// const query = Object.hasOwn(pageContext.urlParsed.search, 'q');
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="updates">
|
||||
<Scenes
|
||||
@@ -8,15 +17,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
// import { inject } from 'vue';
|
||||
|
||||
import Scenes from '#/components/scenes/scenes.vue';
|
||||
|
||||
// const pageContext = inject('pageContext');
|
||||
// const query = Object.hasOwn(pageContext.urlParsed.search, 'q');
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.updates {
|
||||
display: flex;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getCampaignIndex, getRandomCampaigns } from '#/src/campaigns.js';
|
||||
import { fetchScenes } from '#/src/scenes.js';
|
||||
import { curateScenesQuery } from '#/src/web/scenes.js';
|
||||
import { getRandomCampaigns, getCampaignIndex } from '#/src/campaigns.js';
|
||||
|
||||
export async function onBeforeRender(pageContext) {
|
||||
const withQuery = Object.hasOwn(pageContext.urlParsed.search, 'q');
|
||||
|
||||
@@ -1,3 +1,28 @@
|
||||
<script setup>
|
||||
import { formatDistanceStrict } from 'date-fns';
|
||||
import { inject, ref } from 'vue';
|
||||
|
||||
import mockupRelease from '#/assets/mockup-release.ts';
|
||||
import Alerts from '#/components/alerts/alerts.vue';
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
import Summaries from '#/components/scenes/summaries.vue';
|
||||
import Stashes from '#/components/stashes/stashes.vue';
|
||||
|
||||
import ApiKeys from '#/components/user/api-keys.vue';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const section = pageContext.routeParams.section;
|
||||
const domain = pageContext.routeParams.domain;
|
||||
|
||||
const user = pageContext.user;
|
||||
const profile = ref(pageContext.pageProps.profile);
|
||||
|
||||
function scrollHorizontal(event) {
|
||||
event.currentTarget.scrollLeft += event.deltaY; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="page">
|
||||
<div class="profile">
|
||||
@@ -81,31 +106,6 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, inject } from 'vue';
|
||||
import { formatDistanceStrict } from 'date-fns';
|
||||
|
||||
import Stashes from '#/components/stashes/stashes.vue';
|
||||
import Alerts from '#/components/alerts/alerts.vue';
|
||||
import Summaries from '#/components/scenes/summaries.vue';
|
||||
import Revisions from '#/components/edit/revisions.vue';
|
||||
import ApiKeys from '#/components/user/api-keys.vue';
|
||||
|
||||
import mockupRelease from '#/assets/mockup-release.ts';
|
||||
|
||||
const pageContext = inject('pageContext');
|
||||
|
||||
const section = pageContext.routeParams.section;
|
||||
const domain = pageContext.routeParams.domain;
|
||||
|
||||
const user = pageContext.user;
|
||||
const profile = ref(pageContext.pageProps.profile);
|
||||
|
||||
function scrollHorizontal(event) {
|
||||
event.currentTarget.scrollLeft += event.deltaY; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.profile-section {
|
||||
.section-header {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { render } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { render } from 'vike/abort';
|
||||
|
||||
import { fetchUser } from '#/src/users.js';
|
||||
import { fetchUserKeys } from '#/src/auth.js';
|
||||
import { fetchUserStashes } from '#/src/stashes.js';
|
||||
import { fetchAlerts } from '#/src/alerts.js';
|
||||
import { fetchSceneRevisions } from '#/src/scenes.js';
|
||||
import { fetchActorRevisions } from '#/src/actors.js';
|
||||
import { fetchAlerts } from '#/src/alerts.js';
|
||||
import { fetchUserKeys } from '#/src/auth.js';
|
||||
import { fetchSceneRevisions } from '#/src/scenes.js';
|
||||
import { fetchUserStashes } from '#/src/stashes.js';
|
||||
import { fetchUser } from '#/src/users.js';
|
||||
|
||||
async function fetchRevisions(pageContext) {
|
||||
if (pageContext.routeParams.username !== pageContext.user?.username) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { redirect } from 'vike/abort'; /* eslint-disable-line import/extensions */
|
||||
import { match } from 'path-to-regexp';
|
||||
import { redirect } from 'vike/abort';
|
||||
|
||||
const path = '/user/:username/:section?/:domain?';
|
||||
const urlMatch = match(path, { decode: decodeURIComponent });
|
||||
|
||||
Reference in New Issue
Block a user