Skip to content
Snippets Groups Projects
Commit 96cd7b94 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

#338 - invert "ignore" options --> dont use "not"

parent bb998e0d
Branches
Tags
No related merge requests found
...@@ -80,8 +80,8 @@ public class TemplateController extends BaseController ...@@ -80,8 +80,8 @@ public class TemplateController extends BaseController
public String postNormal(@RequestParam(value = "templateName") String templateName, public String postNormal(@RequestParam(value = "templateName") String templateName,
@ModelAttribute("NewTransaction") Transaction transaction, @ModelAttribute("NewTransaction") Transaction transaction,
@RequestParam(value = "isPayment", required = false) boolean isPayment, @RequestParam(value = "isPayment", required = false) boolean isPayment,
@RequestParam(value = "ignoreCategory") Boolean ignoreCategory, @RequestParam(value = "includeCategory") Boolean includeCategory,
@RequestParam(value = "ignoreAccount") Boolean ignoreAccount) @RequestParam(value = "includeAccount") Boolean includeAccount)
{ {
transactionService.handleAmount(transaction, isPayment); transactionService.handleAmount(transaction, isPayment);
transactionService.handleTags(transaction); transactionService.handleTags(transaction);
...@@ -91,7 +91,7 @@ public class TemplateController extends BaseController ...@@ -91,7 +91,7 @@ public class TemplateController extends BaseController
throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "templateName must not be empty"); throw new ResponseStatusException(HttpStatus.BAD_REQUEST, "templateName must not be empty");
} }
templateService.createFromTransaction(templateName, transaction, ignoreCategory, ignoreAccount); templateService.createFromTransaction(templateName, transaction, includeCategory, includeAccount);
return "redirect:/templates"; return "redirect:/templates";
} }
......
...@@ -43,15 +43,15 @@ public class TemplateService implements Resetable ...@@ -43,15 +43,15 @@ public class TemplateService implements Resetable
{ {
} }
public void createFromTransaction(String templateName, Transaction transaction, boolean ignoreCategory, boolean ignoreAccount) public void createFromTransaction(String templateName, Transaction transaction, boolean includeCategory, boolean includeAccount)
{ {
final Template template = new Template(templateName, transaction); final Template template = new Template(templateName, transaction);
if(ignoreCategory) if(!includeCategory)
{ {
template.setCategory(null); template.setCategory(null);
} }
if(ignoreAccount) if(!includeAccount)
{ {
template.setAccount(null); template.setAccount(null);
} }
......
...@@ -246,8 +246,8 @@ search.in.description=Beschreibung ...@@ -246,8 +246,8 @@ search.in.description=Beschreibung
search.in.category=Kategorie search.in.category=Kategorie
search.in.tags=Tags search.in.tags=Tags
template.checkbox.ignore.category=Kategorie nicht übernehmen template.checkbox.include.category=Kategorie übernehmen
template.checkbox.ignore.account=Konto nicht übernehmen template.checkbox.include.account=Konto übernehmen
# ABOUT # ABOUT
about=Über {0} about=Über {0}
......
...@@ -246,8 +246,8 @@ search.in.description=Description ...@@ -246,8 +246,8 @@ search.in.description=Description
search.in.category=Category search.in.category=Category
search.in.tags=Tags search.in.tags=Tags
template.checkbox.ignore.category=Omit selected category template.checkbox.include.category=Include category
template.checkbox.ignore.account=Omit selected account template.checkbox.include.account=Include account
# ABOUT # ABOUT
about=About {0} about=About {0}
......
...@@ -67,8 +67,8 @@ function saveAsTemplate() ...@@ -67,8 +67,8 @@ function saveAsTemplate()
let form = document.getElementsByName('NewTransaction')[0]; let form = document.getElementsByName('NewTransaction')[0];
form.appendChild(createAdditionalHiddenInput('templateName', templateName)); form.appendChild(createAdditionalHiddenInput('templateName', templateName));
form.appendChild(createAdditionalHiddenInput('ignoreCategory', document.getElementById('ignore-category').checked)); form.appendChild(createAdditionalHiddenInput('includeCategory', document.getElementById('include-category').checked));
form.appendChild(createAdditionalHiddenInput('ignoreAccount', document.getElementById('ignore-account').checked)); form.appendChild(createAdditionalHiddenInput('includeAccount', document.getElementById('include-account').checked));
// replace form target url // replace form target url
form.action = $('#buttonCreateTemplate').attr('data-url'); form.action = $('#buttonCreateTemplate').attr('data-url');
......
...@@ -12,14 +12,14 @@ ...@@ -12,14 +12,14 @@
</div> </div>
<div class="col s12"> <div class="col s12">
<label> <label>
<input id="ignore-category" type="checkbox"> <input id="include-category" type="checkbox" checked="checked">
<span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.ignore.category')}</span> <span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.include.category')}</span>
</label> </label>
</div> </div>
<div class="col s12"> <div class="col s12">
<label> <label>
<input id="ignore-account" type="checkbox" checked="checked"> <input id="include-account" type="checkbox">
<span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.ignore.account')}</span> <span class="columnName-checkbox-label text-color">${locale.getString('template.checkbox.include.account')}</span>
</label> </label>
</div> </div>
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment