{% extends 'dashboard/layout.html' %}
{% load url from future %}
{% load currency_filters %}
{% load i18n %}

{% block title %}
{% trans "Top-up account" %} #{{ account.id }} | {{ block.super }}
{% endblock %}

{% block breadcrumbs %}
<ul class="breadcrumb">
    <li>
		<a href="{% url 'dashboard:index' %}">{% trans "Dashboard" %}</a>
        <span class="divider">/</span>
    </li>
    <li>
		<a href="{% url 'accounts-list' %}">{% trans "Accounts" %}</a>
        <span class="divider">/</span>
    </li>
    <li>
        <a href="{% url 'accounts-detail' account.id %}">{{ account }}</a>
        <span class="divider">/</span>
    </li>
    <li class="active">{% trans "Top up" %}</li>
</ul>
{% endblock %}

{% block headertext %}{% trans "Top up account?" %}{% endblock %}

{% block dashboard_content %}
    {% include 'accounts/dashboard/partials/account_detail.html' %}

	{% if account.is_open %}
	<form action="." method="post">
		{% csrf_token %}
		<legend>{% trans "Transaction" %}</legend>
        {% if form.source_account %}
            {% include 'partials/form_field.html' with field=form.source_account %}
        {% endif %}
		{% include 'partials/form_field.html' with field=form.amount %}
		<button type="submit" class="btn btn-large btn-success">{% trans "Transfer" %}</button>
	</form>
	{% else %}
	<p>{% trans "This account cannot be topped-up." %}</p>
	{% endif %}

{% endblock dashboard_content %}
