<commit_before><template name="neworder">
  <div class="buy-sell-section">
    <form id="neworder">
      <h2>
        {{title}} {{baseCurrency}}
        {{> whatisthis section="new-order"}}
      </h2>
      <table>
        <tbody>
          <tr class="row-input-line">
            <th>
              PRICE
            </th>
            <td>
              <input type="number" class="input" step="any" min="0" {{b "value: price, input: calcTotal"}}> <span class="span-buy-sell-currency">{{quoteCurrency}}</span>
            </td>
          </tr>
          <tr class="row-input-line">
            <th>
              AMOUNT
            </th>
            <td>
              <input type="number" class="input" step="any" min="0" {{b "value: amount, input: calcTotal, enable: priceDefined, attr: { max: maxAmount }"}}> <span class="span-buy-sell-currency">{{baseCurrency}}</span>
            </td>
          </tr>
          <tr class="row-input-line">
            <th>
              TOTAL
            </th>
            <td>
              <input type="number" class="input" step="any" min="0" {{b "value: total, input: calcAmount, enable: priceDefined, attr: { max: maxTotal }"}}> <span class="span-buy-sell-currency">{{quoteCurrency}}</span>
            </td>
          </tr>
          {{#unless priceDefined}}
            <tr>
              <td colspan="2">
                <span class="help-block">Enter a price to unlock amount and total.</span>
              </td>
            </tr>
          {{/unless}}
        </tbody>
        <tfoot>
          <tr>
            <th>
            </th>
            <td>
              <button class="btn btn-default btn-submit-order-{{type}} {{type}}" data-toggle="modal" data-target="#newOrderModal" {{b "enable: canSubmit, click: preventDefault"}}>Submit order</button>
            </td>
          </tr>
          {{#unless isMarketOpen}}
            <tr>
              <td colspan="2">
                <span class="help-block">The market has closed.</span>
              </td>
            </tr>
          {{/unless}}
          {{#unless hasBalance sellCurrency}}
            <tr>
              <td colspan="2">
                <span class="help-block">You don't have enough {{#if equals sellCurrency 'ETH'}}<a href="#ethtokens">{{sellCurrency}}</a>{{else}}{{sellCurrency}}{{/if}} tokens.</span>
              </td>
            </tr>
          {{else}}
            {{#unless hasAllowance sellCurrency}}
              <tr>
                <td colspan="2">
                  <span class="help-block">You don't have enough {{sellCurrency}} <a href="#allowance">allowance</a>.</span>
                </td>
              </tr>
            {{/unless}}
          {{/unless}}
          {{#let offer=betterOffer}}
            {{#if offer}}
              <tr>
                <td colspan="2">
                  <span class="help-block">There is a better <a href="#offerModal" data-toggle="modal" data-target="#offerModal" {{b "click: openOfferModal"}}>offer</a>.</span>
                </td>
              </tr>
            {{/if}}
          {{/let}}
          {{#unless equals lastError ''}}
            <tr>
              <td colspan="2">
                <span class="help-block">{{lastError}}</span>
              </td>
            </tr>
          {{/unless}}
        </tfoot>
      </table>
    </form>
  </div>

  <div class="modal fade" id="newOrderModal" tabindex="-1" role="dialog">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
          <h4 class="modal-title">Confirmation</h4>
        </div>
        <div class="modal-body">
          <table>
            <tbody>
              <tr>
                <th>Type</th>
                <th>{{type}}</th>
              </tr>
              <tr>
                <th>Price</th>
                <td>{{formatBalance (toWei price)}} {{quoteCurrency}}/{{baseCurrency}}</td>
              </tr>
              <tr>
                <th>Volume</th>
                <td>{{formatBalance (toWei amount)}} {{baseCurrency}}</td>
              </tr>
              <tr>
                <th>Total</th>
                <td>{{formatBalance (toWei total)}} {{quoteCurrency}}</td>
              </tr>
            </tbody>
          </table>
          <hr>
          <span class="text-danger">
            <b>Warning!</b>
            {{#if equals type 'buy'}}
              This action will <b>remove {{formatBalance (toWei total)}} {{quoteCurrency}}</b> {{formatPrice (toWei total) quoteCurrency}} from your token balance and allowance.
            {{else}}
              This action will <b>remove {{formatBalance (toWei amount)}} {{baseCurrency}}</b> {{formatPrice (toWei amount) baseCurrency}} from your token balance and allowance.
            {{/if}}
          </span>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-danger" data-dismiss="modal">Cancel</button>
          <button type="button" class="btn btn-primary" data-dismiss="modal" {{b "enable: canSubmit, click: submit"}}>Place order</button>
        </div>
      </div>
    </div>
  </div>
</template><commit_msg>Fix bug with modal being greyed out<commit_after><template name="neworder">
  <div class="buy-sell-section">
    <form id="neworder">
      <h2>
        {{title}} {{baseCurrency}}
        {{> whatisthis section="new-order"}}
      </h2>
      <table>
        <tbody>
          <tr class="row-input-line">
            <th>
              PRICE
            </th>
            <td>
              <input type="number" class="input" step="any" min="0" {{b "value: price, input: calcTotal"}}> <span class="span-buy-sell-currency">{{quoteCurrency}}</span>
            </td>
          </tr>
          <tr class="row-input-line">
            <th>
              AMOUNT
            </th>
            <td>
              <input type="number" class="input" step="any" min="0" {{b "value: amount, input: calcTotal, enable: priceDefined, attr: { max: maxAmount }"}}> <span class="span-buy-sell-currency">{{baseCurrency}}</span>
            </td>
          </tr>
          <tr class="row-input-line">
            <th>
              TOTAL
            </th>
            <td>
              <input type="number" class="input" step="any" min="0" {{b "value: total, input: calcAmount, enable: priceDefined, attr: { max: maxTotal }"}}> <span class="span-buy-sell-currency">{{quoteCurrency}}</span>
            </td>
          </tr>
          {{#unless priceDefined}}
            <tr>
              <td colspan="2">
                <span class="help-block">Enter a price to unlock amount and total.</span>
              </td>
            </tr>
          {{/unless}}
        </tbody>
        <tfoot>
          <tr>
            <th>
            </th>
            <td>
              <button class="btn btn-default btn-submit-order-{{type}} {{type}}" data-toggle="modal" data-target="#newOrderModal" {{b "enable: canSubmit, click: preventDefault"}}>{{title}}</button>
            </td>
          </tr>
          {{#unless isMarketOpen}}
            <tr>
              <td colspan="2">
                <span class="help-block">The market has closed.</span>
              </td>
            </tr>
          {{/unless}}
          {{#unless hasBalance sellCurrency}}
            <tr>
              <td colspan="2">
                <span class="help-block">You don't have enough {{#if equals sellCurrency 'ETH'}}<a href="#ethtokens">{{sellCurrency}}</a>{{else}}{{sellCurrency}}{{/if}} tokens.</span>
              </td>
            </tr>
          {{else}}
            {{#unless hasAllowance sellCurrency}}
              <tr>
                <td colspan="2">
                  <span class="help-block">You don't have enough {{sellCurrency}} <a href="#allowance">allowance</a>.</span>
                </td>
              </tr>
            {{/unless}}
          {{/unless}}
          {{#let offer=betterOffer}}
            {{#if offer}}
              <tr>
                <td colspan="2">
                  <span class="help-block">There is a better <a href="#offerModal" data-toggle="modal" data-target="#offerModal" {{b "click: openOfferModal"}}>offer</a>.</span>
                </td>
              </tr>
            {{/if}}
          {{/let}}
          {{#unless equals lastError ''}}
            <tr>
              <td colspan="2">
                <span class="help-block">{{lastError}}</span>
              </td>
            </tr>
          {{/unless}}
        </tfoot>
      </table>
    </form>
  </div>
</template>
{'fraction_non_alphanumeric': 0.17666088965915655, 'fraction_numerical': 0.0028885037550548816, 'mean_word_length': 1.5677840403441115, 'pattern_counts': {'":': 0, '<': 244, '<?xml version=': 0, '>': 246, 'https://': 0, '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': '668346', 'n_tokens_mistral': 2585, 'n_tokens_neox': 2485, 'n_words': 550}