Skip to content

Commit

Permalink
with respect to @sancsin idea
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria committed Jan 28, 2025
1 parent 189f508 commit eee5b0d
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
14 changes: 12 additions & 2 deletions resources/js/components/drawers/PhotoEdit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@
'border-dashed': !is_taken_at_modified,
}"
>
<InputText class="border-none" v-model="takenAtTz" placeholder="+00:00" :disabled="!is_taken_at_modified" />
<Select
v-model="takenAtTz"
:options="timeZoneOptions"
option-label="label"
option-value="value"
:disabled="!is_taken_at_modified"
:invalid="!takenAtTz"
class="border-none"
></Select>
<!-- <InputText class="border-none" v-model="takenAtTz" placeholder="+00:00" :disabled="!is_taken_at_modified" /> -->
</InputGroupAddon>
</InputGroup>
<div></div>
Expand Down Expand Up @@ -100,7 +109,7 @@ import Card from "primevue/card";
import Drawer from "primevue/drawer";
import { ref, Ref, watch } from "vue";
import InputText from "@/components/forms/basic/InputText.vue";
import { licenseOptions, SelectOption, SelectBuilders } from "@/config/constants";
import { licenseOptions, SelectOption, SelectBuilders, timeZoneOptions } from "@/config/constants";
import Select from "primevue/select";
import Textarea from "@/components/forms/basic/Textarea.vue";
import DatePicker from "primevue/datepicker";
Expand Down Expand Up @@ -132,6 +141,7 @@ const uploadTz = ref<string | undefined>(undefined);
const takenAtTz = ref<string | undefined>(undefined);
// TODO: updating exif data later
// console.log(timeZoneOptions)
function load(photo: App.Http.Resources.Models.PhotoResource) {
photo_id.value = photo.id;
Expand Down
33 changes: 33 additions & 0 deletions resources/js/config/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,39 @@ export const timelineAlbumGranularityOptions: SelectOption<App.Enum.TimelineAlbu
{ value: "day", label: "gallery.timeline.day" },
];

export const timeZoneOptions: SelectOption<string>[] = [
{ value: "-12:00", label: "-12:00 Uninhabited areas (Baker Island)" },
{ value: "-11:00", label: "-11:00 Niue Time" },
{ value: "-10:00", label: "-10:00 HST Hawaii Standard Time" },
{ value: "-09:00", label: "-09:00 AKST Alaska Standard Time" },
{ value: "-08:00", label: "-08:00 PST Pacific Standard Time (US)" },
{ value: "-07:00", label: "-07:00 MST Mountain Standard Time (US)" },
{ value: "-06:00", label: "-06:00 CST (US) Central Standard Time (US)" },
{ value: "-05:00", label: "-05:00 EST/ACT Eastern Standard Time (US)/Acre Time" },
{ value: "-04:00", label: "-04:00 AMT Amazon Time" },
{ value: "-03:30", label: "-03:30 NST Newfoundland Standard Time" },
{ value: "-03:00", label: "-03:00 ADT Atlantic Daylight Time" },
{ value: "-02:00", label: "-02:00 South Georgia and Sandwich Islands" },
{ value: "-01:00", label: "-01:00 Azores Time" },
{ value: "+00:00", label: "+00:00 UTC/GMT Coordinated Universal Time/Greenwich Mean Time" },
{ value: "+01:00", label: "+01:00 CET/BST Central European Time/British Summer Time" },
{ value: "+02:00", label: "+02:00 EET/CEST Eastern European Time/Central European Summer Time" },
{ value: "+03:00", label: "+03:00 MSK/AST/EEST Moscow Standard Time/Arabian Standard Time/Eastern European Summer Time" },
{ value: "+03:30", label: "+03:30 IRST Iran Standard Time" },
{ value: "+04:00", label: "+04:00 GST/AZT Gulf Standard Time/Azerbaijan Time" },
{ value: "+04:30", label: "+04:30 AFT Afghanistan Time" },
{ value: "+05:00", label: "+05:00 PKT Pakistan Standard Time" },
{ value: "+05:30", label: "+05:30 IST Indian Standard Time" },
{ value: "+06:00", label: "+06:00 Bhutan Time" },
{ value: "+07:00", label: "+07:00 ICT Indochina Time" },
{ value: "+08:00", label: "+08:00 CST (China)/HKT China Standard Time/Hong Kong Time" },
{ value: "+09:00", label: "+09:00 JST/KST Japan Standard Time/Korea Standard Time" },
{ value: "+09:30", label: "+09:30 ACST Australian Central Standard Time" },
{ value: "+10:00", label: "+10:00 AEST Australian Eastern Standard Time" },
{ value: "+11:00", label: "+11:00 Solomon Islands Time" },
{ value: "+12:00", label: "+12:00 NZST New Zealand Standard Time" },
];

export const SelectBuilders = {
buildPhotoSorting(value: string | App.Enum.ColumnSortingType | undefined): SelectOption<App.Enum.ColumnSortingPhotoType> | undefined {
return photoSortingColumnsOptions.find((option) => option.value === value) || undefined;
Expand Down
3 changes: 3 additions & 0 deletions resources/js/style/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,9 @@ const LycheePrimeVueConfig = {
},
},
dark: {
disabled: {
background: "transparent",
},
option: {
color: "{surface.400}",
focus: {
Expand Down
6 changes: 6 additions & 0 deletions resources/js/views/gallery-panels/Photo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,12 @@ function scrollTo(event: WheelEvent) {
return;
}
if (is_edit_open.value) {
// We do nothing! Otherwise we are switching photos without noticing.
// especially with trackpads.
return;
}
if (route.name !== "photo") {
return;
}
Expand Down

0 comments on commit eee5b0d

Please sign in to comment.