{% extends "accounting/layout.html" %}
{% load currency_filters %}

{% block content %}
    <h1 class="page-header">Organizations <small>which belong to you</small></h1>

    <table class="table table-striped">
        <thead>
            <tr>
                <th>#</th>
                <th>Display name</th>
                <th>Legal name</th>
                <th>Turnover</th>
                <th class="text-right">Actions</th>
            </tr>
        </thead>
        <tbody>
            {% for orga in organizations %}
            <tr>
                <td>{{ orga.id }}</td>
                <td>{{ orga.display_name }}</td>
                <td>{{ orga.legal_name }}</td>
                <td>{{ orga.turnover_excl_tax|currency|default:"-" }}</td>
                <td class="text-right">
                    <a href="{% url 'books:organization-detail' orga.pk %}" class="btn btn-success btn-sm" role="button">View</a>
                    <a href="{% url 'books:organization-edit' orga.pk %}" class="btn btn-default btn-sm" role="button">Edit</a>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>

    <a href="{% url 'books:organization-create' %}" class="btn btn-primary btn-lg" role="button">
        Add an organization
    </a>
{% endblock content %}
