mirror of
https://github.com/ae-utbm/sith.git
synced 2025-01-11 09:31:12 +00:00
ef968f3673
* Better usage of cache for group retrieval * Cache clearing on object deletion or update * replace signals by save and delete override * add is_anonymous check in is_owned_by Add in many is_owned_by(self, user) methods that user is not anonymous. Since many of those functions do db queries, this should reduce a little bit the load of the db. * Stricter usage of User.is_in_group Constrain the parameters that can be passed to the function to make sure only a str or an int can be used. Also force to explicitly specify if the group id or the group name is used. * write test and correct bugs * remove forgotten populate commands * Correct test
37 lines
1.5 KiB
Django/Jinja
37 lines
1.5 KiB
Django/Jinja
{% extends "core/base.jinja" %}
|
|
|
|
{% block title %}
|
|
{% trans %}Label list{% endtrans %}
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div id="accounting">
|
|
<p>
|
|
<a href="{{ url('accounting:bank_list') }}">{% trans %}Accounting{% endtrans %}</a> >
|
|
<a href="{{ url('accounting:bank_details', b_account_id=object.bank_account.id) }}">{{object.bank_account }}</a> >
|
|
<a href="{{ url('accounting:club_details', c_account_id=object.id) }}">{{ object }}</a>
|
|
</p>
|
|
<hr>
|
|
<p><a href="{{ url('accounting:club_details', c_account_id=object.id) }}">{% trans %}Back to club account{% endtrans %}</a></p>
|
|
{% if user.is_in_group(pk=settings.SITH_GROUP_ACCOUNTING_ADMIN_ID) %}
|
|
<p><a href="{{ url('accounting:label_new') }}?parent={{ object.id }}">{% trans %}New label{% endtrans %}</a></p>
|
|
{% endif %}
|
|
{% if object.labels.all() %}
|
|
<h3>{% trans %}Label list{% endtrans %}</h3>
|
|
<ul>
|
|
{% for l in object.labels.all() %}
|
|
<li><a href="{{ url('accounting:label_edit', label_id=l.id) }}">{{ l }}</a>
|
|
{% if user.is_in_group(pk=settings.SITH_GROUP_ACCOUNTING_ADMIN_ID) %}
|
|
-
|
|
<a href="{{ url('accounting:label_delete', label_id=l.id) }}">{% trans %}Delete{% endtrans %}</a>
|
|
{% endif %}
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
{% trans %}There is no label in this club account.{% endtrans %}
|
|
{% endif %}
|
|
</div>
|
|
{% endblock %}
|
|
|