Added URL as an editable scene field. Fixed plain URL permissions on scene page.
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
</div>
|
||||
|
||||
<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')}`"
|
||||
target="_blank"
|
||||
class="date nolink"
|
||||
@@ -441,6 +441,7 @@ 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 ActorTile from '#/components/actors/tile.vue';
|
||||
|
||||
@@ -253,6 +253,7 @@ import EditMovies from '#/components/edit/movies.vue';
|
||||
import Checkbox from '#/components/form/checkbox.vue';
|
||||
|
||||
import { post } from '#/src/api.js';
|
||||
import verifyAbility from '#/utils/verify-ability.js';
|
||||
|
||||
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.',
|
||||
},
|
||||
{
|
||||
key: 'movies',
|
||||
type: 'movies',
|
||||
value: scene.value.movies,
|
||||
key: 'url',
|
||||
type: 'string',
|
||||
value: scene.value.url,
|
||||
enabled: verifyAbility(user, 'scene', 'update'),
|
||||
},
|
||||
{
|
||||
key: 'title',
|
||||
@@ -316,23 +318,26 @@ const fields = computed(() => [
|
||||
precision: scene.value.productionDatePrecision, // not currently implemented
|
||||
},
|
||||
},
|
||||
...(user.role === 'user'
|
||||
? []
|
||||
: [
|
||||
{
|
||||
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.',
|
||||
value: scene.value.comment,
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
type: 'checkbox',
|
||||
checkboxLabel: 'Remove this scene from the database',
|
||||
value: false,
|
||||
},
|
||||
]),
|
||||
]);
|
||||
{
|
||||
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.',
|
||||
value: scene.value.comment,
|
||||
enabled: verifyAbility(user, 'scene', 'update'),
|
||||
},
|
||||
{
|
||||
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) {
|
||||
if (Array.isArray(field.value) && field.simplify !== false) {
|
||||
|
||||
@@ -882,6 +882,7 @@ async function applySceneRevision(revisionIds, reqUser) {
|
||||
'title',
|
||||
'description',
|
||||
'date',
|
||||
'url',
|
||||
'datePrecision',
|
||||
'duration',
|
||||
'productionDate',
|
||||
|
||||
Reference in New Issue
Block a user