Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TVIST1-813: Clean up case events #351

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ about writing changes to this log.

## [Unreleased]

- [PR-351](https://github.com/itk-dev/naevnssekretariatet/pull/351)
Cleanup case envents
- [PR-354](https://github.com/itk-dev/naevnssekretariatet/pull/354)
Downgraded `symfony/maker-bundle` to ensure support for annotations
- [PR-353](https://github.com/itk-dev/naevnssekretariatet/pull/353)
Expand Down
104 changes: 53 additions & 51 deletions templates/case/event/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -31,61 +31,63 @@
{% block content %}
<main role="main" class="col-12 mt-3">
{{ form_start(filter_form) }}
<div class="row g-0">
<div class="col-auto">
{{ form_widget(filter_form.category) }}
</div>
<div class="col-auto ms-2">
{{ form_widget(filter_form.query) }}
<div class="row row-cols-lg-auto g-3 align-items-center mb-3">
<div class="col-12">
{{ form_widget(filter_form.category) }}
</div>
<div class="col-12">
{{ form_widget(filter_form.query) }}
</div>
<div class="col-12">
<button class="btn btn-primary">{% trans %}Apply filter{% endtrans %}</button>

{# Get query parameters without filter#}
{% set query_parameters = app.request.query.all|filter((v, k) => k != 'case_event_filter') %}
{% set reset_filter_path = path(
app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')|merge(query_parameters)
) %}
</div>
<div class="col-12">
<a class="btn btn-secondary" href="{{ reset_filter_path }}" role="button">{% trans %}Reset filter{% endtrans %}</a>
</div>
{{ form_rest(filter_form) }}
</div>
<div class="col-auto ms-2">
<button class="btn btn-primary">{% trans %}Apply filter{% endtrans %}</button>
{{ form_end(filter_form) }}

<h2 class="fs-4">{% trans %}Event list{% endtrans %}</h2>

{# Get query parameters without filter#}
{% set query_parameters = app.request.query.all|filter((v, k) => k != 'case_event_filter') %}
{% set reset_filter_path = path(
app.request.attributes.get('_route'),
app.request.attributes.get('_route_params')|merge(query_parameters)
) %}
<a class="btn btn-secondary" href="{{ reset_filter_path }}" role="button">{% trans %}Reset filter{% endtrans %}</a>
<div class="list-group d-grid gap-3 w-auto">
{% for case_event in case_events %}
<a class="list-group-item list-group-item-action rounded-1 py-3 border-top" href="{{ path('case_event_show', {'id': case.id, 'caseEvent': case_event.id}) }}">
<div class="row">
<div class="col-auto">
<p class="fw-semibold fs-5 mb-0 d-inline me-3">{{ case_event.subject }}</p> {{ _self.case_event_status(case_event) }}
</div>
<div class="col-auto ms-auto">
<p class="text-secondary mb-0"><i class="fa-solid fa-tag fa-xs fa-fw opacity-50 me-1"></i>{{ case_event.category }}<i class="fa-solid fa-user fa-xs fa-fw ms-3 me-1 opacity-50"></i>{{ case_event.createdBy.name }}<i class="fa-solid fa-clock fa-xs fa-fw ms-3 me-1 opacity-50"></i>{{ case_event.receivedAt ? case_event.receivedAt|date(format_datetime) : '' }}</p>
</div>
</div>
<div class="row">
<div class="col-auto">
{% if case_event.senders %}
<p class="mb-0"><span class="text-secondary">{% trans %}Sender{% endtrans %}:</span> {{ case_event.senders|join(', ') }}</p>
{% endif %}
{% if case_event.recipients %}
<p class="mb-0"><span class="text-secondary">{% trans %}Recipient{% endtrans %}:</span> {{ case_event.recipients|join(', ') }}</p>
{% endif %}
</div>
<div class="col-auto ms-auto">
<p class="text-secondary"></p>
</div>
</div>
</a>
{% else %}
<div class="list-group-item">
<div class="col">{% trans %}No case events{% endtrans %}</div>
</div>
{% endfor %}
</div>
{{ form_rest(filter_form) }}
{{ form_end(filter_form) }}

<table class="table table-striped mt-2">
<thead>
<tr>
<th>{% trans %}Category{% endtrans %}</th>
<th>{% trans %}Sender{% endtrans %}</th>
<th>{% trans %}Recipient{% endtrans %}</th>
<th>{% trans %}Subject{% endtrans %}</th>
<th>{% trans %}Received at{% endtrans %}</th>
<th>{% trans %}User{% endtrans %}</th>
<th>{% trans %}Status{% endtrans %}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for case_event in case_events %}
<tr>
<td>{{ case_event.category }}</td>
<td>{{ case_event.senders|join(', ') }}</td>
<td>{{ case_event.recipients|join(', ') }}</td>
<td>{{ case_event.subject }}</td>
<td>{{ case_event.receivedAt ? case_event.receivedAt|date(format_datetime) : '' }}</td>
<td>{{ case_event.createdBy.name }}</td>
<td>{{ _self.case_event_status(case_event) }}</td>
<td>
<a href="{{ path('case_event_show', {'id': case.id, 'caseEvent': case_event.id}) }}">{% trans %}Show{% endtrans %}</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="7">{% trans %}No case events{% endtrans %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</main>
{% endblock %}
4 changes: 4 additions & 0 deletions translations/case_event+intl-icu.da.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@
<source>Be aware, that this creates a link between the case event and the selected cases, meaning changes to the case event will be shown on all linked cases.</source>
<target state="translated">Vær opmærksom på, at dette tilknytter de valgte sager til sagshændelsen, således at ændringer på sagshændelsen vil tage effekt på alle tilknyttede sager.</target>
</trans-unit>
<trans-unit id="B45ud_7" resname="Event list">
<source>Event list</source>
<target state="translated">Hændelsesliste</target>
</trans-unit>
</body>
</file>
</xliff>
4 changes: 4 additions & 0 deletions translations/case_event+intl-icu.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,10 @@
<source>Be aware, that this creates a link between the case event and the selected cases, meaning changes to the case event will be shown on all linked cases.</source>
<target>Be aware, that this creates a link between the case event and the selected cases, meaning changes to the case event will be shown on all linked cases.</target>
</trans-unit>
<trans-unit id="B45ud_7" resname="Event list">
<source>Event list</source>
<target>Event list</target>
</trans-unit>
</body>
</file>
</xliff>