2020-01-23 23:45:59 +00:00
|
|
|
<template>
|
2020-06-27 08:31:20 +00:00
|
|
|
<div class="p-tab p-tab-photo-details">
|
|
|
|
<v-container fluid>
|
|
|
|
<v-form lazy-validation dense
|
|
|
|
ref="form" class="p-form-photo-details-meta" accept-charset="UTF-8"
|
|
|
|
@submit.prevent="save">
|
|
|
|
<v-layout row wrap align-top fill-height>
|
|
|
|
<v-flex
|
|
|
|
class="p-photo pa-2"
|
|
|
|
xs12 sm4 md2
|
|
|
|
>
|
|
|
|
<v-card tile
|
|
|
|
class="ma-1 elevation-0"
|
|
|
|
:title="model.Title">
|
|
|
|
<v-img :src="model.thumbnailUrl('tile_500')"
|
|
|
|
aspect-ratio="1"
|
|
|
|
class="accent lighten-2 elevation-0 clickable"
|
|
|
|
@click.exact="openPhoto()"
|
|
|
|
v-touch="{left, right}"
|
|
|
|
>
|
|
|
|
<v-layout
|
|
|
|
slot="placeholder"
|
|
|
|
fill-height
|
|
|
|
align-center
|
|
|
|
justify-center
|
|
|
|
ma-0
|
|
|
|
>
|
|
|
|
<v-progress-circular indeterminate
|
|
|
|
color="accent lighten-5"></v-progress-circular>
|
|
|
|
</v-layout>
|
|
|
|
</v-img>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
</v-card>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm8 md10 fill-height>
|
|
|
|
<v-layout row wrap>
|
|
|
|
<v-flex xs12 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
:rules="[textRule]"
|
|
|
|
hide-details
|
|
|
|
:label="labels.title"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
browser-autocomplete="off"
|
|
|
|
v-model="model.Title"
|
|
|
|
class="input-title"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
<v-flex xs12 sm6 md2 pa-2>
|
|
|
|
<v-autocomplete
|
|
|
|
@change="updateTime"
|
|
|
|
:disabled="disabled"
|
2020-07-06 08:32:37 +00:00
|
|
|
:error="invalidDate"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="$gettext('Day')"
|
2020-07-06 08:32:37 +00:00
|
|
|
browser-autocomplete="off"
|
2020-07-06 05:41:33 +00:00
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Day"
|
|
|
|
:items="options.Days()"
|
|
|
|
class="input-day">
|
|
|
|
</v-autocomplete>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm6 md2 pa-2>
|
|
|
|
<v-autocomplete
|
|
|
|
@change="updateTime"
|
|
|
|
:disabled="disabled"
|
2020-07-06 08:32:37 +00:00
|
|
|
:error="invalidDate"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="$gettext('Month')"
|
2020-07-06 08:32:37 +00:00
|
|
|
browser-autocomplete="off"
|
2020-07-06 05:41:33 +00:00
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Month"
|
|
|
|
:items="options.Months()"
|
|
|
|
class="input-month">
|
|
|
|
</v-autocomplete>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm6 md2 pa-2>
|
|
|
|
<v-autocomplete
|
|
|
|
@change="updateTime"
|
|
|
|
:disabled="disabled"
|
2020-07-06 08:32:37 +00:00
|
|
|
:error="invalidDate"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="$gettext('Year')"
|
2020-07-06 08:32:37 +00:00
|
|
|
browser-autocomplete="off"
|
2020-07-06 05:41:33 +00:00
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Year"
|
|
|
|
:items="options.Years()"
|
|
|
|
class="input-year">
|
|
|
|
</v-autocomplete>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
<v-flex xs12 sm6 md2 class="pa-2">
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
2020-07-06 08:32:37 +00:00
|
|
|
@change="updateTime"
|
|
|
|
v-model="localTime"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="$gettext('Local Time')"
|
2020-07-06 08:32:37 +00:00
|
|
|
browser-autocomplete="off"
|
|
|
|
hide-details return-masked-value
|
|
|
|
mask="##:##:##"
|
2020-06-27 08:31:20 +00:00
|
|
|
color="secondary-dark"
|
|
|
|
class="input-local-time"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-07-06 05:41:33 +00:00
|
|
|
|
|
|
|
<v-flex xs12 sm6 md2 pa-2>
|
2020-07-05 13:34:49 +00:00
|
|
|
<v-text-field
|
2020-06-27 08:31:20 +00:00
|
|
|
:disabled="disabled"
|
2020-07-05 13:34:49 +00:00
|
|
|
@change="updateTime"
|
2020-07-06 08:32:37 +00:00
|
|
|
v-model="utcTime"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="$gettext('Time UTC')"
|
2020-07-06 08:32:37 +00:00
|
|
|
browser-autocomplete="off"
|
|
|
|
readonly hide-details return-masked-value
|
2020-07-05 13:34:49 +00:00
|
|
|
mask="##:##:##"
|
|
|
|
color="secondary-dark"
|
|
|
|
class="input-utc-time"
|
|
|
|
></v-text-field>
|
2020-06-27 08:31:20 +00:00
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
<v-flex xs12 sm6 md2 class="pa-2">
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-autocomplete
|
|
|
|
@change="updateTime"
|
|
|
|
:disabled="disabled"
|
|
|
|
:label="labels.timezone"
|
2020-07-06 08:32:37 +00:00
|
|
|
browser-autocomplete="off"
|
2020-06-27 08:31:20 +00:00
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
item-value="ID"
|
|
|
|
item-text="Name"
|
|
|
|
v-model="model.TimeZone"
|
2020-07-02 19:06:10 +00:00
|
|
|
:items="options.TimeZones()"
|
2020-06-27 08:31:20 +00:00
|
|
|
class="input-timezone">
|
|
|
|
</v-autocomplete>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
<v-flex xs12 sm6 md4 class="pa-2">
|
|
|
|
<v-autocomplete
|
2020-06-27 08:31:20 +00:00
|
|
|
:disabled="disabled"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="labels.country"
|
2020-06-27 08:31:20 +00:00
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
color="secondary-dark"
|
2020-07-06 05:41:33 +00:00
|
|
|
item-value="Code"
|
|
|
|
item-text="Name"
|
|
|
|
v-model="model.Country"
|
|
|
|
:items="countries"
|
|
|
|
class="input-country">
|
|
|
|
</v-autocomplete>
|
2020-06-27 08:31:20 +00:00
|
|
|
</v-flex>
|
2020-04-15 08:00:39 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
<v-flex xs12 sm6 md2 class="pa-2">
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="labels.altitude"
|
2020-06-27 08:31:20 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-07-06 05:41:33 +00:00
|
|
|
v-model="model.Altitude"
|
|
|
|
class="input-altitude"
|
2020-06-27 08:31:20 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-04-15 08:00:39 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="labels.latitude"
|
2020-06-27 08:31:20 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-07-06 05:41:33 +00:00
|
|
|
v-model="model.Lat"
|
|
|
|
class="input-latitude"
|
2020-06-27 08:31:20 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-06-27 08:31:20 +00:00
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
2020-07-06 05:41:33 +00:00
|
|
|
:label="labels.longitude"
|
|
|
|
placeholder=""
|
2020-06-27 08:31:20 +00:00
|
|
|
color="secondary-dark"
|
2020-07-06 05:41:33 +00:00
|
|
|
v-model="model.Lng"
|
|
|
|
class="input-longitude"
|
|
|
|
></v-text-field>
|
2020-06-27 08:31:20 +00:00
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 md6 pa-2 class="p-camera-select">
|
|
|
|
<v-select
|
|
|
|
:disabled="disabled"
|
|
|
|
:label="labels.camera"
|
|
|
|
browser-autocomplete="off"
|
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
item-value="ID"
|
|
|
|
item-text="Name"
|
|
|
|
v-model="model.CameraID"
|
|
|
|
:items="cameraOptions"
|
|
|
|
class="input-camera">
|
|
|
|
</v-select>
|
|
|
|
</v-flex>
|
2020-04-30 07:38:00 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
label="ISO"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Iso"
|
|
|
|
class="input-iso"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="labels.exposure"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Exposure"
|
|
|
|
class="input-exposure"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 md6 pa-2 class="p-lens-select">
|
|
|
|
<v-select
|
|
|
|
:disabled="disabled"
|
|
|
|
:label="labels.lens"
|
|
|
|
browser-autocomplete="off"
|
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
item-value="ID"
|
|
|
|
item-text="Name"
|
|
|
|
v-model="model.LensID"
|
|
|
|
:items="lensOptions"
|
|
|
|
class="input-lens">
|
|
|
|
</v-select>
|
|
|
|
</v-flex>
|
2020-04-30 07:38:00 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="labels.fnumber"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.FNumber"
|
|
|
|
class="input-fnumber"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-26 17:23:05 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="labels.focallength"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.FocalLength"
|
|
|
|
class="input-focal-length"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-textarea
|
|
|
|
:disabled="disabled"
|
|
|
|
:rules="[textRule]"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
auto-grow
|
|
|
|
:label="labels.subject"
|
|
|
|
placeholder=""
|
|
|
|
:rows="1"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Details.Subject"
|
|
|
|
class="input-subject"
|
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
:rules="[textRule]"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="labels.artist"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Details.Artist"
|
|
|
|
class="input-artist"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-03-26 08:41:33 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
|
|
|
:disabled="disabled"
|
|
|
|
:rules="[textRule]"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
:label="labels.copyright"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Details.Copyright"
|
|
|
|
class="input-copyright"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-03-26 08:41:33 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-textarea
|
|
|
|
:disabled="disabled"
|
|
|
|
:rules="[textRule]"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
auto-grow
|
|
|
|
:label="labels.license"
|
|
|
|
placeholder=""
|
|
|
|
:rows="1"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Details.License"
|
|
|
|
class="input-license"
|
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
2020-03-25 11:39:07 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 class="pa-2">
|
|
|
|
<v-textarea
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
auto-grow
|
|
|
|
:label="labels.description"
|
|
|
|
placeholder=""
|
|
|
|
:rows="1"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Description"
|
|
|
|
class="input-description"
|
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 md6 class="pa-2">
|
|
|
|
<v-textarea
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
auto-grow
|
|
|
|
:label="labels.keywords"
|
|
|
|
placeholder=""
|
|
|
|
:rows="1"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Details.Keywords"
|
|
|
|
class="input-keywords"
|
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 md6 class="pa-2">
|
|
|
|
<v-textarea
|
|
|
|
:disabled="disabled"
|
|
|
|
hide-details
|
|
|
|
browser-autocomplete="off"
|
|
|
|
auto-grow
|
|
|
|
:label="labels.notes"
|
|
|
|
placeholder=""
|
|
|
|
:rows="1"
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.Details.Notes"
|
|
|
|
class="input-notes"
|
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<v-flex xs12 text-xs-right class="pt-3" v-if="!disabled">
|
|
|
|
<v-btn @click.stop="close" depressed color="secondary-light"
|
|
|
|
class="p-photo-dialog-close">
|
|
|
|
<translate key="Close">Close</translate>
|
|
|
|
</v-btn>
|
|
|
|
<v-btn color="secondary-dark" depressed dark @click.stop="save(false)"
|
|
|
|
class="p-photo-dialog-confirm action-approve">
|
|
|
|
<span v-if="$config.feature('review') && model.Quality < 3"><translate key="Approve">Approve</translate></span>
|
|
|
|
<span v-else><translate key="Apply">Apply</translate></span>
|
|
|
|
</v-btn>
|
|
|
|
<v-btn color="secondary-dark" depressed dark @click.stop="save(true)"
|
|
|
|
class="p-photo-dialog-confirm hidden-xs-only action-ok">
|
|
|
|
<span><translate key="OK">OK</translate></span>
|
|
|
|
<v-icon right dark>done</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
</v-flex>
|
|
|
|
</v-layout>
|
|
|
|
</v-flex>
|
|
|
|
</v-layout>
|
2020-04-15 08:00:39 +00:00
|
|
|
|
2020-06-27 08:31:20 +00:00
|
|
|
<div class="mt-5"></div>
|
|
|
|
</v-form>
|
|
|
|
</v-container>
|
|
|
|
</div>
|
2020-01-23 23:45:59 +00:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import {DateTime} from "luxon";
|
2020-04-18 21:20:54 +00:00
|
|
|
import countries from "resources/countries.json";
|
2020-04-21 14:46:08 +00:00
|
|
|
import Thumb from "model/thumb";
|
2020-07-03 16:11:31 +00:00
|
|
|
import * as options from "resources/options";
|
2020-07-06 08:32:37 +00:00
|
|
|
import Event from "pubsub-js";
|
2020-01-23 23:45:59 +00:00
|
|
|
|
|
|
|
export default {
|
2020-06-16 10:51:46 +00:00
|
|
|
name: 'p-tab-photo-details',
|
2020-01-23 23:45:59 +00:00
|
|
|
props: {
|
|
|
|
model: Object,
|
2020-07-06 08:32:37 +00:00
|
|
|
uid: String,
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2020-04-13 17:45:38 +00:00
|
|
|
disabled: !this.$config.feature("edit"),
|
2020-01-23 23:45:59 +00:00
|
|
|
config: this.$config.values,
|
|
|
|
all: {
|
2020-07-02 13:43:28 +00:00
|
|
|
colors: [{label: this.$gettext("Unknown"), name: ""}],
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-04-26 12:31:33 +00:00
|
|
|
readonly: this.$config.get("readonly"),
|
2020-01-23 23:45:59 +00:00
|
|
|
options: options,
|
2020-04-18 21:20:54 +00:00
|
|
|
countries: countries,
|
2020-01-23 23:45:59 +00:00
|
|
|
labels: {
|
|
|
|
search: this.$gettext("Search"),
|
|
|
|
view: this.$gettext("View"),
|
|
|
|
country: this.$gettext("Country"),
|
|
|
|
camera: this.$gettext("Camera"),
|
|
|
|
lens: this.$gettext("Lens"),
|
|
|
|
year: this.$gettext("Year"),
|
|
|
|
color: this.$gettext("Color"),
|
|
|
|
category: this.$gettext("Category"),
|
|
|
|
sort: this.$gettext("Sort By"),
|
|
|
|
before: this.$gettext("Taken before"),
|
|
|
|
after: this.$gettext("Taken after"),
|
|
|
|
language: this.$gettext("Language"),
|
|
|
|
timezone: this.$gettext("Time Zone"),
|
2020-06-15 10:45:53 +00:00
|
|
|
title: this.$gettext("Title"),
|
|
|
|
latitude: this.$gettext("Latitude"),
|
|
|
|
longitude: this.$gettext("Longitude"),
|
|
|
|
altitude: this.$gettext("Altitude (m)"),
|
|
|
|
exposure: this.$gettext("Exposure"),
|
|
|
|
fnumber: this.$gettext("F Number"),
|
|
|
|
focallength: this.$gettext("Focal Length"),
|
|
|
|
subject: this.$gettext("Subject"),
|
|
|
|
artist: this.$gettext("Artist"),
|
|
|
|
copyright: this.$gettext("Copyright"),
|
|
|
|
license: this.$gettext("License"),
|
|
|
|
description: this.$gettext("Description"),
|
|
|
|
keywords: this.$gettext("Keywords"),
|
|
|
|
notes: this.$gettext("Notes"),
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
|
|
|
showDatePicker: false,
|
|
|
|
showTimePicker: false,
|
2020-07-06 08:32:37 +00:00
|
|
|
invalidDate: false,
|
|
|
|
utcTime: "",
|
2020-07-06 05:41:33 +00:00
|
|
|
localTime: "",
|
2020-04-26 12:31:33 +00:00
|
|
|
textRule: v => v.length <= this.$config.get('clip') || this.$gettext("Text too long"),
|
2020-01-23 23:45:59 +00:00
|
|
|
};
|
|
|
|
},
|
2020-07-06 08:32:37 +00:00
|
|
|
created() {
|
|
|
|
this.updateTime();
|
|
|
|
},
|
2020-04-18 21:20:54 +00:00
|
|
|
watch: {
|
2020-07-06 05:41:33 +00:00
|
|
|
model() {
|
2020-07-06 08:32:37 +00:00
|
|
|
this.updateTime();
|
|
|
|
},
|
|
|
|
uid() {
|
2020-07-06 05:41:33 +00:00
|
|
|
this.updateTime();
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-04-18 21:20:54 +00:00
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
cameraOptions() {
|
|
|
|
return this.config.cameras;
|
|
|
|
},
|
|
|
|
lensOptions() {
|
|
|
|
return this.config.lenses;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateTime() {
|
2020-07-06 08:32:37 +00:00
|
|
|
if (!this.model.hasId()) {
|
|
|
|
return;
|
2020-01-26 16:47:52 +00:00
|
|
|
}
|
|
|
|
|
2020-07-06 08:32:37 +00:00
|
|
|
let localDate = this.model.localDate(this.localTime);
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-07-06 08:32:37 +00:00
|
|
|
this.invalidDate = !localDate.isValid
|
2020-01-30 05:17:02 +00:00
|
|
|
|
2020-07-06 08:32:37 +00:00
|
|
|
if(this.invalidDate) {
|
|
|
|
return;
|
2020-01-30 05:17:02 +00:00
|
|
|
}
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-07-06 08:32:37 +00:00
|
|
|
const utcDate = localDate.toUTC();
|
|
|
|
|
|
|
|
this.localTime = localDate.toFormat("HH:mm:ss");
|
|
|
|
this.utcTime = utcDate.toFormat("HH:mm:ss");
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-07-06 05:41:33 +00:00
|
|
|
if(this.model.Day === 0) {
|
|
|
|
this.model.Day = parseInt(localDate.toFormat("d"));
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.model.Month === 0) {
|
|
|
|
this.model.Month = parseInt(localDate.toFormat("L"));
|
|
|
|
}
|
|
|
|
|
|
|
|
if(this.model.Year === 0) {
|
|
|
|
this.model.Year = parseInt(localDate.toFormat("y"));
|
|
|
|
}
|
|
|
|
|
2020-07-06 08:32:37 +00:00
|
|
|
this.model.TakenAtLocal = localDate.toISO({
|
|
|
|
suppressMilliseconds: true,
|
|
|
|
includeOffset: false,
|
|
|
|
}) + "Z";
|
|
|
|
|
|
|
|
this.model.TakenAt = localDate.toUTC().toISO({
|
|
|
|
suppressMilliseconds: true,
|
|
|
|
includeOffset: false,
|
|
|
|
}) + "Z";
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-04-16 14:30:45 +00:00
|
|
|
left() {
|
|
|
|
this.$emit('next');
|
|
|
|
},
|
|
|
|
right() {
|
|
|
|
this.$emit('prev');
|
|
|
|
},
|
2020-01-23 23:45:59 +00:00
|
|
|
openPhoto() {
|
2020-04-21 14:46:08 +00:00
|
|
|
this.$viewer.show(Thumb.fromFiles([this.model]), 0)
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-03-30 13:07:05 +00:00
|
|
|
save(close) {
|
2020-07-06 08:32:37 +00:00
|
|
|
if(this.invalidDate) {
|
|
|
|
this.$notify.error(this.$gettext("Invalid date"));
|
|
|
|
return;
|
|
|
|
}
|
2020-01-24 09:25:08 +00:00
|
|
|
|
2020-03-30 13:07:05 +00:00
|
|
|
this.model.update().then(() => {
|
2020-04-16 14:30:45 +00:00
|
|
|
if (close) {
|
|
|
|
this.$emit('close');
|
|
|
|
}
|
2020-07-06 08:32:37 +00:00
|
|
|
|
|
|
|
this.updateTime();
|
2020-03-30 13:07:05 +00:00
|
|
|
});
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-01-29 14:28:20 +00:00
|
|
|
close() {
|
2020-03-30 13:07:05 +00:00
|
|
|
this.$emit('close');
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|