diff --git a/app/components/forms/activity-form.hbs b/app/components/forms/activity-form.hbs index d3331c998..4774924dd 100644 --- a/app/components/forms/activity-form.hbs +++ b/app/components/forms/activity-form.hbs @@ -140,13 +140,13 @@ @errors={{@combinedErrors}} @errorMessage={{@errorMessage}} > - Annuleren - + diff --git a/app/components/forms/article-form.hbs b/app/components/forms/article-form.hbs index 2e8f93dc0..6fafbf4a6 100644 --- a/app/components/forms/article-form.hbs +++ b/app/components/forms/article-form.hbs @@ -73,7 +73,7 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - Annuleren + diff --git a/app/components/forms/book-form.hbs b/app/components/forms/book-form.hbs index 44eca7305..1bca986f1 100644 --- a/app/components/forms/book-form.hbs +++ b/app/components/forms/book-form.hbs @@ -98,19 +98,13 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - {{#if @model.isNew}} - - Annuleren - - {{else}} - - Annuleren - - {{/if}} + diff --git a/app/components/forms/category-form.hbs b/app/components/forms/category-form.hbs index c3075a1af..ea030c6db 100644 --- a/app/components/forms/category-form.hbs +++ b/app/components/forms/category-form.hbs @@ -15,15 +15,9 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - {{#if @model.isNew}} - - Annuleren - - {{else}} - - Annuleren - - {{/if}} + diff --git a/app/components/forms/group-form.hbs b/app/components/forms/group-form.hbs index 1e71335e6..f04b6a2c3 100644 --- a/app/components/forms/group-form.hbs +++ b/app/components/forms/group-form.hbs @@ -55,7 +55,7 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - Annuleren + diff --git a/app/components/forms/mail-alias-form.hbs b/app/components/forms/mail-alias-form.hbs index da9766427..48c77351c 100644 --- a/app/components/forms/mail-alias-form.hbs +++ b/app/components/forms/mail-alias-form.hbs @@ -101,9 +101,9 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - + diff --git a/app/components/forms/mandate-form.hbs b/app/components/forms/mandate-form.hbs index f210ee574..e43b0f43b 100644 --- a/app/components/forms/mandate-form.hbs +++ b/app/components/forms/mandate-form.hbs @@ -41,9 +41,9 @@ - + diff --git a/app/components/forms/photo-album-form.hbs b/app/components/forms/photo-album-form.hbs index 0d7b0a797..e16c2e753 100644 --- a/app/components/forms/photo-album-form.hbs +++ b/app/components/forms/photo-album-form.hbs @@ -73,9 +73,9 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - + diff --git a/app/components/forms/poll-form.hbs b/app/components/forms/poll-form.hbs index a8d667a7d..6e25c7782 100644 --- a/app/components/forms/poll-form.hbs +++ b/app/components/forms/poll-form.hbs @@ -36,13 +36,13 @@ @errors={{@combinedErrors}} @errorMessage={{@errorMessage}} > - Annuleren - + diff --git a/app/components/forms/post-form.hbs b/app/components/forms/post-form.hbs index a57309289..1b53df8f3 100644 --- a/app/components/forms/post-form.hbs +++ b/app/components/forms/post-form.hbs @@ -21,13 +21,13 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - Annuleren - + diff --git a/app/components/forms/static-page-form.hbs b/app/components/forms/static-page-form.hbs index f58bacdca..49c0287bc 100644 --- a/app/components/forms/static-page-form.hbs +++ b/app/components/forms/static-page-form.hbs @@ -42,9 +42,9 @@ - + diff --git a/app/components/forms/thread-form.hbs b/app/components/forms/thread-form.hbs index 33b9b52f4..f4389ad3c 100644 --- a/app/components/forms/thread-form.hbs +++ b/app/components/forms/thread-form.hbs @@ -1,26 +1,26 @@
-
{{if @model.thread.isNew 'Topic aanmaken' 'Topic wijzigen'}}
+
{{if @model.isNew 'Topic aanmaken' 'Topic wijzigen'}}
- {{#if @model.post}} + {{#if @model.isNew }} {{else}} {{#if (can 'edit forum/threads')}} @@ -31,22 +31,13 @@ @errors={{@model.errors}} @errorMessage={{@errorMessage}} > - {{#if @model.thread.isNew}} - - Annuleren - - {{else}} - - Annuleren - - {{/if}} +
diff --git a/app/components/forms/transaction-form.hbs b/app/components/forms/transaction-form.hbs index 64956be86..d25208572 100644 --- a/app/components/forms/transaction-form.hbs +++ b/app/components/forms/transaction-form.hbs @@ -36,9 +36,9 @@
- + diff --git a/app/components/forms/user-form.hbs b/app/components/forms/user-form.hbs index 62ba5a11d..a1dd04a49 100644 --- a/app/components/forms/user-form.hbs +++ b/app/components/forms/user-form.hbs @@ -170,8 +170,8 @@ @errorMessage={{@errorMessage}} @inputLayout='vertical' > - + \ No newline at end of file diff --git a/app/components/forum/forum-post-new.js b/app/components/forum/forum-post-new.js index 6cd0f08c9..037605e85 100644 --- a/app/components/forum/forum-post-new.js +++ b/app/components/forum/forum-post-new.js @@ -2,25 +2,23 @@ import { inject as service } from '@ember/service'; import Component from '@ember/component'; import { action } from '@ember/object'; +// todo: incorporate the model-save-util into components? export default class ForumPostNewComponent extends Component { @service store; - @service('flash-notice') flashNotice; + @service flashNotice; @action - save() { + async save() { let { content, thread } = this; - - this.store + await this.store .createRecord('forum/post', { message: content, thread, }) - .save() - .then(() => { - this.flashNotice.sendSuccess('Forumbericht toegevoegd!'); - this.set('content', ''); - this.onSubmit(); - }); + .save(); + this.flashNotice.sendSuccess('Forumbericht toegevoegd!'); + this.set('content', ''); + this.onSubmit(); } @action diff --git a/app/components/users/privacy-settings.hbs b/app/components/users/privacy-settings.hbs index 819c308ba..3da63404b 100644 --- a/app/components/users/privacy-settings.hbs +++ b/app/components/users/privacy-settings.hbs @@ -1,5 +1,5 @@
Privacyinstellingen
-
+ {{#if isOwnUser}}
\ No newline at end of file diff --git a/app/templates/articles/destroy.hbs b/app/templates/articles/destroy.hbs index ec381b76e..c0c45121a 100644 --- a/app/templates/articles/destroy.hbs +++ b/app/templates/articles/destroy.hbs @@ -11,11 +11,11 @@ {{/if}} \ No newline at end of file diff --git a/app/templates/articles/edit.hbs b/app/templates/articles/edit.hbs index f01658f23..f4cf3818c 100644 --- a/app/templates/articles/edit.hbs +++ b/app/templates/articles/edit.hbs @@ -5,6 +5,7 @@ \ No newline at end of file diff --git a/app/templates/books/edit.hbs b/app/templates/books/edit.hbs index 378cf0a66..08ad373fe 100644 --- a/app/templates/books/edit.hbs +++ b/app/templates/books/edit.hbs @@ -11,6 +11,7 @@ @lookupIsbnError={{this.lookupIsbnError}} @errorMessage={{this.errorMessage}} @onSubmit={{action 'submit'}} + @onCancel={{action 'cancel'}} @onToggleScanner={{action 'toggleScanner'}} @onDevicesFound={{action 'onDevicesFound'}} @onScanSuccess={{action 'onScanSuccess'}} diff --git a/app/templates/books/new.hbs b/app/templates/books/new.hbs index 378cf0a66..d5ce91132 100644 --- a/app/templates/books/new.hbs +++ b/app/templates/books/new.hbs @@ -11,6 +11,7 @@ @lookupIsbnError={{this.lookupIsbnError}} @errorMessage={{this.errorMessage}} @onSubmit={{action 'submit'}} + @onCancel={{this.cancel}} @onToggleScanner={{action 'toggleScanner'}} @onDevicesFound={{action 'onDevicesFound'}} @onScanSuccess={{action 'onScanSuccess'}} diff --git a/app/templates/debit/collections/destroy.hbs b/app/templates/debit/collections/destroy.hbs index 680a25658..2471a07fe 100644 --- a/app/templates/debit/collections/destroy.hbs +++ b/app/templates/debit/collections/destroy.hbs @@ -11,7 +11,7 @@ {{/if}} diff --git a/app/templates/debit/collections/new.hbs b/app/templates/debit/collections/new.hbs index 3afa42c59..6c0e2746e 100644 --- a/app/templates/debit/collections/new.hbs +++ b/app/templates/debit/collections/new.hbs @@ -36,8 +36,8 @@ @property='importFile' @label='Import file' @loadedCallback={{action 'fileLoaded'}} - @validExtensions={{validExtensions}} - @validMimetypes={{validMimetypes}} + @validExtensions={{this.validExtensions}} + @validMimetypes={{this.validMimetypes}} />
- {{@model.collection.name}} + {{@model.name}} - - {{moment-format @model.collection.date 'DD-MM-YYYY'}} + {{moment-format @model.date 'DD-MM-YYYY'}}
Gemaakt door - {{@model.collection.author.fullName}} + {{@model.author.fullName}}
diff --git a/app/templates/debit/mandates/edit.hbs b/app/templates/debit/mandates/edit.hbs index 198b5cba0..a3a15eb5b 100644 --- a/app/templates/debit/mandates/edit.hbs +++ b/app/templates/debit/mandates/edit.hbs @@ -3,6 +3,7 @@ \ No newline at end of file diff --git a/app/templates/debit/mandates/new.hbs b/app/templates/debit/mandates/new.hbs index 2e243460c..715f527e8 100644 --- a/app/templates/debit/mandates/new.hbs +++ b/app/templates/debit/mandates/new.hbs @@ -3,6 +3,7 @@ \ No newline at end of file diff --git a/app/templates/debit/transactions/destroy.hbs b/app/templates/debit/transactions/destroy.hbs index 1f5f90365..6628447ef 100644 --- a/app/templates/debit/transactions/destroy.hbs +++ b/app/templates/debit/transactions/destroy.hbs @@ -14,7 +14,7 @@ {{/if}} - - - Nee - + + {{#if errorMessage}}
{{this.errorMessage}}
diff --git a/app/templates/forum/categories/category/destroy.hbs b/app/templates/forum/categories/category/destroy.hbs index 0770e6427..63c238c93 100644 --- a/app/templates/forum/categories/category/destroy.hbs +++ b/app/templates/forum/categories/category/destroy.hbs @@ -12,15 +12,11 @@ {{/if}} \ No newline at end of file diff --git a/app/templates/forum/categories/category/edit.hbs b/app/templates/forum/categories/category/edit.hbs index b79838a2e..0005c2a9f 100644 --- a/app/templates/forum/categories/category/edit.hbs +++ b/app/templates/forum/categories/category/edit.hbs @@ -1,5 +1,6 @@ \ No newline at end of file diff --git a/app/templates/forum/categories/category/threads/new.hbs b/app/templates/forum/categories/category/threads/new.hbs index 94fa22309..5a888472b 100644 --- a/app/templates/forum/categories/category/threads/new.hbs +++ b/app/templates/forum/categories/category/threads/new.hbs @@ -1,5 +1,6 @@ \ No newline at end of file diff --git a/app/templates/forum/categories/category/threads/thread/destroy.hbs b/app/templates/forum/categories/category/threads/thread/destroy.hbs index 4c38b8a48..8f4a951db 100644 --- a/app/templates/forum/categories/category/threads/thread/destroy.hbs +++ b/app/templates/forum/categories/category/threads/thread/destroy.hbs @@ -11,15 +11,11 @@ {{/if}} \ No newline at end of file diff --git a/app/templates/forum/categories/category/threads/thread/edit.hbs b/app/templates/forum/categories/category/threads/thread/edit.hbs index 94fa22309..5a888472b 100644 --- a/app/templates/forum/categories/category/threads/thread/edit.hbs +++ b/app/templates/forum/categories/category/threads/thread/edit.hbs @@ -1,5 +1,6 @@ \ No newline at end of file diff --git a/app/templates/forum/categories/category/threads/thread/posts/destroy.hbs b/app/templates/forum/categories/category/threads/thread/posts/destroy.hbs index 7515d3ebf..92e43171d 100644 --- a/app/templates/forum/categories/category/threads/thread/posts/destroy.hbs +++ b/app/templates/forum/categories/category/threads/thread/posts/destroy.hbs @@ -18,15 +18,15 @@ {{/if}} \ No newline at end of file diff --git a/app/templates/forum/categories/category/threads/thread/posts/edit.hbs b/app/templates/forum/categories/category/threads/thread/posts/edit.hbs index 4a5a07983..07604a864 100644 --- a/app/templates/forum/categories/category/threads/thread/posts/edit.hbs +++ b/app/templates/forum/categories/category/threads/thread/posts/edit.hbs @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/templates/forum/categories/category/threads/thread/posts/index.hbs b/app/templates/forum/categories/category/threads/thread/posts/index.hbs index 52d9e7338..b9cb9eb5f 100644 --- a/app/templates/forum/categories/category/threads/thread/posts/index.hbs +++ b/app/templates/forum/categories/category/threads/thread/posts/index.hbs @@ -3,11 +3,11 @@
- +
- {{#each @model.posts as |post|}} + {{#each @model.postsPaged as |post|}} {{#unless post.isDeleted}} {{forum/forum-post post @@ -19,10 +19,10 @@ {{#if currentPageIsLastPage}} - {{#unless @model.thread.isOpen}} + {{#unless @model.isOpen}} {{/unless}} - {{#if (can 'create post for forum/thread' @model.thread)}} + {{#if (can 'create post for forum/thread' @model)}}
Reageren
@@ -47,5 +47,5 @@ {{/if}}
- +
\ No newline at end of file diff --git a/app/templates/forum/categories/new.hbs b/app/templates/forum/categories/new.hbs index b79838a2e..0005c2a9f 100644 --- a/app/templates/forum/categories/new.hbs +++ b/app/templates/forum/categories/new.hbs @@ -1,5 +1,6 @@ \ No newline at end of file diff --git a/app/templates/groups/edit.hbs b/app/templates/groups/edit.hbs index 9644b420b..c624513ab 100644 --- a/app/templates/groups/edit.hbs +++ b/app/templates/groups/edit.hbs @@ -1,6 +1,7 @@ Weet je zeker dat je dit mail-alias ({{@model.email}}) wil verwijderen?

- - - Nee - + + {{#if errorMessage}}
{{this.errorMessage}}
diff --git a/app/templates/mail-aliases/edit.hbs b/app/templates/mail-aliases/edit.hbs index 44333ff1c..a711abc7b 100644 --- a/app/templates/mail-aliases/edit.hbs +++ b/app/templates/mail-aliases/edit.hbs @@ -1,6 +1,7 @@ Weet je zeker dat je deze mail ({{@model.subject}}) wil negeren?

Er wordt geen bericht gestuurd naar de afzender.

- + \ No newline at end of file diff --git a/app/templates/photo-albums/photo-album/destroy.hbs b/app/templates/photo-albums/photo-album/destroy.hbs index 5e62b2719..72e87470d 100644 --- a/app/templates/photo-albums/photo-album/destroy.hbs +++ b/app/templates/photo-albums/photo-album/destroy.hbs @@ -11,15 +11,9 @@ {{/if}}
\ No newline at end of file diff --git a/app/templates/photo-albums/photo-album/edit.hbs b/app/templates/photo-albums/photo-album/edit.hbs index 830ac401d..e5fe92e0b 100644 --- a/app/templates/photo-albums/photo-album/edit.hbs +++ b/app/templates/photo-albums/photo-album/edit.hbs @@ -1,6 +1,7 @@ diff --git a/app/templates/users/edit-permissions.hbs b/app/templates/users/edit-permissions.hbs index a955781d8..b85fbdfb2 100644 --- a/app/templates/users/edit-permissions.hbs +++ b/app/templates/users/edit-permissions.hbs @@ -11,13 +11,13 @@ @errorMessage={{this.errorMessage}} @inputLayout='vertical' > - Annuleren - + \ No newline at end of file diff --git a/app/templates/users/edit-privacy.hbs b/app/templates/users/edit-privacy.hbs index 1acccc0da..686ec8c39 100644 --- a/app/templates/users/edit-privacy.hbs +++ b/app/templates/users/edit-privacy.hbs @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/app/templates/users/edit.hbs b/app/templates/users/edit.hbs index 00a613e70..70c5cd7c5 100644 --- a/app/templates/users/edit.hbs +++ b/app/templates/users/edit.hbs @@ -2,6 +2,7 @@ err.detail) + .join(', '); } else { - const targetModel = this.entity.successTransitionModel || model; - this.entity.transitionToRoute( - this.entity.successTransitionTarget, - targetModel - ); + this.entity.errorMessage = String(error); } } } - onError(error) { - this.entity.errorMessage = error.errors.map((err) => err.detail).join(', '); + async saveModel(model) { + this.entity.errorMessage = null; + if (!isNone(model)) { + try { + const savedModel = await model.save(); + this.onSuccess(savedModel); + } catch (error) { + this.onError(error); + } + } } - saveModel(model) { + async saveModelWithForm(model) { + this.entity.errorMessage = null; + if (!isNone(model)) { + try { + const savedModel = await model.saveWithForm(); + this.onSuccess(savedModel); + } catch (error) { + this.onError(error); + } + } + } + + destroyModel(model) { this.entity.errorMessage = null; if (!isNone(model)) { model - .save() - .then((savedModel) => { - this.onSuccess(savedModel); + .destroyRecord() + .then(() => { + this.entity.destroyed = true; + this.onSuccess(); }) .catch((error) => { this.onError(error); }); } } + + cancelEdit() { + this.entity.errorMessage = null; + this.onCancel(); + } }