manager: display invoiced tag (#75415)
gitea/chrono/pipeline/head This commit looks good Details

This commit is contained in:
Lauréline Guérin 2023-03-17 15:58:47 +01:00
parent c7319f2c3c
commit ba91b0d520
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
3 changed files with 19 additions and 2 deletions

View File

@ -49,7 +49,9 @@
{% if event.main_list_full %}
<span class="full tag">{% trans "Full" %}</span>
{% endif %}
{% if event.check_locked %}
{% if event.invoiced %}
<span class="invoiced tag">{% trans "Invoiced" %}</span>
{% elif event.check_locked %}
<span class="check-locked tag">{% trans "Check locked" %}</span>
{% endif %}
{% if event.checked %}

View File

@ -27,7 +27,11 @@
<div class="event-title-meta">
{% if event.cancellation_status %}<span class="tag">{{ event.cancellation_status }}</span>{% endif %}
{% if event.main_list_full %}<span class="tag">{% trans "Full" %}</span>{% endif %}
{% if event.check_locked %}<span class="check-locked tag">{% trans "Check locked" %}</span>{% endif %}
{% if event.invoiced %}
<span class="invoiced tag">{% trans "Invoiced" %}</span>
{% elif event.check_locked %}
<span class="check-locked tag">{% trans "Check locked" %}</span>
{% endif %}
{% if event.checked %}<span class="checked tag">{% trans "Checked" %}</span>{% endif %}
{% if event.is_day_past and not event.cancelled %}
{% if event.present_count %}<span class="meta meta-success">{% blocktrans with count=event.present_count %}Presents {{ count }}{% endblocktrans %}</span>{% endif %}

View File

@ -1717,6 +1717,7 @@ def test_event_checked(app, admin_user):
resp = app.get(url)
assert '<span class="checked tag">Checked</span>' not in resp
assert 'check-locked' not in resp
assert 'invoiced' not in resp
assert '<span class="meta meta-success">Presents 3</span>' in resp
assert '<span class="meta meta-error">Absents 4</span>' in resp
assert '<span class="meta meta-disabled">Not checked 1</span>' in resp
@ -1738,6 +1739,7 @@ def test_event_checked(app, admin_user):
resp = app.get(url)
assert '<span class="checked tag">Checked</span>' in resp
assert 'check-locked' not in resp
assert 'invoiced' not in resp
assert '<span class="meta meta-success">Presents 4</span>' in resp
assert '<span class="meta meta-error">Absents 4</span>' in resp
assert 'meta meta-disabled' not in resp
@ -1780,12 +1782,21 @@ def test_event_checked(app, admin_user):
for url in urls:
resp = app.get(url)
assert '<span class="check-locked tag">Check locked</span>' in resp
assert 'invoiced' not in resp
app.post(
'/manage/agendas/%s/events/%s/checked' % (agenda.pk, event.pk),
params={'csrfmiddlewaretoken': token},
status=404,
)
# event check is locked and envent is invoiced
event.invoiced = True
event.save()
for url in urls:
resp = app.get(url)
assert 'check-locked' not in resp
assert '<span class="invoiced tag">Invoiced</span>' in resp
@mock.patch('chrono.manager.forms.get_agenda_check_types')
def test_event_check_filters(check_types, app, admin_user):