Update contributor profiles

* Adds a new page for updating profiles
* Refactors the add-contributor component to allow for updating
  existing contributors
* Adds input labels to the contributor form and improves placeholders
* Adds event handlers for all contract contributor changes and uses them
  for updating the UI

refs #122
This commit is contained in:
2019-05-29 16:14:11 +02:00
parent 58bd729acb
commit 1c1f772ff5
11 changed files with 147 additions and 52 deletions
+18
View File
@@ -0,0 +1,18 @@
import Controller from '@ember/controller';
import { inject as service } from '@ember/service';
export default Controller.extend({
kredits: service(),
actions: {
save (attributes) {
return this.kredits
.updateContributor(this.model.id, attributes)
.then(() => this.transitionToRoute('index'))
}
}
});
+3 -8
View File
@@ -1,21 +1,16 @@
import Controller from '@ember/controller';
import { alias } from '@ember/object/computed';
import { inject as service } from '@ember/service';
export default Controller.extend({
kredits: service(),
contributors: alias('kredits.contributors'),
actions: {
save (contributor) {
return this.kredits.addContributor(contributor)
.then(contributor => {
this.transitionToRoute('index');
return contributor;
});
return this.kredits
.addContributor(contributor)
.then(() => this.transitionToRoute('index'))
}
}