diff --git a/cookbook/migrations/0167_userpreference_left_handed.py b/cookbook/migrations/0167_userpreference_left_handed.py new file mode 100644 index 000000000..23fb0f4af --- /dev/null +++ b/cookbook/migrations/0167_userpreference_left_handed.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.11 on 2022-01-20 22:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('cookbook', '0166_alter_userpreference_shopping_add_onhand'), + ] + + operations = [ + migrations.AddField( + model_name='userpreference', + name='left_handed', + field=models.BooleanField(default=False), + ), + ] diff --git a/cookbook/models.py b/cookbook/models.py index 8263dd44d..fef3ab838 100644 --- a/cookbook/models.py +++ b/cookbook/models.py @@ -339,6 +339,7 @@ class UserPreference(models.Model, PermissionModelMixin): mealplan_autoinclude_related = models.BooleanField(default=True) shopping_add_onhand = models.BooleanField(default=False) filter_to_supermarket = models.BooleanField(default=False) + left_handed = models.BooleanField(default=False) default_delay = models.DecimalField(default=4, max_digits=8, decimal_places=4) shopping_recent_days = models.PositiveIntegerField(default=7) csv_delim = models.CharField(max_length=2, default=",") diff --git a/cookbook/serializer.py b/cookbook/serializer.py index c0543efec..6fa745a29 100644 --- a/cookbook/serializer.py +++ b/cookbook/serializer.py @@ -183,7 +183,7 @@ class UserPreferenceSerializer(WritableNestedModelSerializer): 'user', 'theme', 'nav_color', 'default_unit', 'default_page', 'use_kj', 'search_style', 'show_recent', 'plan_share', 'ingredient_decimals', 'comments', 'shopping_auto_sync', 'mealplan_autoadd_shopping', 'food_inherit_default', 'default_delay', 'mealplan_autoinclude_related', 'mealplan_autoexclude_onhand', 'shopping_share', 'shopping_recent_days', 'csv_delim', 'csv_prefix', - 'filter_to_supermarket', 'shopping_add_onhand' + 'filter_to_supermarket', 'shopping_add_onhand', 'left_handed' ) diff --git a/cookbook/static/themes/tandoor.min.css b/cookbook/static/themes/tandoor.min.css index 9dc091af6..f329e4e87 100644 --- a/cookbook/static/themes/tandoor.min.css +++ b/cookbook/static/themes/tandoor.min.css @@ -10461,4 +10461,9 @@ textarea, input:not([type="submit"]):not([class="multiselect__input"]):not([clas .form-control-search { font-size: 20px; +} + +.ghost { + opacity: 0.5 !important; + background: #b98766 !important; } \ No newline at end of file diff --git a/vue/src/apps/MealPlanView/MealPlanView.vue b/vue/src/apps/MealPlanView/MealPlanView.vue index 85485d4e7..d45fb0753 100644 --- a/vue/src/apps/MealPlanView/MealPlanView.vue +++ b/vue/src/apps/MealPlanView/MealPlanView.vue @@ -79,21 +79,20 @@
{{ $t("Meal_Types") }}
- - + - +
-
+
-
+
{{ meal_type.icon }} {{ meal_type.name - }} diff --git a/vue/src/apps/ShoppingListView/ShoppingListView.vue b/vue/src/apps/ShoppingListView/ShoppingListView.vue index 9113b5a16..cb98502b7 100644 --- a/vue/src/apps/ShoppingListView/ShoppingListView.vue +++ b/vue/src/apps/ShoppingListView/ShoppingListView.vue @@ -5,10 +5,10 @@
+ :class="entrymode ? 'text-success' : 'text-primary'"/> -
@@ -93,8 +93,9 @@
-
-

{{ $t("Completed") }}

+
+ {{ $t("Completed") }}
@@ -127,7 +128,7 @@
-
@@ -173,7 +174,7 @@
- + {{ $t("Save") }} + class="pr-2 pt-1 fas fa-save"> {{ $t("Create") }} - - + +
-
{{ s.name }}
-
- - - - - - +
+
+ {{ s.name }} + + + + + + +
- - + + @@ -251,7 +255,7 @@ " > + :class="new_category.entrymode ? 'text-success' : 'text-primary'"/>
@@ -269,7 +273,7 @@ v-model="new_category.value"/> {{ $t("Save") }} + class="pr-2 pt-1 fas fa-save"> {{ $t("Create") }} @@ -292,17 +296,28 @@ v-bind="{ animation: 200, disabled: !new_supermarket.editmode }" > - - {{ categoryName(c) }} - - - + + +
+
+ +
+
+
+ {{ categoryName(c) }} + + + +
+
+
+
@@ -313,19 +328,34 @@ class="list-group" :list="notSupermarketCategory" group="category" - v-if="new_supermarket.editmode" @start="drag = true" @end="drag = false" ghost-class="ghost" + v-if="new_supermarket.editmode" v-bind="{ animation: 200 }" > - - {{ categoryName(c) }} - - - + + +
+
+ +
+
+
+ {{ categoryName(c) }} + + + +
+
+
+
@@ -341,7 +371,7 @@
{{ $t("mealplan_autoadd_shopping") }}
-
@@ -354,7 +384,7 @@
{{ $t("mealplan_autoadd_shopping") }}
-
@@ -368,7 +398,7 @@
{{ $t("mealplan_autoinclude_related") }}
-
@@ -404,7 +434,7 @@
{{ $t("shopping_auto_sync") }}
-
@@ -418,7 +448,7 @@
{{ $t("shopping_add_onhand") }}
-
@@ -432,11 +462,10 @@
{{ $t("shopping_recent_days") }}
-
-
@@ -447,7 +476,8 @@
{{ $t("filter_to_supermarket") }}
-
@@ -461,7 +491,7 @@
{{ $t("default_delay") }}
-
@@ -475,7 +505,7 @@
{{ $t("csv_delim_label") }}
- +
@@ -488,7 +518,7 @@
{{ $t("csv_prefix_label") }}
- +
@@ -498,6 +528,21 @@
+
+
{{ $t("left_handed") }}
+
+ +
+
+
+
+ + {{ $t("left_handed_help") }} + +
+
@@ -549,7 +594,6 @@ - {{ $t("OnHand") }} @@ -570,20 +614,29 @@
- @@ -654,6 +707,7 @@ export default { csv_delim: ",", csv_prefix: undefined, shopping_add_onhand: true, + left_handed: false }, new_supermarket: {entrymode: false, value: undefined, editmode: undefined}, new_category: {entrymode: false, value: undefined}, @@ -842,20 +896,22 @@ export default { // this.genericAPI inherited from ApiMixin addItem: function () { if (this.entry_mode_simple) { - this.genericPostAPI("api_ingredient_from_string", {text: this.new_item.ingredient}).then((result) => { + if (this.new_item.ingredient !== '' && this.new_item.ingredient !== undefined) { + this.genericPostAPI("api_ingredient_from_string", {text: this.new_item.ingredient}).then((result) => { let unit = null if (result.data.unit !== '') { - unit = {'name': result.data.unit} + unit = {'name': result.data.unit} } - this.new_item = { - amount: result.data.amount, - unit: unit, - food: {name: result.data.food}, - } - this.addEntry() - }) + this.new_item = { + amount: result.data.amount, + unit: unit, + food: {name: result.data.food}, + } + this.addEntry() + }) + } } else { this.addEntry() } @@ -1292,6 +1348,17 @@ export default { window.removeEventListener("online", this.updateOnlineStatus) window.removeEventListener("offline", this.updateOnlineStatus) }, + }, directives: { + hover: { + inserted: function (el) { + el.addEventListener("mouseenter", () => { + el.classList.add("shadow") + }) + el.addEventListener("mouseleave", () => { + el.classList.remove("shadow") + }) + }, + }, }, } @@ -1340,4 +1407,21 @@ export default { .form-control-append { font-size: 20px; } + +@media (max-width: 768px) { + #shoppinglist { + display: flex; + flex-direction: column; + flex-grow: 1; + overflow-y: scroll; + overflow-x: hidden; + height: 65vh; + padding-right: 8px !important; + } +} + +.settings-checkbox { + font-size: 0.3rem +} + diff --git a/vue/src/components/Buttons/CopyToClipboard.vue b/vue/src/components/Buttons/CopyToClipboard.vue index cb64987eb..6c555aa5c 100644 --- a/vue/src/components/Buttons/CopyToClipboard.vue +++ b/vue/src/components/Buttons/CopyToClipboard.vue @@ -1,5 +1,5 @@