mirror of
https://github.com/hay-kot/homebox.git
synced 2025-08-04 16:50:27 +00:00
invert toggle for edit mode
This commit is contained in:
parent
7b507f8995
commit
52c806cd56
2 changed files with 13 additions and 13 deletions
|
@ -4,7 +4,7 @@ import { DaisyTheme } from "~~/lib/data/themes";
|
||||||
export type LocationViewPreferences = {
|
export type LocationViewPreferences = {
|
||||||
showDetails: boolean;
|
showDetails: boolean;
|
||||||
showEmpty: boolean;
|
showEmpty: boolean;
|
||||||
editorSimpleView: boolean;
|
editorAdvancedView: boolean;
|
||||||
theme: DaisyTheme;
|
theme: DaisyTheme;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@ export function useViewPreferences(): Ref<LocationViewPreferences> {
|
||||||
{
|
{
|
||||||
showDetails: true,
|
showDetails: true,
|
||||||
showEmpty: true,
|
showEmpty: true,
|
||||||
editorSimpleView: true,
|
editorAdvancedView: false,
|
||||||
theme: "garden",
|
theme: "homebox",
|
||||||
},
|
},
|
||||||
{ mergeDefaults: true }
|
{ mergeDefaults: true }
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ItemAttachment, ItemField, ItemUpdate } from "~~/lib/api/types/data-contracts";
|
import { ItemAttachment, ItemField, ItemOut, ItemUpdate } from "~~/lib/api/types/data-contracts";
|
||||||
import { AttachmentTypes } from "~~/lib/api/types/non-generated";
|
import { AttachmentTypes } from "~~/lib/api/types/non-generated";
|
||||||
import { useLabelStore } from "~~/stores/labels";
|
import { useLabelStore } from "~~/stores/labels";
|
||||||
import { useLocationStore } from "~~/stores/locations";
|
import { useLocationStore } from "~~/stores/locations";
|
||||||
|
@ -71,7 +71,7 @@
|
||||||
type FormField = {
|
type FormField = {
|
||||||
type: "text" | "textarea" | "select" | "date" | "label" | "location" | "number" | "checkbox";
|
type: "text" | "textarea" | "select" | "date" | "label" | "location" | "number" | "checkbox";
|
||||||
label: string;
|
label: string;
|
||||||
ref: string;
|
ref: keyof ItemOut;
|
||||||
};
|
};
|
||||||
|
|
||||||
const mainFields: FormField[] = [
|
const mainFields: FormField[] = [
|
||||||
|
@ -342,10 +342,10 @@
|
||||||
<span class="text-base-content"> Edit </span>
|
<span class="text-base-content"> Edit </span>
|
||||||
<template #after>
|
<template #after>
|
||||||
<div class="modal-action mt-3">
|
<div class="modal-action mt-3">
|
||||||
<div class="mr-auto tooltip" data-tip="Hide the cruft! ">
|
<div class="mr-auto tooltip" data-tip="Show Advanced Options">
|
||||||
<label class="label cursor-pointer mr-auto">
|
<label class="label cursor-pointer mr-auto">
|
||||||
<input v-model="preferences.editorSimpleView" type="checkbox" class="toggle toggle-primary" />
|
<input v-model="preferences.editorAdvancedView" type="checkbox" class="toggle toggle-primary" />
|
||||||
<span class="label-text ml-4"> Simple View </span>
|
<span class="label-text ml-4"> Advanced </span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<BaseButton size="sm" @click="saveItem">
|
<BaseButton size="sm" @click="saveItem">
|
||||||
|
@ -368,7 +368,7 @@
|
||||||
<FormMultiselect v-model="item.labels" label="Labels" :items="labels ?? []" />
|
<FormMultiselect v-model="item.labels" label="Labels" :items="labels ?? []" />
|
||||||
|
|
||||||
<Autocomplete
|
<Autocomplete
|
||||||
v-if="!preferences.editorSimpleView"
|
v-if="preferences.editorAdvancedView"
|
||||||
v-model="parent"
|
v-model="parent"
|
||||||
v-model:search="query"
|
v-model:search="query"
|
||||||
:items="results"
|
:items="results"
|
||||||
|
@ -438,7 +438,7 @@
|
||||||
</BaseCard>
|
</BaseCard>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
v-if="!preferences.editorSimpleView"
|
v-if="preferences.editorAdvancedView"
|
||||||
ref="attDropZone"
|
ref="attDropZone"
|
||||||
class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg"
|
class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg"
|
||||||
>
|
>
|
||||||
|
@ -494,7 +494,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!preferences.editorSimpleView" class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg">
|
<div v-if="preferences.editorAdvancedView" class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6">Purchase Details</h3>
|
<h3 class="text-lg font-medium leading-6">Purchase Details</h3>
|
||||||
</div>
|
</div>
|
||||||
|
@ -536,7 +536,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!preferences.editorSimpleView" class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg">
|
<div v-if="preferences.editorAdvancedView" class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6">Warranty Details</h3>
|
<h3 class="text-lg font-medium leading-6">Warranty Details</h3>
|
||||||
</div>
|
</div>
|
||||||
|
@ -578,7 +578,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!preferences.editorSimpleView" class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg">
|
<div v-if="preferences.editorAdvancedView" class="overflow-visible card bg-base-100 shadow-xl sm:rounded-lg">
|
||||||
<div class="px-4 py-5 sm:px-6">
|
<div class="px-4 py-5 sm:px-6">
|
||||||
<h3 class="text-lg font-medium leading-6">Sold Details</h3>
|
<h3 class="text-lg font-medium leading-6">Sold Details</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue