From dd6b062af418bb487b20a04b28ba74f9bf498f0a Mon Sep 17 00:00:00 2001 From: Kurt Riddlesperger Date: Thu, 19 Dec 2019 12:18:40 -0600 Subject: [PATCH] Set location as freezer --- grocy.openapi.json | 5 +++++ public/viewjs/locationform.js | 1 + views/components/locationpicker.blade.php | 2 +- views/locationform.blade.php | 8 ++++++++ views/locations.blade.php | 4 ++++ 5 files changed, 19 insertions(+), 1 deletion(-) diff --git a/grocy.openapi.json b/grocy.openapi.json index 4fd92a4d..73742448 100644 --- a/grocy.openapi.json +++ b/grocy.openapi.json @@ -3368,6 +3368,9 @@ "description": { "type": "string" }, + "freezer": { + "type": "integer" + }, "row_created_timestamp": { "type": "string", "format": "date-time" @@ -3377,6 +3380,7 @@ "id": "2", "name": "0", "description": null, + "freezer": "0", "row_created_timestamp": "2019-05-02 20:12:25" } }, @@ -3579,6 +3583,7 @@ "location": { "id": "4", "name": "Candy cupboard", + "freezer": "0", "description": null, "row_created_timestamp": "2019-05-02 20:12:25" }, diff --git a/public/viewjs/locationform.js b/public/viewjs/locationform.js index 65e7862b..19a7e9fd 100644 --- a/public/viewjs/locationform.js +++ b/public/viewjs/locationform.js @@ -4,6 +4,7 @@ var jsonData = $('#location-form').serializeJSON(); Grocy.FrontendHelpers.BeginUiBusy("location-form"); + jsonData.freezer = $('#freezer').is(':checked'); if (Grocy.EditMode === 'create') { diff --git a/views/components/locationpicker.blade.php b/views/components/locationpicker.blade.php index b219ed20..e7f492ab 100644 --- a/views/components/locationpicker.blade.php +++ b/views/components/locationpicker.blade.php @@ -12,7 +12,7 @@
{{ $__t('You have to select a location') }}
diff --git a/views/locationform.blade.php b/views/locationform.blade.php index aa78e8f1..1617d72d 100644 --- a/views/locationform.blade.php +++ b/views/locationform.blade.php @@ -27,6 +27,14 @@
{{ $__t('A name is required') }}
+
+
+ + freezer == 1) checked @endif class="form-check-input" type="checkbox" id="freezer" name="freezer" value="1"> + +
+
+
diff --git a/views/locations.blade.php b/views/locations.blade.php index ea151573..c3d0becd 100644 --- a/views/locations.blade.php +++ b/views/locations.blade.php @@ -33,6 +33,7 @@ {{ $__t('Name') }} + {{ $__t('Freezer') }} {{ $__t('Description') }} @include('components.userfields_thead', array( @@ -55,6 +56,9 @@ {{ $location->name }} + + {{ $location->freezer }} + {{ $location->description }}