Add save button

This commit is contained in:
Jay Trees 2022-04-06 16:27:48 +02:00
parent 533c594fa9
commit 89c7d7c154
3 changed files with 22 additions and 0 deletions

View file

@ -75,4 +75,17 @@ $(function() {
}
});
});
/**
* Save wishlist
*/
$(document).on('click', '.button.save', function() {
$(this).addClass('disabled loading');
setTimeout(() => {
$(this).find('.icon').addClass('red');
$(this).find('span').text(text.button_wishlist_saved);
$(this).removeClass('disabled loading');
}, 400);
});
});

View file

@ -311,6 +311,8 @@ class Page
form_prompt_minCount : '<?= __('{name} must have at least {ruleValue} choices') ?>',
form_prompt_exactCount : '<?= __('{name} must have exactly {ruleValue} choices') ?>',
form_prompt_maxCount : '<?= __('{name} must have {ruleValue} or less choices') ?>',
button_wishlist_saved : '<?= __('Saved') ?>',
};
</script>
<?php

View file

@ -29,6 +29,13 @@ $page->navigation();
<div class="ui container">
<h1 class="ui header"><?= $page->title ?></h1>
<?php if ($user->isLoggedIn() && $user->id !== intval($wishlist->user)) { ?>
<button class="ui white small basic labeled icon button save">
<i class="heart icon"></i>
<span><?= __('Save list') ?></span>
</button>
<?php } ?>
<?php
/**
* Warn the wishlist creator