{% extends "html/finance/page.html" %}

{% block title %}{{ account.name|htsafe }} | {% trans %}Finance{% endtrans %}{% endblock %}

{% block module_title %}{{ account.name }}{% endblock %}
{% block module_subtitle %}{% trans %}Bank Account{% endtrans %}{% endblock %}

{% block module_topmenu %}
<a class="top-menu view-link-active" href="{% url finance_account_view account.id %}">{% trans %}View{% endtrans %}</a>
<a class="top-menu edit-link" href="{% url finance_account_edit account.id %}">{% trans %}Edit{% endtrans %}</a>
<a class="top-menu delete-link" href="{% url finance_account_delete account.id %}">{% trans %}Delete{% endtrans %}</a>
{% endblock %}

{% block sidebar_right %}

<span class="sidebar-header-first">{% trans %}Permissions{% endtrans %}</span>
<div class="sidebar-block">
    {{ permission_block(account) }}
</div>
<span class="sidebar-header-right">{% trans %}Links{% endtrans %}</span>
<div class="sidebar-block">
    {{ link_block(account) }}
</div>
<span class="sidebar-header-right">{% trans %}Subscribers{% endtrans %}</span>
<div class="sidebar-block">
    {{ subscription_block(account) }}
</div>
<span class="sidebar-header-right">{% trans %}Download as:{% endtrans %}<br />{% if '?' in request.get_full_path() %}<a class="pdf-block-link" href="{{ request.get_full_path()|replace('.ajax','').replace('?','.pdf?') }}"{% else %}<a class="pdf-block-link" href="{{ request.get_full_path()|replace('.ajax','') }}.pdf"{% endif %} target="_self">PDF</a>
  </span></span>
{% endblock %}

{% block module_content %}

<div>
    <span class="content-label">{% trans %}Owner{% endtrans %}:</span>
    <span class="content-value"><a href="{% url identities_contact_view account.owner_id %}" class="popup-link">{{ account.owner }}</a></span>
</div>

{% if account.balance_display != account.balance %}

<div>
    <span class="content-label">{% trans %}Balance in{% endtrans %} {{currency_print(account.balance_currency)}}:</span>
    <span class="content-balance">{{ account.balance_display|number_format|currency_format(account.balance_currency)}}</span>
</div>
{% endif %}

<div>
    <span class="content-label">{% trans %}Balance in{% endtrans %} {{currency_print()}}:</span>
    <span class="content-balance">{{ account.balance|number_format|currency_format }}</span>
</div>
{% if account.details %}
<div>
    <span class="content-label">{% trans %}Details{% endtrans %}:</span>
    <span class="content-details">{{ account.details|htsafe }}</span>
</div>
{% endif %}

{% endblock %}