From 9f35add07f767266cc8b8644a71bac039fa48e99 Mon Sep 17 00:00:00 2001 From: Sebastian Kippe Date: Thu, 10 Sep 2020 16:28:01 +0200 Subject: [PATCH] WIP Reimbursement UI --- app/components/add-reimbursement/component.js | 25 ++++++- app/components/add-reimbursement/template.hbs | 71 +++++++++++++++++++ app/styles/_forms.scss | 2 + 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/app/components/add-reimbursement/component.js b/app/components/add-reimbursement/component.js index 79805cf..d151ba7 100644 --- a/app/components/add-reimbursement/component.js +++ b/app/components/add-reimbursement/component.js @@ -1,8 +1,31 @@ - import Component from '@glimmer/component'; +import { tracked } from '@glimmer/tracking'; +import { alias } from '@ember/object/computed'; import { inject as service } from '@ember/service'; +import { action } from '@ember/object'; +import { A } from '@ember/array'; export default class AddReimbursementComponent extends Component { @service kredits; + @tracked recipientId = null; + @tracked title = ""; + @tracked total = "0"; + @tracked expenses = A([]);; + + get typeofTotal() { + return typeof this.total; + } + + @alias('kredits.contributorsSorted') contributors; + + @action + submit(e) { + e.preventDefault(); + console.log('submit', e); + // TODO + // amount = parseFloat(this.total) + // token = "WBTC" (or token address) + // title = "Expenses covered by contributor.name" + } } diff --git a/app/components/add-reimbursement/template.hbs b/app/components/add-reimbursement/template.hbs index e69de29..0c64b88 100644 --- a/app/components/add-reimbursement/template.hbs +++ b/app/components/add-reimbursement/template.hbs @@ -0,0 +1,71 @@ +

+ Total: {{this.total}}
+ Total type: {{this.typeofTotal}} +

+ +
+ + + +

Expense items

+ {{#each this.expenses as |expense|}} + + + + + +
{{expense.title}} – {{expense.description}}{{fmt-fiat-currency expense.amount expense.currency}}
+

TODO: date, url, tags

+ {{/each}} + + + + + +

+ {{input type="submit" value="Submit"}} +

+
diff --git a/app/styles/_forms.scss b/app/styles/_forms.scss index 5153b02..ec11982 100644 --- a/app/styles/_forms.scss +++ b/app/styles/_forms.scss @@ -1,5 +1,7 @@ section#add-contributor, section#add-contribution, +section#add-contribution, +section#add-item, // TODO use for all forms for adding data section#signup { form {