aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiederick de Vries <diederick@diederickdevries.net>2020-06-29 20:15:40 +0200
committerDiederick de Vries <diederick@diederickdevries.net>2020-06-29 20:15:40 +0200
commitfd84726b384243bb899648f32a5107bd9eb25761 (patch)
tree0a73bed422ccfb8a550d7cd69bef458309274751
parentd9caa021af064207095798ae94eb5f52b93411b2 (diff)
downloadboodschapi-fd84726b384243bb899648f32a5107bd9eb25761.tar.gz
boodschapi-fd84726b384243bb899648f32a5107bd9eb25761.tar.bz2
boodschapi-fd84726b384243bb899648f32a5107bd9eb25761.zip
feature:add button to add every grocery that is on every lists of the last three weeks
-rw-r--r--src/main/resources/static/images/fastforward.pngbin0 -> 700 bytes
-rw-r--r--src/main/resources/static/js/libcomposer.js21
-rw-r--r--src/main/resources/templates/composer.html3
3 files changed, 24 insertions, 0 deletions
diff --git a/src/main/resources/static/images/fastforward.png b/src/main/resources/static/images/fastforward.png
new file mode 100644
index 0000000..06882fb
--- /dev/null
+++ b/src/main/resources/static/images/fastforward.png
Binary files differ
diff --git a/src/main/resources/static/js/libcomposer.js b/src/main/resources/static/js/libcomposer.js
index 8eb7741..aa0ef1f 100644
--- a/src/main/resources/static/js/libcomposer.js
+++ b/src/main/resources/static/js/libcomposer.js
@@ -282,6 +282,27 @@ function setCursorByID(id, cursorStyle)
282 } 282 }
283} 283}
284 284
285function copyWeeklyBoughtItems()
286{
287 var weeknr = getWeekNr();
288
289 var ajax = $.ajax({
290 url: getContextPath() + "item/copyWeeklyBoughtItemsTo/" + weeknr,
291 type: "GET",
292 contentType: "application/json",
293 dataType: "json"
294 });
295
296 // Reloading the entire list to make absolutely sure the shopping list is accurate.
297 ajax.done(function()
298 {
299 $("#shoppinglistwrapper").load(getContextPath() + "composer?weeknr=" + weeknr + " #shoppinglists", function ()
300 {
301 initShoppingList();
302 });
303 });
304}
305
285function getContextPath() 306function getContextPath()
286{ 307{
287 return contextPath; 308 return contextPath;
diff --git a/src/main/resources/templates/composer.html b/src/main/resources/templates/composer.html
index 2c33a5d..9584330 100644
--- a/src/main/resources/templates/composer.html
+++ b/src/main/resources/templates/composer.html
@@ -61,6 +61,9 @@
61 <label for="editCategoriesCheckbox">Wijzig categori&euml;n</label> 61 <label for="editCategoriesCheckbox">Wijzig categori&euml;n</label>
62 <input id="editCategoriesCheckbox" type="checkbox" 62 <input id="editCategoriesCheckbox" type="checkbox"
63 th:checked="${editCategoriesCheckbox} == true" onchange="checkCategoriesEditing()"/> 63 th:checked="${editCategoriesCheckbox} == true" onchange="checkCategoriesEditing()"/>
64
65 <input type="image" th:src="@{/images/fastforward.png}" onclick="copyWeeklyBoughtItems()"
66 title="Kopi&euml;er wekelijks gekochte boodschappen"></input>
64 </p> 67 </p>
65 </div> 68 </div>
66 </div> 69 </div>