forked from decred/dcrdex
/
forms.tmpl
297 lines (288 loc) · 12.7 KB
/
forms.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
{{define "walletConfigTemplates"}}
<div class="py-2 px-1 d-flex justify-content-between align-items-center">
Wallet Settings
<div data-tmpl="fileSelector" class="d-inline-block hoverbg pointer fs14"><span class="ico-textfile mr-1"></span> load from file</div>
<input data-tmpl="fileInput" type="file" class="form-control select d-none">
</div>
<div data-tmpl="allSettings">
<div data-tmpl="dynamicOpts" class="dynamicopts">
<div data-tmpl="textInput" class="px-0 d-flex flex-column justify-content-end">
<label class="pl-1 mb-1 small"> <span class="ico-info"></span></label>
<input type="text" class="form-control select">
</div>
<div data-tmpl="checkbox" class="pl-4 d-flex align-items-center justify-content-center">
<div>
<input class="form-check-input" type="checkbox" value="">
<label class="form-check-label fs14"> <span class="ico-info fs13"></span></label>
</div>
</div>
</div>
<div data-tmpl="showOther" class="d-hide mt-3 mb-1 pointer d-flex align-items-center justify-content-start">
<span data-tmpl="showIcon" class="ico-plus fs8 pl-1"></span>
<span data-tmpl="hideIcon" class="ico-minus fs8 pl-1"></span>
<span data-tmpl="showHideMsg" class="d-inline-block pl-1 pb-1"></span>
</div>
<div data-tmpl="otherSettings" class="d-hide">
<div data-tmpl="loadedSettingsMsg" class="fs15 pt-3 pb-1 pl-1">— loaded from file —</div>
<div data-tmpl="loadedSettings" class="dynamicopts"></div>
<div data-tmpl="defaultSettingsMsg" class="fs15 pt-3 pb-1 pl-1">— defaults —</div>
<div data-tmpl="defaultSettings" class="dynamicopts"></div>
</div>
</div>
<div data-tmpl="errMsg" class="fs15 pt-3 text-center d-hide errcolor"></div>
{{end}}
{{define "newWalletForm"}}
<div class="bg2 px-2 py-1 text-center fs18 position-relative">
Add a
<img id="nwAssetLogo" class="micro-icon mx-1">
<span id="nwAssetName"></span>
Wallet
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
{{if .}}
<div class="fs16" id="nwRegMsg">{{.}}</div>
<hr class="dashed mt-4">
{{end}}
<div id="walletSettings">
{{template "walletConfigTemplates"}}
</div>
<hr class="dashed my-2">
<div>
{{if .}}
<label for="newWalletPass" class="pt-3 pl-1 mb-0">Wallet Password</label>
<div class="fs14 px-1 mb-1">This is the password you have configured with your wallet software.</div>
{{else}}
<label for="newWalletPass" class="pt-3 pl-1 mb-1">Wallet Password
{{if not .}} {{- /* Don't show this for registration (when . is set), since Decred always requires a password. */ -}}
<span class="ico-info" data-tooltip="Leave the password empty if there is no password required for the wallet."></span>
{{end}}
</label>
{{end}}
<input type="password" class="form-control select" id="newWalletPass" autocomplete="off">
</div>
<div id="newWalletAppPWBox">
{{if .}}
<label for="nwAppPass" class="pt-3 pl-1 mb-0">App Password</label>
<div class="fs14 px-1 mb-1">Your app password is always required when performing sensitive wallet operations.</div>
{{else}}
<label for="nwAppPass" class="pt-3 pl-1 mb-1">App Password</label>
{{end}}
<input type="password" class="form-control select" id="nwAppPass" autocomplete="off">
</div>
<div class="d-flex justify-content-end mt-4">
<button id="submitAdd" type="submit" class="col-8 justify-content-center fs15 bg2 selected">Add</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="newWalletErr"></div>
</div>
{{end}}
{{define "unlockWalletForm"}}
<div class="bg2 px-2 py-1 text-center fs18 position-relative">
Unlock
<img id="uwAssetLogo" class="micro-icon mx-1">
<span id="uwAssetName"></span>
Wallet
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
{{if .}}
<div class="fs16">{{.}}</div>
<hr class="dashed my-4">
{{end}}
<div id="uwAppPassBox">
<label for="uwAppPass" class="pl-1 mb-0">App Password</label>
<div class="fs14 px-1 mb-1">Your app password is always required when performing sensitive wallet operations.</div>
<input type="password" class="form-control select" id="uwAppPass" autocomplete="off">
</div>
<div id="submitUnlockDiv" class="d-flex justify-content-end mt-4">
<button id="submitUnlock" type="submit" class="col-8 justify-content-center fs15 bg2 selected">Unlock</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="unlockErr"></div>
</div>
{{end}}
{{define "dexAddrForm"}}
<div class="bg2 px-2 pt-1 mb-3 text-center fs18">Add a DEX</div>
<div class="p-4">
<div>
<label for="dexAddr" class="pl-1 mb-1">DEX Address</label>
<input type="text" class="form-control select" id="dexAddr">
</div>
<div class="px-1 mt-3 fs14 pointer d-flex justify-content-start align-items-center" id="dexShowMore"><span class="ico-plus fs11"></span> <div class="pl-2">Show more options</div></div>
<div class="d-hide pt-3" id="dexCertBox">
<div class="px-1 my-1 mb-2 fs14 d-hide" id="dexNeedCert">
Looks like we don't have an SSL certificate for this DEX.
Add the server's certificate to continue.
</div>
<div class="pl-1 mb-1 my-1 pointer">TLS Certificate</div>
<input type="file" class="form-control select d-none" id="certFile">
<div class="pl-1 mt-2 fs15">
<span id="selectedCert"></span>
<span class="underline ml-3 pointer d-hide" id="removeCert">remove</span>
<span class="underline ml-3 pointer" id="addCert">add a file</span>
</div>
</div>
<div class="d-flex mt-3">
<div class="col-12 p-0">
<div id="dexAddrAppPWBox">
<label for="dexAddrAppPW" class="pl-1 mb-1">App Password</label>
<input type="password" class="form-control select" id="dexAddrAppPW" autocomplete="current-password">
</div>
</div>
<div class="col-12 d-flex justify-content-end align-items-end p-0">
<button id="submitDEXAddr" type="button" class="col-16 justify-content-center fs15 bg2 selected">Submit</button>
</div>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="dexAddrErr"></div>
</div>
{{end}}
{{define "confirmRegistrationForm"}}
{{$passwordIsCached := .UserInfo.PasswordIsCached}}
<div class="bg2 px-2 py-1 text-center position-relative fs18">
Confirm Registration
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
<div class="fs16">
<span {{if $passwordIsCached}}class="d-hide"{{end}}>Enter your app password to confirm DEX registration.</span>
When you submit this form, <span id="feeDisplay"></span> DCR will be spent from your Decred wallet to pay
registration fees.
</div>
<div class="fs16 mt-4">
The DCR lot size for the <span id="dcrBaseMarketName" class="mono"></span> market is <span id="dexDCRLotSize"></span> DCR.
All trades on this market are in multiples of this lot size.
This is the minimum possible trade amount in DCR.
{{- /* this will change when lot size is a market setting, not an asset setting */ -}}
</div>
<hr class="dashed my-4">
<div {{if $passwordIsCached}}class="d-hide"{{end}}>
<label for="appPass" class="pl-1 mb-1">Password</label>
<input type="password" class="form-control select" id="appPass" autocomplete="current-password">
</div>
<div class="d-flex justify-content-end mt-4">
<button id="submitConfirm" type="button" class="col-8 justify-content-center fs15 bg2 selected">Register</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="regErr"></div>
</div>
{{end}}
{{define "authorizeAccountExportForm"}}
<div class="bg2 px-2 py-1 text-center position-relative fs18">
Authorize Export
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
<div class="fs16">
Enter your app password to confirm Account export for: <span id="exportAccountHost"></span>.
</div>
<hr class="dashed my-4">
<div>
<label for="exportAccountAppPass" class="pl-1 mb-1">Password</label>
<input type="password" class="form-control select" id="exportAccountAppPass" autocomplete="current-password">
</div>
<div class="d-flex justify-content-end mt-4">
<button id="authorizeExportAccountConfirm" type="button" class="col-8 justify-content-center fs15 bg2 selected">Authorize Export</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="exportAccountErr"></div>
</div>
{{end}}
{{ define "disableAccountForm"}}
<div class="bg2 px-2 py-1 text-center position-relative fs18">
Disable Account
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
<div class="fs16">
Enter your app password to disable account: <span id="disableAccountHost"></span>.
</div>
<hr class="dashed my-4">
<div class="my-2">
<span class="red">Note:</span> This action is irreversible - once an account is disabled it can't
be re-enabled.
</div>
<hr class="dashed my-4">
<div>
<label for="disableAccountAppPW" class="pl-1 mb-1">Password</label>
<input type="password" class="form-control select" id="disableAccountAppPW" autocomplete="current-password">
</div>
<div class="d-flex justify-content-end mt-4">
<button id="disableAccountConfirm" type="button" class="col-8 justify-content-center fs15 bg2 selected">Disable Account</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="disableAccountErr"></div>
</div>
{{end}}
{{define "authorizeAccountImportForm"}}
{{$passwordIsCached := .UserInfo.PasswordIsCached}}
<div class="bg2 px-2 py-1 text-center position-relative fs18">
Authorize Import
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
<div class="fs16">
Enter your app password to confirm Account import.
</div>
<hr class="dashed my-4">
<div>
<div class="pl-1 mb-1 mt-4 pointer">Account File</div>
<input type="file" class="form-control select d-none" id="accountFile">
<div class="pl-1 mt-2 fs15">
<span id="selectedAccount"></span>
<span class="underline ml-3 pointer d-hide" id="removeAccount">remove</span>
<span class="ml-3 pointer" id="addAccount"><span class="ico-textfile mr-1"></span> load from file</span>
</div>
</div>
<div {{if $passwordIsCached}}class="d-hide"{{end}}>
<label for="importAccountAppPass" class="pl-1 mb-1">Password</label>
<input type="password" class="form-control select" id="importAccountAppPass" autocomplete="current-password">
</div>
<div class="d-flex justify-content-end mt-4">
<button id="authorizeImportAccountConfirm" type="button" class="col-8 justify-content-center fs15 bg2 selected">Authorize Import</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="importAccountErr"></div>
</div>
{{end}}
{{define "changeAppPWForm"}}
<div class="bg2 px-2 py-1 text-center position-relative fs18">
Change Application Password
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-4">
<div>
<label for="appPW" class="pl-1 mb-1">Current Password</label>
<input type="password" class="form-control select" id="appPW" autocomplete="current-password">
</div>
<div class="mt-2">
<label for="newAppPW" class="pl-1 mb-1">New Password</label>
<input type="password" class="form-control select" id="newAppPW" autocomplete="new-password">
</div>
<div class="mt-2">
<label for="confirmNewPW" class="pl-1 mb-1">Confirm New Password</label>
<input type="password" class="form-control select" id="confirmNewPW" autocomplete="new-password">
</div>
<div class="d-flex justify-content-end mt-4">
<button id="submitNewPW" type="submit" class="col-8 justify-content-center fs15 bg2 selected">Submit</button>
</div>
<div class="fs15 pt-3 text-center d-hide errcolor" id="changePWErrMsg"></div>
</div>
{{end}}
{{define "cancelOrderForm"}}
{{$passwordIsCached := .UserInfo.PasswordIsCached}}
<div class="bg2 px-2 py-1 text-center fs18 position-relative">
Cancel Order
<div class="form-closer hoverbg"><span class="ico-cross"></span></div>
</div>
<div class="p-3">
Enter your password to submit a cancel order for the remaining
<span id="cancelRemain"></span>
<span id="cancelUnit"></span>.<br>
The remaining amount may change before the cancel order is matched.
</div>
<hr class="dashed mt-2">
<div class="d-flex flex-row align-items-end {{if $passwordIsCached}}justify-content-end{{end}} pb-4 px-3">
<div class="col-12 p-0 {{if $passwordIsCached}}d-hide{{end}}">
<label for="cancelPass" class="pt-3 pl-1 mb-0">Password</label>
<input type="password" class="form-control select" id="cancelPass" autocomplete="off">
</div>
<div class="col-12 py-1 {{if not $passwordIsCached}}pl-5{{end}}">
<button id="cancelSubmit" type="button" class="w-100 fs15 bg2 selected">Submit</button>
</div>
</div>
{{end}}