diff --git a/frontend/components/Item/Card.vue b/frontend/components/Item/Card.vue index 5becbecd..c1ee68a9 100644 --- a/frontend/components/Item/Card.vue +++ b/frontend/components/Item/Card.vue @@ -10,7 +10,21 @@
- + +
@@ -76,6 +90,7 @@ import { Checkbox } from "@/components/ui/checkbox"; const api = useUserApi(); + const preferences = useViewPreferences(); const imageUrl = computed(() => { if (!props.item.imageId) { @@ -109,6 +124,8 @@ }, }); + const objectContain = computed(() => imageUrl.value !== "/no-image.jpg" && !preferences.value.legacyImageFit); + const locationString = computed( () => props.locationFlatTree.find(l => l.id === props.item.location?.id)?.treeString || props.item.location?.name ); diff --git a/frontend/composables/use-preferences.ts b/frontend/composables/use-preferences.ts index 508353b2..97cad2a4 100644 --- a/frontend/composables/use-preferences.ts +++ b/frontend/composables/use-preferences.ts @@ -23,6 +23,7 @@ export type LocationViewPreferences = { enabled: boolean; }[]; displayLegacyHeader: boolean; + legacyImageFit: boolean; language?: string; overrideFormatLocale?: string; duplicateSettings: DuplicateSettings; @@ -47,6 +48,7 @@ export function useViewPreferences(): Ref { theme: "homebox", itemsPerTablePage: 10, displayLegacyHeader: false, + legacyImageFit: false, language: null, overrideFormatLocale: null, duplicateSettings: { diff --git a/frontend/locales/en.json b/frontend/locales/en.json index 64a1f4d6..f40ff4c9 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -555,6 +555,7 @@ "delete_account_sub": "Delete your account and all its associated data. This can not be undone.", "delete_notifier_confirm": "Are you sure you want to delete this notifier?", "display_legacy_header": "{ currentValue, select, true {Disable Legacy Header} false {Enable Legacy Header} other {Not Hit}}", + "legacy_image_fit": "{ currentValue, select, true {Disable Legacy Fit: Fit Image with Bars} false {Enable Legacy Fit: Fill Image with Crop} other {Not Hit}}", "enabled": "Enabled", "example": "Example", "gen_invite": "Generate Invite Link", diff --git a/frontend/pages/profile.vue b/frontend/pages/profile.vue index a1726e1d..f721ec05 100644 --- a/frontend/pages/profile.vue +++ b/frontend/pages/profile.vue @@ -61,6 +61,9 @@ function setDisplayHeader() { preferences.value.displayLegacyHeader = !preferences.value.displayLegacyHeader; } + function setLegacyImageFit() { + preferences.value.legacyImageFit = !preferences.value.legacyImageFit; + } // Currency Selection const currency = ref({ @@ -530,10 +533,13 @@
-
+
+