diff options
author | tg(x) <*@tg-x.net> | 2016-03-02 16:53:14 +0100 |
---|---|---|
committer | tg(x) <*@tg-x.net> | 2016-03-02 16:53:14 +0100 |
commit | 51d6f9fd94d05741e733b01be915afeb5572f355 (patch) | |
tree | 024ef8cab1db8543574c6be33edf9dc2da0ef6ac /pages/confirm-contract.tsx | |
parent | cd331e1855fd4c7033e43622ec0a963fefe37bdb (diff) | |
parent | 13a8f36cad4d5d2ffec788ff6b4d5b61ed4ddff9 (diff) |
Merge branch 'master' of taler.net:/var/git/wallet-webex
Diffstat (limited to 'pages/confirm-contract.tsx')
-rw-r--r-- | pages/confirm-contract.tsx | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/pages/confirm-contract.tsx b/pages/confirm-contract.tsx index ff6ffba64..0c7419c6c 100644 --- a/pages/confirm-contract.tsx +++ b/pages/confirm-contract.tsx @@ -14,12 +14,21 @@ TALER; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/> */ -/// <reference path="../lib/decl/handlebars/handlebars.d.ts" /> -"use strict"; +/** + * Page shown to the user to confirm entering + * a contract. + * + * @author Florian Dold + */ + +/// <reference path="../lib/decl/handlebars/handlebars.d.ts" /> +import MithrilComponent = _mithril.MithrilComponent; import {substituteFulfillmentUrl} from "../lib/wallet/helpers"; +import m from "mithril"; +import {Contract} from "../lib/wallet/types"; +"use strict"; -declare var m: any; function prettyAmount(amount) { let v = amount.value + amount.fraction / 1e6; @@ -27,6 +36,35 @@ function prettyAmount(amount) { } +const Details = { + controller() { + return {collapsed: m.prop(true)}; + }, + view(ctrl, contract: Contract) { + if (ctrl.collapsed()) { + return m("div", [ + m("button.linky", { + onclick: () => { + ctrl.collapsed(false); + } + }, "show more details") + ]); + } else { + return m("div", [ + m("button.linky", { + onclick: () => { + ctrl.collapsed(true); + } + }, "show less details"), + m("div", [ + "Accepted exchanges:", + m("ul", contract.exchanges.map(e => m("li", `${e.url}: ${e.master_pub}`))) + ]) + ]); + } + } +}; + export function main() { let url = URI(document.location.href); let query: any = URI.parseQuery(url.query()); @@ -51,6 +89,7 @@ export function main() { `${p.description}: ${prettyAmount(p.price)}`))), m("button.confirm-pay", {onclick: doPayment}, i18n`Confirm Payment`), m("p", error ? error : []), + m(Details, contract) ]; } }; @@ -79,4 +118,4 @@ export function main() { offer); }); } -}
\ No newline at end of file +} |