<commit_before>{% load mathfilters %}

{% comment %}
    Must provide:
        page_price for the current pricing (user price vs page price)
        fxd for foreign exchange default currency
        fx for exchange rates
        novel_object for the novel this refers to
    Optional:
        next_price for next page price beneath the button (means we're on a view page)
        <input type="hidden" value="false" id="buytrigger"/> will be set true and can
        triggger a jquery .change() event - put this somewhere on your view page
{% endcomment %}

<div id="buynow">
    <form action="{% url 'buy_novel' %}" method="POST">
        {% csrf_token %}
        <input type="hidden" value="{{ page_price|mul:100|floatformat:"0" }}"
               id="basePrice" name="basePrice" />
        <input type="hidden"
               value="{% if next_price %}{{ next_price|mul:100|floatformat:"0" }}{% endif %}"
               id="nextPrice" name="nextPrice" />
        <input type="hidden" value="{{ fxd }}"
               id="stripeCurrency" name="stripeCurrency" />
        <input type="hidden"  value="{{ page_price|mul:100|floatformat:"0" }}"
               id="stripePrice" name="stripePrice" />
        <input type="hidden" value="{% url 'novel_settings' novel_object.surl %}"
               id="stripeSettings" name="stripeSettings" />
        <input type="hidden" value="{% url 'buy_novel' %}" name="stripeBuy" id="stripeBuy" />
    </form>
    <div class="btn-group">
        <button id="stripeButton" class="btn btn-lg btn-buy-dropdown inverse" >Buy for &pound; {{ page_price }}</button>
        <button id="stripeCaret" type="button" data-toggle="dropdown"
                class="btn btn-lg dropdown-toggle btn-buy-dropdown">
            <span class="caret"></span>
            <span class="sr-only">Toggle Dropdown</span>
        </button>
        <ul class="dropdown-menu" role="menu">{# http://stackoverflow.com/a/24654441 #}
            <li id="forex_usd" data-value="{{ fx.usd }}"><a href="#">USD</a></li>
            <li id="forex_gbp" data-value="{{ fx.gbp }}"><a href="#">GBP</a></li>
            <li id="forex_eur" data-value="{{ fx.eur }}"><a href="#">EUR</a></li>
            <li id="forex_btc" data-value="{{ fx.btc }}"><a href="#">BTC</a></li>
        </ul>
    </div>
    <div class="row col-xs-12 text-center" id="buynowresponse"><span class="smallprint">For Kindle & ePub readers.
    DRM-free. Payments securely processed by Stripe. BTC is an estimate until confirmed by Stripe.
    This site never has access to your credit card number. Please review our
    <a href="{% url 'legal' %}">Terms of Service</a></span></div>
</div><commit_msg>Bitcoin payment guidance<commit_after>{% load mathfilters %}

{% comment %}
    Must provide:
        page_price for the current pricing (user price vs page price)
        fxd for foreign exchange default currency
        fx for exchange rates
        novel_object for the novel this refers to
    Optional:
        next_price for next page price beneath the button (means we're on a view page)
        <input type="hidden" value="false" id="buytrigger"/> will be set true and can
        triggger a jquery .change() event - put this somewhere on your view page
{% endcomment %}

<div id="buynow">
    <form action="{% url 'buy_novel' %}" method="POST">
        {% csrf_token %}
        <input type="hidden" value="{{ page_price|mul:100|floatformat:"0" }}"
               id="basePrice" name="basePrice" />
        <input type="hidden"
               value="{% if next_price %}{{ next_price|mul:100|floatformat:"0" }}{% endif %}"
               id="nextPrice" name="nextPrice" />
        <input type="hidden" value="{{ fxd }}"
               id="stripeCurrency" name="stripeCurrency" />
        <input type="hidden"  value="{{ page_price|mul:100|floatformat:"0" }}"
               id="stripePrice" name="stripePrice" />
        <input type="hidden" value="{% url 'novel_settings' novel_object.surl %}"
               id="stripeSettings" name="stripeSettings" />
        <input type="hidden" value="{% url 'buy_novel' %}" name="stripeBuy" id="stripeBuy" />
    </form>
    <div class="btn-group">
        <button id="stripeButton" class="btn btn-lg btn-buy-dropdown inverse" >Buy for &pound; {{ page_price }}</button>
        <button id="stripeCaret" type="button" data-toggle="dropdown"
                class="btn btn-lg dropdown-toggle btn-buy-dropdown">
            <span class="caret"></span>
            <span class="sr-only">Toggle Dropdown</span>
        </button>
        <ul class="dropdown-menu" role="menu">{# http://stackoverflow.com/a/24654441 #}
            <li id="forex_usd" data-value="{{ fx.usd }}"><a href="#">USD</a></li>
            <li id="forex_gbp" data-value="{{ fx.gbp }}"><a href="#">GBP</a></li>
            <li id="forex_eur" data-value="{{ fx.eur }}"><a href="#">EUR</a></li>
            <li id="forex_btc" data-value="{{ fx.btc }}"><a href="#">BTC</a></li>
        </ul>
    </div>
    <div class="row col-xs-12 text-center" id="buynowresponse"><span class="smallprint">For Kindle & ePub readers.
    DRM-free. Payments securely processed by Stripe. Select BTC or USD from <span class="caret"></span> for
    <em>Bitcoin</em>. This site never has access to your credit card number. Please review our
    <a href="{% url 'legal' %}">Terms of Service</a></span></div>
</div>
{'fraction_non_alphanumeric': 0.1697726425642937, 'fraction_numerical': 0.008199776369735371, 'mean_word_length': 2.9118075801749272, 'pattern_counts': {'":': 0, '<': 97, '<?xml version=': 0, '>': 97, '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': '6804618', 'n_tokens_mistral': 1739, 'n_tokens_neox': 1641, 'n_words': 448}