diff --git a/frontend/src/dialog/photo/edit/details.vue b/frontend/src/dialog/photo/edit/details.vue index 584421c17..8bb25be92 100644 --- a/frontend/src/dialog/photo/edit/details.vue +++ b/frontend/src/dialog/photo/edit/details.vue @@ -6,8 +6,8 @@ @submit.prevent="save"> + v-model="model.Day" + :append-icon="model.TakenSrc === 'manual' ? 'check' : ''" + :disabled="disabled" + :error="invalidDate" + :label="$gettext('Day')" + browser-autocomplete="off" + hide-details box flat hide-no-data + color="secondary-dark" + :items="options.Days()" + class="input-day" + @change="updateTime"> + v-model="model.Month" + :append-icon="model.TakenSrc === 'manual' ? 'check' : ''" + :disabled="disabled" + :error="invalidDate" + :label="$gettext('Month')" + browser-autocomplete="off" + hide-details box flat hide-no-data + color="secondary-dark" + :items="options.MonthsShort()" + class="input-month" + @change="updateTime"> + v-model="model.Year" + :append-icon="model.TakenSrc === 'manual' ? 'check' : ''" + :disabled="disabled" + :error="invalidDate" + :label="$gettext('Year')" + browser-autocomplete="off" + hide-details box flat hide-no-data + color="secondary-dark" + :items="options.Years()" + class="input-year" + @change="updateTime"> + v-model="model.TimeZone" + :disabled="disabled" + :label="$gettext('Time Zone')" + browser-autocomplete="off" + hide-details box flat hide-no-data + color="secondary-dark" + item-value="ID" + item-text="Name" + :items="options.TimeZones()" + class="input-timezone" + @change="updateTime"> + v-model="model.Country" + :append-icon="model.PlaceSrc === 'manual' ? 'check' : ''" + :disabled="disabled" + :readonly="!!(model.Lat || model.Lng)" + :label="$gettext('Country')" hide-details box flat + hide-no-data + browser-autocomplete="off" + color="secondary-dark" + item-value="Code" + item-text="Name" + :items="countries" + class="input-country"> + v-model="model.CameraID" + :append-icon="model.CameraSrc === 'manual' ? 'check' : ''" + :disabled="disabled" + :label="$gettext('Camera')" + :menu-props="{'maxHeight':346}" + browser-autocomplete="off" + hide-details box flat + color="secondary-dark" + item-value="ID" + item-text="Name" + :items="cameraOptions" + class="input-camera"> + v-model="model.LensID" + :append-icon="model.CameraSrc === 'manual' ? 'check' : ''" + :disabled="disabled" + :label="$gettext('Lens')" + :menu-props="{'maxHeight':346}" + browser-autocomplete="off" + hide-details box flat + color="secondary-dark" + item-value="ID" + item-text="Name" + :items="lensOptions" + class="input-lens"> diff --git a/frontend/src/dialog/photo/edit/info.vue b/frontend/src/dialog/photo/edit/info.vue index 05970feb3..67c8d9479 100644 --- a/frontend/src/dialog/photo/edit/info.vue +++ b/frontend/src/dialog/photo/edit/info.vue @@ -41,12 +41,6 @@ {{ model.Name }} - - - Albums - - {{ model.Albums.map(album => album.Title).join(', ') }} - Original Name @@ -77,6 +71,14 @@ {{ model.getDateString() }} + + + Albums + + + , {{ m.Title }} + + Quality Score @@ -323,6 +325,13 @@ export default { openPhoto() { this.$viewer.show(Thumb.fromFiles([this.model]), 0); }, + albumUrl(m) { + if (!m) { + return '#'; + } + + return this.$router.resolve({ name: 'album', params: { uid: m.UID, slug: 'view' }}).href; + }, }, }; diff --git a/internal/entity/photo.go b/internal/entity/photo.go index 9b6696cdd..de6604dca 100644 --- a/internal/entity/photo.go +++ b/internal/entity/photo.go @@ -103,7 +103,7 @@ type Photo struct { Cell *Cell `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Cell" yaml:"-"` Place *Place `gorm:"association_autoupdate:false;association_autocreate:false;association_save_reference:false" json:"Place" yaml:"-"` Keywords []Keyword `json:"-" yaml:"-"` - Albums []Album `yaml:"-"` + Albums []Album `json:"Albums" yaml:"-"` Files []File `yaml:"-"` Labels []PhotoLabel `yaml:"-"` CreatedBy string `gorm:"type:VARBINARY(42);index" json:"CreatedBy,omitempty" yaml:"CreatedBy,omitempty"`