Commit 5c95f2b9 authored by anton's avatar anton
Browse files

Optional override for selector value on media/create

parent bae2ab52
......@@ -482,7 +482,9 @@ export default {
},
create: {
title: 'Add Media',
caption: 'Add a new media to your timeline.'
caption: 'Add a new media to your timeline.',
default_selector_notice: 'Now using the video publishing date (if available), or the current date. Use the calendar to set a custom date and time for the video.',
override_selector_notice: 'You have set a custom date for the video.'
},
sync: {
title: 'Sync Media',
......
......@@ -4,8 +4,12 @@
content-block(:position="'first'")
headline(:content="$t('routes.piecemaker.media.create.title')")
.q-mb-lg
q-alert(color="info" v-if="!selectorValue") {{ $t('routes.piecemaker.media.create.default_selector_notice') }}
q-alert(color="info" :actions="actions" v-else) {{ $t('routes.piecemaker.media.create.override_selector_notice') }}
content-paragraph(:position="'first'")
calendar-time-main(v-if="mayAdd", :datetime="selectorValue", @update="onCalendarUpdate")
calendar-time-main(v-if="mayAdd", @update="onCalendarUpdate")
content-paragraph(:position="'last'")
form-main(v-if="mayAdd", v-model="payload", :schema="schema", ref="mediaForm")
......@@ -43,6 +47,14 @@
data () {
const _this = this
return {
actions: [
{
label: this.$t('buttons.reset'),
handler () {
_this.selectorValue = undefined
}
}
],
timeline: undefined,
mayAdd: undefined,
// FIXME: i know this is bullshit!!! (but i hope it works for now)
......@@ -71,11 +83,10 @@
}
})
let
start = _this.selectorValue || DateTime.local().toString(),
start = _this.selectorValue,
end
if (metadata && metadata.publishedAt) {
_this.selectorValue = DateTime.fromISO(metadata.publishedAt, { setZone: true }).toISO()
start = _this.selectorValue
if (!_this.selectorValue && metadata && metadata.publishedAt) {
start = DateTime.fromISO(metadata.publishedAt, { setZone: true }).toISO()
}
else start = DateTime.local().toString()
if (metadata && metadata.duration) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment