2020-01-23 23:45:59 +00:00
|
|
|
<template>
|
2020-01-29 14:28:20 +00:00
|
|
|
<div class="p-tab p-tab-photo-edit-details">
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-container fluid>
|
|
|
|
<v-form lazy-validation dense
|
|
|
|
ref="form" class="p-form-photo-edit-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.PhotoTitle">
|
2020-01-24 00:33:04 +00:00
|
|
|
<v-img :src="model.getThumbnailUrl('tile_500')"
|
2020-01-23 23:45:59 +00:00
|
|
|
aspect-ratio="1"
|
|
|
|
class="accent lighten-2 elevation-0"
|
|
|
|
style="cursor: pointer"
|
|
|
|
@click.exact="openPhoto()"
|
2020-04-16 14:30:45 +00:00
|
|
|
v-touch="{left, right}"
|
2020-01-23 23:45:59 +00:00
|
|
|
>
|
|
|
|
<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>
|
|
|
|
|
|
|
|
</v-card>
|
|
|
|
</v-flex>
|
|
|
|
<v-flex xs12 sm8 md10 fill-height>
|
|
|
|
<v-layout row wrap>
|
|
|
|
<v-flex xs12 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-04-26 12:31:33 +00:00
|
|
|
:rules="[textRule]"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
|
|
|
label="Title"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-23 23:45:59 +00:00
|
|
|
v-model="model.PhotoTitle"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
|
|
|
<v-flex xs12 sm6 md3 pa-2 class="p-date-select">
|
|
|
|
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-26 16:47:52 +00:00
|
|
|
:value="timeLocalFormatted"
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-26 16:47:52 +00:00
|
|
|
label="Local Time"
|
|
|
|
readonly
|
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
></v-text-field>
|
|
|
|
|
|
|
|
</v-flex>
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-flex xs12 sm6 md3 pa-2 class="p-date-select">
|
|
|
|
<v-menu
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
v-model="showTimePicker"
|
|
|
|
:close-on-content-click="false"
|
|
|
|
full-width
|
|
|
|
max-width="290"
|
|
|
|
>
|
|
|
|
<template v-slot:activator="{ on }">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
:value="timeFormatted"
|
2020-01-26 16:47:52 +00:00
|
|
|
label="UTC Time"
|
2020-01-23 23:45:59 +00:00
|
|
|
readonly
|
|
|
|
hide-details
|
|
|
|
v-on="on"
|
|
|
|
color="secondary-dark"
|
|
|
|
></v-text-field>
|
|
|
|
</template>
|
|
|
|
<v-time-picker
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="time"
|
|
|
|
format="24hr"
|
|
|
|
use-seconds
|
|
|
|
@change="showTimePicker = false"
|
|
|
|
></v-time-picker>
|
|
|
|
</v-menu>
|
|
|
|
</v-flex>
|
2020-01-26 17:45:15 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2 p-date-select">
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-menu
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
:close-on-content-click="false"
|
|
|
|
full-width
|
|
|
|
max-width="290"
|
|
|
|
>
|
|
|
|
<template v-slot:activator="{ on }">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
:value="dateFormatted"
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-26 16:47:52 +00:00
|
|
|
label="UTC Date"
|
2020-01-23 23:45:59 +00:00
|
|
|
readonly
|
|
|
|
hide-details
|
|
|
|
v-on="on"
|
|
|
|
color="secondary-dark"
|
|
|
|
></v-text-field>
|
|
|
|
</template>
|
|
|
|
<v-date-picker
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="date"
|
|
|
|
@change="showDatePicker = false"
|
|
|
|
></v-date-picker>
|
|
|
|
</v-menu>
|
|
|
|
</v-flex>
|
|
|
|
|
2020-01-26 17:45:15 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2 p-timezone-select">
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-autocomplete
|
2020-04-18 21:20:54 +00:00
|
|
|
@change="updateTime"
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
:label="labels.timezone"
|
|
|
|
hide-details
|
|
|
|
color="secondary-dark"
|
|
|
|
item-value="code"
|
|
|
|
item-text="name"
|
|
|
|
v-model="model.TimeZone"
|
|
|
|
:items="timeZones">
|
|
|
|
</v-autocomplete>
|
|
|
|
</v-flex>
|
|
|
|
|
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-23 23:45:59 +00:00
|
|
|
label="Latitude"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.PhotoLat"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-04-15 08:00:39 +00:00
|
|
|
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-23 23:45:59 +00:00
|
|
|
label="Longitude"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.PhotoLng"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-04-15 08:00:39 +00:00
|
|
|
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-23 23:45:59 +00:00
|
|
|
label="Altitude (m)"
|
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
|
|
|
v-model="model.PhotoAltitude"
|
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
|
|
|
<v-flex xs12 sm6 md3 class="pa-2 p-countries-select">
|
|
|
|
<v-select
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-26 16:47:52 +00:00
|
|
|
:label="labels.country"
|
2020-01-24 09:25:08 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-24 09:25:08 +00:00
|
|
|
color="secondary-dark"
|
2020-04-18 21:20:54 +00:00
|
|
|
item-value="Code"
|
|
|
|
item-text="Name"
|
2020-01-26 16:47:52 +00:00
|
|
|
v-model="model.PhotoCountry"
|
2020-04-18 21:20:54 +00:00
|
|
|
:items="countries">
|
2020-01-26 16:47:52 +00:00
|
|
|
</v-select>
|
2020-01-24 09:25:08 +00:00
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-04-30 07:38:00 +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="CameraModel"
|
|
|
|
v-model="model.CameraID"
|
|
|
|
:items="cameraOptions">
|
|
|
|
</v-select>
|
|
|
|
</v-flex>
|
|
|
|
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-30 07:38:00 +00:00
|
|
|
label="ISO"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-30 07:38:00 +00:00
|
|
|
v-model="model.PhotoIso"
|
2020-01-23 23:45:59 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
|
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-30 07:38:00 +00:00
|
|
|
label="Exposure"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-30 07:38:00 +00:00
|
|
|
v-model="model.PhotoExposure"
|
2020-01-23 23:45:59 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
|
2020-04-30 07:38:00 +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="LensModel"
|
|
|
|
v-model="model.LensID"
|
|
|
|
:items="lensOptions">
|
|
|
|
</v-select>
|
|
|
|
</v-flex>
|
|
|
|
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-30 07:38:00 +00:00
|
|
|
label="F Number"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-30 07:38:00 +00:00
|
|
|
v-model="model.PhotoFNumber"
|
2020-01-23 23:45:59 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
2020-01-26 17:23:05 +00:00
|
|
|
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-30 07:38:00 +00:00
|
|
|
label="Focal Length"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-30 07:38:00 +00:00
|
|
|
v-model="model.PhotoFocalLength"
|
2020-01-23 23:45:59 +00:00
|
|
|
></v-text-field>
|
|
|
|
</v-flex>
|
|
|
|
|
2020-04-07 20:03:31 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
2020-01-26 16:47:52 +00:00
|
|
|
<v-textarea
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-04-26 12:31:33 +00:00
|
|
|
:rules="[textRule]"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-26 16:47:52 +00:00
|
|
|
auto-grow
|
2020-04-07 20:03:31 +00:00
|
|
|
label="Subject"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
2020-01-26 16:47:52 +00:00
|
|
|
:rows="1"
|
2020-01-23 23:45:59 +00:00
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoSubject"
|
2020-01-26 16:47:52 +00:00
|
|
|
></v-textarea>
|
2020-01-23 23:45:59 +00:00
|
|
|
</v-flex>
|
|
|
|
|
2020-04-07 20:03:31 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-04-26 12:31:33 +00:00
|
|
|
:rules="[textRule]"
|
2020-03-25 11:39:07 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-07 20:03:31 +00:00
|
|
|
label="Artist"
|
2020-03-25 11:39:07 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoArtist"
|
|
|
|
></v-text-field>
|
2020-03-26 08:41:33 +00:00
|
|
|
</v-flex>
|
|
|
|
|
2020-04-07 20:03:31 +00:00
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-text-field
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-04-26 12:31:33 +00:00
|
|
|
:rules="[textRule]"
|
2020-03-26 08:41:33 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-07 20:03:31 +00:00
|
|
|
label="Copyright"
|
2020-03-26 08:41:33 +00:00
|
|
|
placeholder=""
|
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoCopyright"
|
|
|
|
></v-text-field>
|
2020-03-26 08:41:33 +00:00
|
|
|
</v-flex>
|
|
|
|
|
|
|
|
<v-flex xs12 sm6 md3 class="pa-2">
|
|
|
|
<v-textarea
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-04-26 12:31:33 +00:00
|
|
|
:rules="[textRule]"
|
2020-03-26 08:41:33 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-03-26 08:41:33 +00:00
|
|
|
auto-grow
|
2020-04-07 20:03:31 +00:00
|
|
|
label="License"
|
2020-03-26 08:41:33 +00:00
|
|
|
placeholder=""
|
|
|
|
:rows="1"
|
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoLicense"
|
2020-03-25 11:39:07 +00:00
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
|
|
|
|
2020-04-07 20:03:31 +00:00
|
|
|
<v-flex xs12 class="pa-2">
|
|
|
|
<v-textarea
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-07 20:03:31 +00:00
|
|
|
auto-grow
|
|
|
|
label="Description"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
2020-04-07 20:03:31 +00:00
|
|
|
:rows="1"
|
2020-01-23 23:45:59 +00:00
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoDescription"
|
|
|
|
></v-textarea>
|
2020-01-23 23:45:59 +00:00
|
|
|
</v-flex>
|
|
|
|
|
2020-04-07 20:03:31 +00:00
|
|
|
<v-flex xs12 md6 class="pa-2">
|
|
|
|
<v-textarea
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-04-07 20:03:31 +00:00
|
|
|
auto-grow
|
|
|
|
label="Keywords"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
2020-04-07 20:03:31 +00:00
|
|
|
:rows="1"
|
2020-01-23 23:45:59 +00:00
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoKeywords"
|
|
|
|
></v-textarea>
|
2020-01-23 23:45:59 +00:00
|
|
|
</v-flex>
|
|
|
|
|
2020-04-07 20:03:31 +00:00
|
|
|
<v-flex xs12 md6 class="pa-2">
|
2020-01-23 23:45:59 +00:00
|
|
|
<v-textarea
|
2020-04-13 17:45:38 +00:00
|
|
|
:disabled="disabled"
|
2020-01-23 23:45:59 +00:00
|
|
|
hide-details
|
2020-04-01 10:23:02 +00:00
|
|
|
browser-autocomplete="off"
|
2020-01-23 23:45:59 +00:00
|
|
|
auto-grow
|
2020-04-07 20:03:31 +00:00
|
|
|
label="Notes"
|
2020-01-23 23:45:59 +00:00
|
|
|
placeholder=""
|
2020-01-26 16:47:52 +00:00
|
|
|
:rows="1"
|
2020-01-23 23:45:59 +00:00
|
|
|
color="secondary-dark"
|
2020-04-07 20:03:31 +00:00
|
|
|
v-model="model.Description.PhotoNotes"
|
2020-01-23 23:45:59 +00:00
|
|
|
></v-textarea>
|
|
|
|
</v-flex>
|
2020-01-26 16:47:52 +00:00
|
|
|
|
2020-04-13 17:45:38 +00:00
|
|
|
<v-flex xs12 text-xs-right class="pt-3" v-if="!disabled">
|
2020-01-29 14:28:20 +00:00
|
|
|
<v-btn @click.stop="close" depressed color="secondary-light"
|
|
|
|
class="p-photo-dialog-close">
|
2020-01-24 09:25:08 +00:00
|
|
|
<translate>Close</translate>
|
2020-01-23 23:45:59 +00:00
|
|
|
</v-btn>
|
2020-03-30 13:07:05 +00:00
|
|
|
<v-btn color="secondary-dark" depressed dark @click.stop="save(false)"
|
2020-01-23 23:45:59 +00:00
|
|
|
class="p-photo-dialog-confirm">
|
2020-05-05 17:44:02 +00:00
|
|
|
<span v-if="$config.feature('review') && model.PhotoQuality < 3">Approve</span>
|
2020-04-25 12:22:47 +00:00
|
|
|
<span v-else>Apply</span>
|
2020-03-30 13:07:05 +00:00
|
|
|
</v-btn>
|
|
|
|
<v-btn color="secondary-dark" depressed dark @click.stop="save(true)"
|
|
|
|
class="p-photo-dialog-confirm hidden-xs-only">
|
|
|
|
<span>OK</span>
|
|
|
|
<v-icon right dark>done</v-icon>
|
2020-01-23 23:45:59 +00:00
|
|
|
</v-btn>
|
|
|
|
</v-flex>
|
|
|
|
</v-layout>
|
|
|
|
</v-flex>
|
|
|
|
</v-layout>
|
2020-04-15 08:00:39 +00:00
|
|
|
|
|
|
|
<div class="mt-5"></div>
|
2020-01-23 23:45:59 +00:00
|
|
|
</v-form>
|
|
|
|
</v-container>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import options from "resources/options.json";
|
|
|
|
import {DateTime} from "luxon";
|
|
|
|
import moment from "moment-timezone"
|
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-01-23 23:45:59 +00:00
|
|
|
|
|
|
|
export default {
|
2020-01-29 14:28:20 +00:00
|
|
|
name: 'p-tab-photo-edit-details',
|
2020-01-23 23:45:59 +00:00
|
|
|
props: {
|
|
|
|
model: Object,
|
|
|
|
},
|
|
|
|
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: {
|
|
|
|
colors: [{label: "Unknown", name: ""}],
|
|
|
|
},
|
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"),
|
|
|
|
},
|
|
|
|
showDatePicker: false,
|
|
|
|
showTimePicker: false,
|
|
|
|
date: "",
|
|
|
|
time: "",
|
2020-04-18 21:20:54 +00:00
|
|
|
dateFormatted: "",
|
|
|
|
timeFormatted: "",
|
|
|
|
timeLocalFormatted: "",
|
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-04-18 21:20:54 +00:00
|
|
|
watch: {
|
|
|
|
date() {
|
2020-01-26 16:47:52 +00:00
|
|
|
if (!this.date) {
|
2020-04-18 21:20:54 +00:00
|
|
|
this.dateFormatted = "";
|
|
|
|
this.timeLocalFormatted = "";
|
|
|
|
return
|
2020-01-23 23:45:59 +00:00
|
|
|
}
|
2020-01-24 09:25:08 +00:00
|
|
|
|
2020-04-18 21:20:54 +00:00
|
|
|
this.dateFormatted = DateTime.fromISO(this.date).toLocaleString(DateTime.DATE_FULL);
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-04-18 21:20:54 +00:00
|
|
|
time() {
|
|
|
|
this.updateTime();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
cameraOptions() {
|
|
|
|
return this.config.cameras;
|
|
|
|
},
|
|
|
|
lensOptions() {
|
|
|
|
return this.config.lenses;
|
|
|
|
},
|
|
|
|
colorOptions() {
|
|
|
|
return this.all.colors.concat(this.config.colors);
|
|
|
|
},
|
|
|
|
timeZones() {
|
|
|
|
return moment.tz.names();
|
2020-01-23 23:45:59 +00:00
|
|
|
},
|
2020-04-18 21:20:54 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
updateTime() {
|
2020-01-26 16:47:52 +00:00
|
|
|
if (!this.time || !this.date) {
|
2020-04-18 21:20:54 +00:00
|
|
|
this.timeFormatted = ""
|
|
|
|
this.timeLocalFormatted = ""
|
2020-01-26 16:47:52 +00:00
|
|
|
}
|
|
|
|
|
2020-04-18 21:20:54 +00:00
|
|
|
this.timeFormatted = DateTime.fromISO(this.time).toLocaleString(DateTime.TIME_24_WITH_SECONDS);
|
|
|
|
|
2020-01-26 16:47:52 +00:00
|
|
|
const utcDate = this.date + "T" + this.time + "Z";
|
|
|
|
|
|
|
|
this.model.TakenAt = utcDate;
|
|
|
|
|
2020-01-30 05:17:02 +00:00
|
|
|
let localDate = DateTime.fromISO(utcDate);
|
|
|
|
|
2020-04-16 14:30:45 +00:00
|
|
|
if (this.model.TimeZone) {
|
2020-01-30 05:17:02 +00:00
|
|
|
localDate = localDate.setZone(this.model.TimeZone);
|
|
|
|
} else {
|
|
|
|
localDate = localDate.toUTC(0);
|
|
|
|
}
|
2020-01-26 16:47:52 +00:00
|
|
|
|
|
|
|
this.model.TakenAtLocal = localDate.toISO({
|
|
|
|
suppressMilliseconds: true,
|
|
|
|
includeOffset: false,
|
|
|
|
}) + "Z";
|
|
|
|
|
2020-04-18 21:20:54 +00:00
|
|
|
this.timeLocalFormatted = localDate.toLocaleString(DateTime.TIME_24_WITH_SECONDS);
|
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
|
|
|
},
|
|
|
|
refresh(model) {
|
2020-01-26 16:47:52 +00:00
|
|
|
if (!model.hasId()) return;
|
2020-01-23 23:45:59 +00:00
|
|
|
|
2020-01-26 16:47:52 +00:00
|
|
|
if (model.TakenAt) {
|
2020-01-24 09:25:08 +00:00
|
|
|
const date = DateTime.fromISO(model.TakenAt).toUTC();
|
|
|
|
this.date = date.toISODate();
|
|
|
|
this.time = date.toFormat("HH:mm:ss");
|
2020-04-18 21:20:54 +00:00
|
|
|
|
|
|
|
this.updateTime();
|
2020-01-23 23:45:59 +00:00
|
|
|
}
|
|
|
|
},
|
2020-03-30 13:07:05 +00:00
|
|
|
save(close) {
|
2020-01-26 16:47:52 +00:00
|
|
|
if (this.time && this.date) {
|
2020-01-24 09:25:08 +00:00
|
|
|
this.model.TakenAt = this.date + "T" + this.time + "Z";
|
|
|
|
}
|
|
|
|
|
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-04-18 21:20:54 +00:00
|
|
|
} else {
|
|
|
|
this.refresh(this.model);
|
2020-04-16 14:30:45 +00:00
|
|
|
}
|
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>
|