Skip to content

Commit

Permalink
initial review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
buck54321 committed Nov 1, 2023
1 parent 20f473f commit ebe7a2a
Show file tree
Hide file tree
Showing 9 changed files with 242 additions and 197 deletions.
19 changes: 15 additions & 4 deletions client/webserver/locales/en-us.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var EnUS = map[string]string{
"Skip Registration": "No account (view-only mode)",
"Confirm Registration": "Confirm Registration and Bonding",
"app_pw_reg": "Enter your app password to confirm DEX registration and bond creation.",
"reg_confirm_submit": `When you submit this form, funds will be spent from your wallet to post a fidelity bond, which is redeemable by you in the future.`,
"reg_confirm_submit": `When you submit this form, funds from your wallet will be temporarily locked into a fidelity bond contract, which is redeemable by you in the future.`,
"bond_strength": "Bond Strength",
"target_tier": "Target Tier",
"target_tier_tooltip": "This is the target account tier you wish to maintain. Set to zero if you wish to disable tier maintenance (do not post new bonds).",
Expand Down Expand Up @@ -205,13 +205,25 @@ var EnUS = map[string]string{
"Progress": "Progress",
"remaining": "remaining",
"2 Fund your Wallet": "2: Fund your Wallet",
"whatsabond": "Fidelity bonds are time-locked funds redeemable only by you, but in the future. This is meant to combat disruptive behavior like backing out on swaps.",
"bond_definition": "A fidelity bond is funds temporarily locked in an on-chain contract. After the contract expires, your wallet will reclaim the funds.",
"bonds_can_be_revoked": "Bonds can be revoked if an account engages in continued disruptive behavior, such as backing out on a swap. Revoked bonds can be re-activated with continued normal trading activity.",
"bigger_bonds_higher_limit": "You can create larger bonds to increase your trading tier, enabling trading of larger quantities at a time. Larger bonds also increase your capacity for violations before trading privileges are suspended.",
"limits_reputation": "Trading limits are also increased as you establish reputation by engaging in normal trading activity and successfully completing matches.",
"wallet_bond_reserves": "Your wallet will automatically reserve the funds necessary to keep you bonded at your selected trading tier, and will broadcast new bonds to replace expiring ones. You can lower or raise your trading tier in the exchange's settings panel. Set your trading tier to zero to disable your account (once your existing bonds expire).",
"Got it": "Got it",
"Trading Limits": "Trading Limits",
"What is a fidelity bond": "What is a fidelity bond?",
"order_form_remaining_limit": `<span id="orderLimitRemain"></span> lots remaining in tier <span id="orderTradingTier"></span> trading limit`,
"Parcel Size": "Parcel Size",
"Trading Limit": "Trading Limit",
"Current Usage": "Current Usage",
"score_factors": "Increase your score by successfully completing trades. Failure to act on a trade will decrease your score.",
"Bond amount": "Bond amount",
"Reserves for tx fees": "Funds to reserve for transaction fees to maintain your bonds",
"Tx Fee Balance": "Transaction Fee Balance:",
"Your Deposit Address": "Your Wallet's Deposit Address",
"Send enough for bonds": `Make sure you send enough to also cover network fees. You may deposit as much as you like to your wallet, since only the bond amount will be used in the next step. The deposit must confirm to proceed.`,
"Send enough with estimate": `Deposit at least <span data-tmpl="totalForBond"></span> <span class="unit">XYZ</span> to cover network fees and overlap periods when a bond is expired (but waiting for refund) and another must be posted. You may deposit as much as you like to your wallet, since only the required amount will be used in the next step. The deposit must confirm to proceed.`,
"Send enough with estimate": `Deposit at least <span data-tmpl="totalForBond"></span> <span class="unit">XYZ</span> to cover your bond and fees. You may deposit as much as you like to your wallet, since only the required amount will be used in the next step. The wallet may require a confirmation on the new funds before proceeding.`,
"Send funds for token": `Deposit at least <span data-tmpl="tokenFees"></span> <span class="unit">XYZ</span> and <span data-tmpl="parentFees"></span> <span data-tmpl="parentUnit">XYZ</span> to also cover fees. You may deposit as much as you like to your wallet, since only the required amount will be used in the next step. The deposit must confirm to proceed.`,
"add a different server": "add a different server",
"Add a custom server": "Add a custom server",
Expand Down Expand Up @@ -281,7 +293,6 @@ var EnUS = map[string]string{
"Bond Lock": "Bond Lock",
"USD": "USD",
"Fee Reserves": "Fee Reserves",
"Trading Limits": "Trading Limits",
"Select your bond asset": "Select your bond asset",
"choose a different asset": "choose a different asset",
"current_bonding_asset": `Using <img data-tmpl="currentAssetLogo" class="mini-icon"> <span data-tmpl="currentAssetName"></span> for bonding`,
Expand Down
3 changes: 3 additions & 0 deletions client/webserver/site/src/html/dexsettings.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
{{$passwordIsCached := .UserInfo.PasswordIsCached}}
<div id="main" data-handler="dexsettings" data-host="{{.Exchange.Host}}" class="py-5 overflow-y-auto">
<div class="d-flex align-items-stretch flex-column mw-425 mx-auto">
<div class="d-flex justify-content-start align-items-center pointer py-2">
<span id="goBackToSettings" class="ico-wide-headed-left-arrow fs24 lh1"></span>
</div>
<div class="flex-center"><span class="settings-gear ico-settings"></span></div>
<div class="flex-center fs28 text-break">{{.Exchange.Host}}</div>
<div class="flex-center fs16 mb-2">
Expand Down
248 changes: 136 additions & 112 deletions client/webserver/site/src/html/forms.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -227,117 +227,139 @@
{{end}}

{{define "regAssetForm"}}
<div class="d-flex align-items-stretch">
<div class="d-flex justify-content-start flex-grow-1 flex-column px-2">
<span class="fs22">[[[Choose your trading tier]]]</span>
<span class="fs15 mt-1">[[[trading_tier_message]]]</span>
</div>
<div class="flex-center flex-grow-1 p-3">
<input data-tmpl="regAssetTier" type="number" class="fs24 p-2 text-center" value="1" min="0" step="1">
<input type="text" class="d-hide"> <!--two inputs to prevent auto form submission-->
</div>
</div>
<hr class="dashed mt-3">
<div data-tmpl="regAssetErr" class="fs14 errcolor flex-center"></div>
<div data-tmpl="assetSelected" class="flex-center flex-column mb-3">
<div class="fs20">[[[current_bonding_asset]]]</div>
<div data-tmpl="chooseDifferentAsset" class="fs16 underline grey pointer hoverbg mt-1">[[[choose a different asset]]]</div>
</div>
<div data-tmpl="assetSelection">
<div class="w-100 flex-center fs18 my-3">[[[Select your bond asset]]]</div>
<table class="reg-asset-table w-100">
<thead>
<tr class="fs16">
<th>[[[Asset]]]</th>
<th>[[[Bond Lock]]]</th>
<th>Trading Limits</th>
</tr>
</thead>
<tbody data-tmpl="assets">
<tr data-tmpl="assetTmpl" class="hoverbg pointer">
<td>
<div class="d-flex flex-column align-items-start">
<div class="flex-center">
<img class="mini-icon" data-tmpl="logo">
<span class="fs18 ms-1" data-tmpl="name"></span>
</div>
<div class="fs14 readygreen" data-tmpl="ready"></div>
</div>
</td>
<td data-tmpl="bondData">
<div class="d-flex flex-column align-items-start">
<div class="flex-center">
<span data-tmpl="feeAmt" class="fs18"></span>
<span class="fs14 grey ms-1" data-tmpl="feeSymbol"></span>
</div>
<div class="flex-center fs14">
<span>~</span>
<span data-tmpl="fiatBondAmount"></span>
<span class="grey ms-1">[[[USD]]]</span>
</div>
</div>
</td>
<td>
<div class="d-flex flex-column align-items-start">
<div class="flex-center">
<span class="fs16" data-tmpl="tradeLimits" class="flex-center">
<span data-tmpl="tradeLimitLow"></span><span>&ndash;</span><span data-tmpl="tradeLimitHigh"></span>
<span data-tmpl="tradeLimitSymbol" class="ms-1 fs14 grey"></span>
</span>
<div data-tmpl="whatsABondPanel" class="d-hide">
<div class="flex-center fs22 mb-2">[[[What is a fidelity bond]]]</div>
<ul class="fs16">
<li>
[[[bond_definition]]]
</li>
<li>
[[[bonds_can_be_revoked]]]
</li>
<li>
[[[bigger_bonds_higher_limit]]]
</li>
<li>
[[[limits_reputation]]]
</li>
<li>
[[[wallet_bond_reserves]]]
</li>
</ul>
<div class="flex-center p-3">
<div data-tmpl="bondGotIt" class="brdr rounded3 hoverbg pointer p-2 fs20">[[[Got it]]]</div>
</div>
</div>
<div data-tmpl="mainBondingForm">
<div class="d-flex align-items-stretch">
<div class="d-flex justify-content-start flex-grow-1 flex-column px-2">
<span class="fs22">[[[Choose your trading tier]]]</span>
<span class="fs15 mt-1">[[[trading_tier_message]]]</span>
</div>
<div class="flex-center flex-grow-1 p-3">
<input data-tmpl="regAssetTier" type="number" class="fs24 p-2 text-center" value="1" min="0" step="1">
<input type="text" class="d-hide"> <!--two inputs to prevent auto form submission-->
</div>
</div>
<hr class="dashed mt-3">
<div data-tmpl="regAssetErr" class="fs14 errcolor flex-center"></div>
<div data-tmpl="assetSelected" class="flex-center flex-column mb-3">
<div class="fs20">[[[current_bonding_asset]]]</div>
<div data-tmpl="chooseDifferentAsset" class="fs16 underline grey pointer hoverbg mt-1">[[[choose a different asset]]]</div>
</div>
<div data-tmpl="assetSelection">
<div class="w-100 flex-center fs20 mt-3">[[[Select your bond asset]]]</div>
<div data-tmpl="whatsABond" class="flex-center fs18 hoverbg pointer underline py-2 mb-2">What's a bond?</div>
<table class="reg-asset-table w-100">
<thead>
<tr class="fs16">
<th>[[[Asset]]]</th>
<th>[[[Bond Lock]]]</th>
<th>[[[Trading Limits]]]</th>
</tr>
</thead>
<tbody data-tmpl="assets">
<tr data-tmpl="assetTmpl" class="hoverbg pointer">
<td>
<div class="d-flex flex-column align-items-start">
<div class="flex-center">
<img class="mini-icon" data-tmpl="logo">
<span class="fs18 ms-1" data-tmpl="name"></span>
</div>
<div class="fs14 readygreen" data-tmpl="ready"></div>
</div>
<div class="flex-center">
<span class="fs14" data-tmpl="tradeLimits" class="flex-center">
</td>
<td data-tmpl="bondData">
<div class="d-flex flex-column align-items-start">
<div class="flex-center">
<span data-tmpl="feeAmt" class="fs18"></span>
<span class="fs14 grey ms-1" data-tmpl="feeSymbol"></span>
</div>
<div class="flex-center fs14">
<span>~</span>
<span data-tmpl="fiatTradeLimitLow"></span><span>&ndash;</span><span data-tmpl="fiatTradeLimitHigh"></span>
<span data-tmpl="fiatBondAmount"></span>
<span class="grey ms-1">[[[USD]]]</span>
</span>
</div>
</td>
</tr>
</tbody>
</table>
<div class="py-2 flex-center fs18">[[[Other Trading Limits]]]</div>
<table class="reg-asset-table brdrtop w-100">
<tbody data-tmpl="otherAssets">
</tbody>
</table>
<div class="d-flex align-items-stretch reg-asset nohover py-2" data-tmpl="allmkts">
<div class="flex-column flex-center">
<div class="fs20 sans-light">[[[All markets at]]]</div>
<span class="fs18 text-break" data-tmpl="host"></span>
</div>
<div class="reg-assets-markets-wrap flex-center flex-grow-1">
<table class="reg-asset-markets">
<thead>
<tr>
<th class="grey">[[[Market]]]</th>
<th class="grey">[[[:title:lot_size]]]</th>
</tr>
</thead>
<tbody data-tmpl="allMarkets">
<tr data-tmpl="marketTmpl">
<td class="pe-3">
<div class="d-flex align-items-center">
<img class="reg-market-logo" data-tmpl="logo">
<span data-tmpl="baseName"></span>-<span data-tmpl="quoteName"></span>
</div>
</td>
<td>
<span data-tmpl="lotSize"></span>
<span data-tmpl="lotSizeSymbol"></span>
<span data-tmpl="quoteLotSize" class="d-hide"></span>
</td>
</tr>
</tbody>
</table>
<div class="fader" data-tmpl="fader"></div>
</div>
</td>
<td>
<div class="d-flex flex-column align-items-start">
<div class="flex-center">
<span class="fs16" data-tmpl="tradeLimits" class="flex-center">
<span data-tmpl="tradeLimitLow"></span><span>&ndash;</span><span data-tmpl="tradeLimitHigh"></span>
<span data-tmpl="tradeLimitSymbol" class="ms-1 fs14 grey"></span>
</span>
</div>
<div class="flex-center">
<span class="fs14" data-tmpl="tradeLimits" class="flex-center">
<span>~</span>
<span data-tmpl="fiatTradeLimitLow"></span><span>&ndash;</span><span data-tmpl="fiatTradeLimitHigh"></span>
<span class="grey ms-1">[[[USD]]]</span>
</span>
</div>
</td>
</tr>
</tbody>
</table>
<div class="py-2 flex-center fs18">[[[Other Trading Limits]]]</div>
<table class="reg-asset-table brdrtop w-100">
<tbody data-tmpl="otherAssets">
</tbody>
</table>
<div class="d-flex align-items-stretch reg-asset nohover py-2" data-tmpl="allmkts">
<div class="flex-column flex-center">
<div class="fs20 sans-light">[[[All markets at]]]</div>
<span class="fs18 text-break" data-tmpl="host"></span>
</div>
<div class="reg-assets-markets-wrap flex-center flex-grow-1">
<table class="reg-asset-markets">
<thead>
<tr>
<th class="grey">[[[Market]]]</th>
<th class="grey">[[[:title:lot_size]]]</th>
</tr>
</thead>
<tbody data-tmpl="allMarkets">
<tr data-tmpl="marketTmpl">
<td class="pe-3">
<div class="d-flex align-items-center">
<img class="reg-market-logo" data-tmpl="logo">
<span data-tmpl="baseName"></span>-<span data-tmpl="quoteName"></span>
</div>
</td>
<td>
<span data-tmpl="lotSize"></span>
<span data-tmpl="lotSizeSymbol"></span>
<span data-tmpl="quoteLotSize" class="d-hide"></span>
</td>
</tr>
</tbody>
</table>
<div class="fader" data-tmpl="fader"></div>
</div>
</div>
</div>
</div>
<hr class="dashed mb-3 mt-0">
<div class="fs14">
<span class="ico-info"></span>
<span class="ms-1">[[[whatsabond]]]</span>
<hr class="dashed mb-3 mt-0">
</div>
{{end}}

Expand Down Expand Up @@ -405,7 +427,7 @@
</div>
<div class="fs15 pt-3 text-center d-hide errcolor text-break" data-tmpl="regErr"></div>
<hr class="dashed">
<div class="fs15 reg-conf-msg mt-3" data-tmpl="text">
<div class="fs16 reg-conf-msg mt-3" data-tmpl="text">
<span class="ico-info"></span> [[[reg_confirm_submit]]]
</div>
</div>
Expand Down Expand Up @@ -612,19 +634,18 @@
</div>
<div class="d-flex flex-column align-items-start" data-tmpl="balanceBox">
<div class="flex-center mt-1">
<span class="fs16 me-1">[[[Balance]]]:</span>
<span class="fs16 me-1">[[[Available Balance]]]:</span>
<span class="fs20 me-1" data-tmpl="balance"></span>
<span class="fs16 grey unit">XYZ</span>
</div>
<div class="mt-1">
<span class="ico-info"></span>
<span class="fs14">[[[whatsabond]]]</span>
</div>
<div class="mb-1 flex-center flex-row">
<span class="fs16 me-1">[[[Bond amount]]]:</span>
<span class="fs16 me-1">Bond Lock:</span>
<span class="fs20 me-1" data-tmpl="fee"></span>
<span class="fs16 grey unit">XYZ</span>
</div>
<div data-tmpl="bondCostBreakdown" class="mb-1">
Includes <span data-tmpl="bondLockNoFees"></span> for your bond and <span data-tmpl="bondLockFees"></span> for transaction fees.
</div>
<span data-tmpl="sendEnoughWithEst">[[[Send enough with estimate]]]</span> {{- /* NOTE: includes totalForBond */}}
<span data-tmpl="sendEnoughForToken">[[[Send funds for token]]]</span>
<div class="mb-1 flex-center flex-row d-hide" data-tmpl="txFeeBox">
Expand Down Expand Up @@ -746,5 +767,8 @@
</span>
</span>
</div>
<div class="py-2 fs14">
[[[score_factors]]]
</div>
</div>
{{end}}
Loading

0 comments on commit ebe7a2a

Please sign in to comment.