diff --git a/frontend/components/Base/ActionsDivider.vue b/frontend/components/Base/ActionsDivider.vue index a6ab6df..e943c05 100644 --- a/frontend/components/Base/ActionsDivider.vue +++ b/frontend/components/Base/ActionsDivider.vue @@ -12,7 +12,3 @@ - - diff --git a/frontend/components/Base/Button.vue b/frontend/components/Base/Button.vue index 1a48cc6..f0b1cd3 100644 --- a/frontend/components/Base/Button.vue +++ b/frontend/components/Base/Button.vue @@ -1,10 +1,30 @@ - - diff --git a/frontend/components/Location/Card.vue b/frontend/components/Location/Card.vue index e13be66..1948354 100644 --- a/frontend/components/Location/Card.vue +++ b/frontend/components/Location/Card.vue @@ -4,14 +4,20 @@ :to="`/location/${location.id}`" class="card bg-primary text-primary-content transition duration-300" > -
+

{{ location.name }} - + {{ location.itemCount }}

@@ -27,6 +33,10 @@ type: Object as () => Location, required: true, }, + dense: { + type: Boolean, + default: false, + }, }); const card = ref(null); diff --git a/frontend/composables/use-preferences.ts b/frontend/composables/use-preferences.ts index 3e38682..3a01789 100644 --- a/frontend/composables/use-preferences.ts +++ b/frontend/composables/use-preferences.ts @@ -2,6 +2,7 @@ import { Ref } from 'vue'; export type LocationViewPreferences = { showDetails: boolean; + showEmpty: boolean; }; /** @@ -13,6 +14,7 @@ export function useViewPreferences(): Ref { 'homebox/preferences/location', { showDetails: true, + showEmpty: true, }, { mergeDefaults: true } ); diff --git a/frontend/composables/use-strings.ts b/frontend/composables/use-strings.ts new file mode 100644 index 0000000..9d179e9 --- /dev/null +++ b/frontend/composables/use-strings.ts @@ -0,0 +1,7 @@ +export function truncate(str: string, length: number) { + return str.length > length ? str.substring(0, length) + '...' : str; +} + +export function capitalize(str: string) { + return str.charAt(0).toUpperCase() + str.slice(1); +} diff --git a/frontend/pages/home.vue b/frontend/pages/home.vue index 640249c..f1d3671 100644 --- a/frontend/pages/home.vue +++ b/frontend/pages/home.vue @@ -41,10 +41,57 @@ value: totalLabels, }, ]; + + const importDialog = ref(false); + const importCsv = ref(null); + const importRef = ref(null); + whenever( + () => !importDialog.value, + () => { + importCsv.value = null; + } + ); + + function setFile(e: Event & { target: HTMLInputElement }) { + console.log(e); + importCsv.value = e.target.files[0]; + } + + function openDialog() { + importDialog.value = true; + } + + function uploadCsv() { + importRef.value.click(); + } diff --git a/frontend/pages/location/[id].vue b/frontend/pages/location/[id].vue index b625cf1..2c8c5ee 100644 --- a/frontend/pages/location/[id].vue +++ b/frontend/pages/location/[id].vue @@ -1,5 +1,4 @@