diff --git a/src/api/wishes.php b/src/api/wishes.php index 74424633..41fe2602 100644 --- a/src/api/wishes.php +++ b/src/api/wishes.php @@ -56,21 +56,25 @@ switch ($_SERVER['REQUEST_METHOD']) { $wishlist_id = $_POST['wishlist_id']; $wish_title = trim($_POST['wish_title']); - $wish_description = $_POST['wish_description'] ?: ''; + $wish_description = trim($_POST['wish_description']); $wish_url = trim($_POST['wish_url']); + $wish_priority = isset($_POST['wish_priority']) && $_POST['wish_priority'] ? $_POST['wish_priority'] : 'NULL'; - $database->query('INSERT INTO `wishes` - ( - `wishlist`, - `title`, - `description`, - `url` - ) VALUES (' - . $wishlist_id . ', - "' . $wish_title . '", - "' . $wish_description . '", - "' . $wish_url . '" - ) + $database + ->query('INSERT INTO `wishes` + ( + `wishlist`, + `title`, + `description`, + `url`, + `priority` + ) VALUES ( + ' . $wishlist_id . ', + "' . $wish_title . '", + "' . $wish_description . '", + "' . $wish_url . '", + ' . $wish_priority . ' + ) ;'); $response['data'] = array( diff --git a/src/assets/js/parts/wish-priority.js b/src/assets/js/parts/wish-priority.js new file mode 100644 index 00000000..16243546 --- /dev/null +++ b/src/assets/js/parts/wish-priority.js @@ -0,0 +1,8 @@ +$(function () { + + /** + * Priority + */ + $('.dropdown.priority').dropdown(); + +}); diff --git a/src/assets/js/wish.js b/src/assets/js/wish.js index f7868ba3..d06da9df 100644 --- a/src/assets/js/wish.js +++ b/src/assets/js/wish.js @@ -144,9 +144,4 @@ $(function () { }); }); - /** - * Priority - */ - $('.dropdown.priority').dropdown(); - }); diff --git a/src/assets/js/wishlists.js b/src/assets/js/wishlists.js index bfbfbd02..fca609b1 100644 --- a/src/assets/js/wishlists.js +++ b/src/assets/js/wishlists.js @@ -55,8 +55,6 @@ $(function () { /** Update URL */ urlParams.set('id', wishlistValue); - console.log(wishlistValue); - fetch('/src/api/url.php?url=' + window.btoa(urlParams.toString()), { method: 'GET' }) @@ -368,8 +366,8 @@ $(function () { modalWishlistWishAdd.find('[name="wishlist_id"]').val($('.ui.dropdown.wishlists').dropdown('get value')); modalWishlistWishAdd .modal({ - autoShow : true, - onApprove: function (buttonAdd) { + autoShow : true, + onApprove : function (buttonAdd) { buttonAdd.addClass('loading'); var form = $('.form.wishlist-wish-add'); diff --git a/src/pages/install.php b/src/pages/install.php index bf2e2e8d..857b2a27 100644 --- a/src/pages/install.php +++ b/src/pages/install.php @@ -31,7 +31,7 @@ switch ($step) {

-
+ @@ -101,7 +101,7 @@ switch ($step) {

- + diff --git a/src/pages/login-as.php b/src/pages/login-as.php index 2c41d643..67fea9aa 100644 --- a/src/pages/login-as.php +++ b/src/pages/login-as.php @@ -43,7 +43,7 @@ $page->navigation(); ?>
- +
diff --git a/src/pages/login.php b/src/pages/login.php index 92fc345f..74ab8dbf 100644 --- a/src/pages/login.php +++ b/src/pages/login.php @@ -105,7 +105,7 @@ $page->navigation();

- +
@@ -147,7 +147,7 @@ $page->navigation(); getOption('mjml_api_key') && $options->getOption('mjml_api_secret')) { ?>

- +

diff --git a/src/pages/parts/wish-add.php b/src/pages/parts/wish-add.php new file mode 100644 index 00000000..e71461e5 --- /dev/null +++ b/src/pages/parts/wish-add.php @@ -0,0 +1,71 @@ + + */ + +use wishthis\Wish; + +$scriptPart = '/src/assets/js/parts/wish-priority.js'; +?> + + +
+
+ +
+ + +
+ +
+
+ +
+ + + +
+ +
+ +
+ +
+ + + +
+ +
+ + + +
+ +
+
diff --git a/src/pages/parts/wishlist-filter.php b/src/pages/parts/wishlist-filter.php index 07cabbbf..2b45299d 100644 --- a/src/pages/parts/wishlist-filter.php +++ b/src/pages/parts/wishlist-filter.php @@ -8,7 +8,7 @@ use wishthis\Wish; $scriptPart = '/src/assets/js/parts/wishlist-filter.js'; ?> - +
diff --git a/src/pages/register.php b/src/pages/register.php index 458d91b7..91e862e9 100644 --- a/src/pages/register.php +++ b/src/pages/register.php @@ -164,7 +164,7 @@ $page->navigation(); messages() ?>
- +
diff --git a/src/pages/update.php b/src/pages/update.php index 2070700f..c003029c 100644 --- a/src/pages/update.php +++ b/src/pages/update.php @@ -67,7 +67,7 @@ $page->navigation();

- +