{% load i18n %}
{% load l10n %}
{% load commadecimal %}
{% load dotdecimal %}
{% load ibanformat %}
{% load money %}
{% load unidecode %}
{% load rich_text %}

{% if pending_description %}
    {{ pending_description|rich_text }}
{% endif %}
<p>{% blocktrans trimmed %}
    Please transfer the full amount to the following bank account:
{% endblocktrans %}</p>

<div class="row">
    <div class="{% if settings.bank_details_type == "sepa" %}col-md-6{% else %}col-md-12{% endif %} col-xs-12">
            {% if settings.bank_details_type == "sepa" %}
                <dl class="dl-horizontal">
                    <dt>{% trans "Account holder" %}:</dt><dd>{{ settings.bank_details_sepa_name }}</dt>
                    <dt>{% trans "IBAN" %}:</dt><dd>{{ settings.bank_details_sepa_iban|ibanformat }}</dt>
                    <dt>{% trans "BIC" %}:</dt><dd>{{ settings.bank_details_sepa_bic }}</dt>
                    <dt>{% trans "Bank" %}:</dt><dd>{{ settings.bank_details_sepa_bank }}</dt>
                {% if details %}
                </dl>
                {% endif %}
            {% endif %}
            {% if details %}
                {{ details|linebreaks }}
                <dl class="dl-horizontal">
            {% endif %}
            {% if not settings.bank_details_type == "sepa" and not details %}
                <dl class="dl-horizontal">
            {% endif %}
            <dt>{% trans "Amount:" %}</dt><dd>{{ amount|money:event.currency }}</dd>
            <dt>{% trans "Reference code (important):" %}</dt><dd><b>{{ code }}</b></dd>
        </dl>
        <p>
            {% trans "After you sent the bank transfer, you can close this window. We will send you an email as soon as we received your payment." %}
        </p>
    </div>
    {% if settings.bank_details_type == "sepa" %}
        <div class="col-md-3 col-sm-6 hidden-xs text-center js-only">
            <h4>BezahlCode</h4>
            <p>
            <a aria-label="{% trans "Open BezahlCode in your banking app to start the payment process." %}" href="bank://singlepaymentsepa?name={{ settings.bank_details_sepa_name|urlencode }}&iban={{ settings.bank_details_sepa_iban }}&bic={{ settings.bank_details_sepa_bic }}&amount={{ amount|commadecimal }}&reason={{ code }}&currency={{ event.currency }}">
                <script type="text/plain" data-size="150" data-replace-with-qr data-desc="{% trans 'BezahlCode for your order. Scan this image with your banking app’s QR-Reader to start the payment process.' %}">bank://singlepaymentsepa?name={{ settings.bank_details_sepa_name|urlencode }}&iban={{ settings.bank_details_sepa_iban }}&bic={{ settings.bank_details_sepa_bic }}&amount={{ amount|commadecimal }}&reason={{ code }}&currency={{ event.currency }}</script>
            </a>
            </p>
        </div>
        <div class="col-md-3 col-sm-6 hidden-xs text-center js-only">
            <h4>GiroCode / EPC-QR</h4>
            <p>
            <script type="text/plain" data-size="150" data-replace-with-qr data-desc="{% trans 'GiroCode / EPC-QR for your order. Scan this image with your banking app’s QR-Reader to start the payment process.' %}">BCD
002
2
SCT
{{ settings.bank_details_sepa_bic }}
{{ settings.bank_details_sepa_name|unidecode }}
{{ settings.bank_details_sepa_iban }}
{{ event.currency }}{{ amount|dotdecimal }}


{{ code }}

            </script>
            </p>
        </div>
        <div class="visible-xs-block text-center">
            <p>
                <a href="bank://singlepaymentsepa?name={{ settings.bank_details_sepa_name|urlencode }}&iban={{ settings.bank_details_sepa_iban }}&bic={{ settings.bank_details_sepa_bic }}&amount={{ amount|commadecimal }}&reason={{ code }}&currency={{ event.currency }}" class="btn btn-default">
                    {% trans "Open banking app" %}
                </a><br>
                <small>{% trans "Requires that the app supports BezahlCode" %}</small>
            </p>
        </div>
    {% endif %}
</div>
