<commit_before>include ../menu/wallet.jade
section.col-xs-12.col-md-10.content(ng-controller="ConvertCtrl")

  //- Disconnected

  group.disconnected(ng-hide="connected")
    p.literal You have to be online to see this screen

  group.disconnected(ng-hide="!connected || loadState.account")
    p.literal Loading...

  .unfunded(ng-hide='account.Balance || !connected')
    p.literal(l10n="err-you-must-be-funded-before-you-can-convert-money") You have to be funded before you can convert money
    p: a.btn.btn-default(href="#/balance") Back to balance

  //- Connected

  form.mode-form(name="convertForm", id="convertForm", ng-show='mode=="form" && account.Balance', ng-submit='convert_prepared()')
    p.literal Convert one currency into another.
    hr
    .form-group
      label(for='amount') Receive
      .row.row-padding-small.amount
        .col-md-4
          input.value.form-control#amount(
          name='amount', type='text'
          ng-model='convert.amount'
          required
          rp-autofill='$routeParams.amount'
          rp-autofill-amount
          rp-amount
          rp-amount-positive)
        .col-md-3
          input.currency.form-control#amount_currency(
          name='amount_currency', type='text'
          rp-combobox="currency_query", rp-combobox-select
          ng-model='convert.currency'
          rp-autofill='$routeParams.amount'
          rp-autofill-currency)
      .errorGroup(rp-errors='amount')
        .error(rp-error-on='required')
          | Please enter an amount.
        .error(rp-error-on='rpAmount')
          | Not a valid amount.
        .error(rp-error-on='rpAmountPositive')
          | Please enter an amount greater than zero.
      p.literal(ng-show="convert.path_status == 'waiting'") Please enter the conversion details.
      p.literal.throbber(ng-show="convert.path_status == 'pending'") Calculating...
      p.literal(ng-show="convert.path_status == 'no-path' && convert.currency_code != 'XRP'")
        //- TODO how high trust?
        | Sorry! Cannot convert {{convert.amount}} {{convert.currency}}. Please make sure your account has enough funds, and a&nbsp;
        a(href="https://support.ripplelabs.com/hc/en-us/articles/200916587-how-to-set-a-trust-line-ripple", target="_blank") trust line
        |  to a {{convert.currency}} gateway.
      p.literal(ng-show="convert.path_status == 'error'") Error while calculating path

    .currency_sets.row.row-padding-small(ng-if="convert.path_status == 'done'")
      .col-xs-12 Convert
      ul
        li.col-xs-12.col-sm-6.col-md-4(ng-repeat="alt in convert.alternatives")
          .am
            span.amnt {{alt.amount | rpamount:{rel_precision: 4, rel_min_precision: 2} }}
            span.currency {{alt.amount | rpcurrency }}
          button.btn.btn-block.btn-success(type="submit", ng-disabled='convertForm.$invalid', ng-click="convert.alt = alt") Convert {{ alt.amount | rpcurrency }}

  //- N2. Waiting for path

  group.mode-wait-path(ng-show='mode=="wait_path" && account.Balance')
    p.throbber.literal Ripple is calculating a path for your conversion.

  //- N3. Confirmation page
<commit_msg>Convert: Change support url.<commit_after>include ../menu/wallet.jade
section.col-xs-12.col-md-10.content(ng-controller="ConvertCtrl")

  //- Disconnected

  group.disconnected(ng-hide="connected")
    p.literal You have to be online to see this screen

  group.disconnected(ng-hide="!connected || loadState.account")
    p.literal Loading...

  .unfunded(ng-hide='account.Balance || !connected')
    p.literal(l10n="err-you-must-be-funded-before-you-can-convert-money") You have to be funded before you can convert money
    p: a.btn.btn-default(href="#/balance") Back to balance

  //- Connected

  form.mode-form(name="convertForm", id="convertForm", ng-show='mode=="form" && account.Balance', ng-submit='convert_prepared()')
    p.literal Convert one currency into another.
    hr
    .form-group
      label(for='amount') Receive
      .row.row-padding-small.amount
        .col-md-4
          input.value.form-control#amount(
          name='amount', type='text'
          ng-model='convert.amount'
          required
          rp-autofill='$routeParams.amount'
          rp-autofill-amount
          rp-amount
          rp-amount-positive)
        .col-md-3
          input.currency.form-control#amount_currency(
          name='amount_currency', type='text'
          rp-combobox="currency_query", rp-combobox-select
          ng-model='convert.currency'
          rp-autofill='$routeParams.amount'
          rp-autofill-currency)
      .errorGroup(rp-errors='amount')
        .error(rp-error-on='required')
          | Please enter an amount.
        .error(rp-error-on='rpAmount')
          | Not a valid amount.
        .error(rp-error-on='rpAmountPositive')
          | Please enter an amount greater than zero.
      p.literal(ng-show="convert.path_status == 'waiting'") Please enter the conversion details.
      p.literal.throbber(ng-show="convert.path_status == 'pending'") Calculating...
      p.literal(ng-show="convert.path_status == 'no-path' && convert.currency_code != 'XRP'")
        //- TODO how high trust?
        | Sorry! Cannot convert {{convert.amount}} {{convert.currency}}. Please make sure your account has enough funds, and a&nbsp;
        a(href="https://ripplelabs.zendesk.com/hc/en-us/articles/200916587-how-to-set-a-trust-line-ripple", target="_blank") trust line
        |  to a {{convert.currency}} gateway.
      p.literal(ng-show="convert.path_status == 'error'") Error while calculating path

    .currency_sets.row.row-padding-small(ng-if="convert.path_status == 'done'")
      .col-xs-12 Convert
      ul
        li.col-xs-12.col-sm-6.col-md-4(ng-repeat="alt in convert.alternatives")
          .am
            span.amnt {{alt.amount | rpamount:{rel_precision: 4, rel_min_precision: 2} }}
            span.currency {{alt.amount | rpcurrency }}
          button.btn.btn-block.btn-success(type="submit", ng-disabled='convertForm.$invalid', ng-click="convert.alt = alt") Convert {{ alt.amount | rpcurrency }}

  //- N2. Waiting for path

  group.mode-wait-path(ng-show='mode=="wait_path" && account.Balance')
    p.throbber.literal Ripple is calculating a path for your conversion.

  //- N3. Confirmation page

{'fraction_non_alphanumeric': 0.14755923040228971, 'fraction_numerical': 0.008586420734615996, 'mean_word_length': 2.8098122350090855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2982099', 'n_tokens_mistral': 2037, 'n_tokens_neox': 1938, 'n_words': 369}