mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Added a button to quickly create multiple tasks without having to close/reopen the dialog (closes #1776)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
- When using reverse proxy authentication (`ReverseProxyAuthMiddleware`), it's now also possible to pass the username in an environment variable instead of an HTTP header (new `config.php` option `REVERSE_PROXY_AUTH_USE_ENV`) (thanks @Forceu)
|
||||
- Performance improvements (page loading time) of the recipes page
|
||||
- New input shorthand `[+/-]n[d/m/y]` for date fields to quickly input a date relative to today (adding `+` or subtracting `-` the number of days/months/years, see the full list of available shorthands [here](https://github.com/grocy/grocy#input-shorthands-for-date-fields))
|
||||
- Added a "Save & add another task"-button on the add task dialog to quickly create multiple tasks without having to close/reopen the dialog
|
||||
- Fixed that stock entry labels on purchase were printed, even when "No label" was selected (was only a problem when running label printer WebHooks server side)
|
||||
- Fixed that when adding missing recipe ingredients, with the option "Only check if any amount is in stock" enabled, to the shopping list, unit conversions (if any) weren't considered
|
||||
- Fixed that the meal plan showed the total calories per recipe (instead of per serving as stated by the suffix)
|
||||
|
@@ -2280,3 +2280,9 @@ msgstr[1] ""
|
||||
|
||||
msgid "Set to 0 to hide due soon filters/highlighting"
|
||||
msgstr ""
|
||||
|
||||
msgid "Save & close"
|
||||
msgstr ""
|
||||
|
||||
msgid "Save & add another task"
|
||||
msgstr ""
|
||||
|
@@ -1,4 +1,4 @@
|
||||
$('#save-task-button').on('click', function(e)
|
||||
$('.save-task-button').on('click', function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
if (Grocy.EditMode === 'create')
|
||||
{
|
||||
var addAnother = $(e.currentTarget).hasClass("add-another");
|
||||
|
||||
Grocy.Api.Post('objects/tasks', jsonData,
|
||||
function(result)
|
||||
{
|
||||
@@ -24,11 +26,25 @@
|
||||
{
|
||||
if (GetUriParam("embedded") !== undefined)
|
||||
{
|
||||
window.parent.postMessage(WindowMessageBag("Reload"), Grocy.BaseUrl);
|
||||
if (addAnother)
|
||||
{
|
||||
window.location.href = U('/task/new?embedded');
|
||||
}
|
||||
else
|
||||
{
|
||||
window.parent.postMessage(WindowMessageBag("Reload"), Grocy.BaseUrl);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.href = U('/tasks');
|
||||
if (addAnother)
|
||||
{
|
||||
window.location.href = U('/task/new');
|
||||
}
|
||||
else
|
||||
{
|
||||
window.location.href = U('/tasks');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -82,7 +98,7 @@ $('#task-form input').keydown(function(event)
|
||||
}
|
||||
else
|
||||
{
|
||||
$('#save-task-button').click();
|
||||
$('.save-task-button').first().click();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -104,9 +104,12 @@
|
||||
'entity' => 'tasks'
|
||||
))
|
||||
|
||||
<button id="save-task-button"
|
||||
class="btn btn-success">{{ $__t('Save') }}</button>
|
||||
|
||||
@if($mode == 'edit')
|
||||
<button class="btn btn-success save-task-button">{{ $__t('Save') }}</button>
|
||||
@else
|
||||
<button class="btn btn-success save-task-button">{{ $__t('Save & close') }}</button>
|
||||
<button class="btn btn-primary save-task-button add-another">{{ $__t('Save & add another task') }}</button>
|
||||
@endif
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user