Added URL as an editable scene field. Fixed plain URL permissions on scene page.

This commit is contained in:
2026-07-05 04:56:57 +02:00
parent 8674c1d361
commit 040dca3829
3 changed files with 28 additions and 21 deletions

View File

@@ -52,7 +52,7 @@
</div> </div>
<Link <Link
:href="user?.abilities?.some((ability) => ability.subject === 'plainUrls') ? scene.url : scene.watchUrl" :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')}`" :title="scene.date ? formatDate(scene.date.toISOString(), 'y-MM-dd hh:mm') : `Release date unknown, added ${formatDate(scene.createdAt, 'y-MM-dd')}`"
target="_blank" target="_blank"
class="date nolink" class="date nolink"
@@ -441,6 +441,7 @@ import { formatDate, formatDuration } from '#/utils/format.js';
import events from '#/src/events.js'; import events from '#/src/events.js';
import processSummaryTemplate from '#/utils/process-summary-template.js'; import processSummaryTemplate from '#/utils/process-summary-template.js';
import getPath from '#/src/get-path.js'; import getPath from '#/src/get-path.js';
import verifyAbility from '#/utils/verify-ability.js';
import Banner from '#/components/media/banner.vue'; import Banner from '#/components/media/banner.vue';
import ActorTile from '#/components/actors/tile.vue'; import ActorTile from '#/components/actors/tile.vue';

View File

@@ -253,6 +253,7 @@ import EditMovies from '#/components/edit/movies.vue';
import Checkbox from '#/components/form/checkbox.vue'; import Checkbox from '#/components/form/checkbox.vue';
import { post } from '#/src/api.js'; import { post } from '#/src/api.js';
import verifyAbility from '#/utils/verify-ability.js';
const pageContext = inject('pageContext'); const pageContext = inject('pageContext');
@@ -273,9 +274,10 @@ const fields = computed(() => [
note: 'Actor-specific tags should only be used where confusion is reasonable, such as group scenes in which some perform anal, and some don\'t.', note: 'Actor-specific tags should only be used where confusion is reasonable, such as group scenes in which some perform anal, and some don\'t.',
}, },
{ {
key: 'movies', key: 'url',
type: 'movies', type: 'string',
value: scene.value.movies, value: scene.value.url,
enabled: verifyAbility(user, 'scene', 'update'),
}, },
{ {
key: 'title', key: 'title',
@@ -316,23 +318,26 @@ const fields = computed(() => [
precision: scene.value.productionDatePrecision, // not currently implemented precision: scene.value.productionDatePrecision, // not currently implemented
}, },
}, },
...(user.role === 'user' {
? [] key: 'movies',
: [ type: 'movies',
{ value: scene.value.movies,
key: 'comment', },
type: 'text', {
placeholder: 'Do NOT use this field to summarize and clarify your revision. This field is for permanent notes and comments regarding the scene or database entry itself.', key: 'comment',
value: scene.value.comment, type: 'text',
}, placeholder: 'Do NOT use this field to summarize and clarify your revision. This field is for permanent notes and comments regarding the scene or database entry itself.',
{ value: scene.value.comment,
key: 'delete', enabled: verifyAbility(user, 'scene', 'update'),
type: 'checkbox', },
checkboxLabel: 'Remove this scene from the database', {
value: false, key: 'delete',
}, type: 'checkbox',
]), checkboxLabel: 'Remove this scene from the database',
]); value: false,
enabled: verifyAbility(user, 'scene', 'delete'),
},
].filter((field) => field.enabled !== false));
function simplifyArray(field) { function simplifyArray(field) {
if (Array.isArray(field.value) && field.simplify !== false) { if (Array.isArray(field.value) && field.simplify !== false) {

View File

@@ -882,6 +882,7 @@ async function applySceneRevision(revisionIds, reqUser) {
'title', 'title',
'description', 'description',
'date', 'date',
'url',
'datePrecision', 'datePrecision',
'duration', 'duration',
'productionDate', 'productionDate',