47 lines
1.8 KiB
HTML
47 lines
1.8 KiB
HTML
{% extends "facturio/base.html" %}
|
|
{% load i18n %}
|
|
|
|
{% block title %}{% trans "Subjects" %}{% endblock %}
|
|
|
|
{% block content %}
|
|
<a href="{% url "subjects:create" %}" class="btn btn-primary" role="button">{% trans "Add new" %}</a>
|
|
<table class="table">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans "CIN" %}</th>
|
|
<th>{% trans "Name" %}</th>
|
|
<th>{% trans "VAT ID" %}</th>
|
|
<th>{% trans "Street" %}</th>
|
|
<th>{% trans "Zip Code" %}</th>
|
|
<th>{% trans "City" %}</th>
|
|
<th>{% trans "City part" %}</th>
|
|
<th>{% trans "Connect" %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for subject in subjects %}
|
|
{# FIXME: in the future, or when this create problems, find a better way#}
|
|
{% with linked_users=subject.get_linked_users %}
|
|
<tr>
|
|
<td>{{ subject.id }}</td>
|
|
<td>{{ subject.name }}</td>
|
|
<td>{{ subject.vat_id }}</td>
|
|
<td>{{ subject.street }}</td>
|
|
<td>{{ subject.zip_code }}</td>
|
|
<td>{{ subject.city }}</td>
|
|
<td>{{ subject.city_part }}</td>
|
|
<td>
|
|
{% if request.user.id not in linked_users %}
|
|
<a href="{% url "subjects:link" subject_id=subject.id %}" class="btn btn-primary"
|
|
role="button">{% trans "Link" %}</a>
|
|
{% else %}
|
|
<a href="{% url "subjects:unlink" subject_id=subject.id %}" class="btn btn-danger"
|
|
role="button">{% trans "Unlink" %}</a>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
{% endwith %}
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
{% endblock %}
|