
- Added AuditUserMiddleware to track the current user for auditing purposes. - Introduced audit_context for managing the current user in thread-local storage. - Updated Control and Incident models to include created_at and updated_at timestamps. - Refactored Control and Incident serializers to handle related risks and timestamps. - Modified views to set the _changed_by attribute for user actions. - Enhanced incident listing and detail views to display related risks and user actions. - Updated templates for better presentation of risks and incidents. - Added migrations for new fields and relationships in the database. - Improved filtering options in the incident list view.
129 lines
No EOL
3.9 KiB
HTML
129 lines
No EOL
3.9 KiB
HTML
{% extends "base.html" %}
|
||
{% block crumbs %}
|
||
<li><a href="{% url 'risks:list_incidents' %}">Vorfälle</a></li>
|
||
<li><a href="{% url 'risks:show_incident' incident.id %}">{{ incident.title }}</a></li>
|
||
{% endblock %}
|
||
{% block content %}
|
||
<div class="container">
|
||
<section class="hero is-small">
|
||
<div class="hero-body">
|
||
<p class="title">Vorfall: {{ incident.title }}</p>
|
||
<p class="subtitle is-6">{{ incident.description }}</p>
|
||
</div>
|
||
</section>
|
||
<!-- Überblick-->
|
||
<div class="card">
|
||
<header class="card-header">
|
||
<p class="card-header-title">Überblick</p>
|
||
</header>
|
||
<!-- Inhalt Überblick-->
|
||
<div class="card-content">
|
||
<div class="columns is-multiline">
|
||
<div class="column is-half">
|
||
<p><strong>Gemeldet von:</strong> {{ incident.reported_by|default:"-" }}</p>
|
||
<p><strong>Gemeldet am:</strong> {{ incident.date_reported|date:'d.m.Y' }}</p>
|
||
<p><strong>Status:</strong> {{ incident.status }}</p>
|
||
</div>
|
||
<div class="column is-half">
|
||
<p><strong>Erstellt am:</strong> {{ incident.created_at|date:'d.m.Y H:i' }}</p>
|
||
<p><strong>Aktualisiert am:</strong> {{ incident.updated_at|date:'d.m.Y H:i' }}</p>
|
||
</div>
|
||
</div>
|
||
</div> <!-- Ende Inhalt Überblick -->
|
||
</div> <!-- Ende Überblick -->
|
||
|
||
<!-- Risiken -->
|
||
<div class="card">
|
||
<header class="card-header">
|
||
<p class="card-header-title">Zugehörige Risiken</p>
|
||
</header>
|
||
<div class="card-content">
|
||
{% if incident.related_risks %}
|
||
<table class="table is-striped is-hoverable is-fullwidth">
|
||
<thead>
|
||
<tr>
|
||
<th>Titel</th>
|
||
<th>Risikoeigner</th>
|
||
<th>Kategorie</th>
|
||
<th>Asset</th>
|
||
<th>Prozess</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for risk in incident.related_risks.all %}
|
||
<tr onclick="window.location.href='/risks/risks/{{ risk.id }}';" style="cursor:pointer;">
|
||
<td>{{ risk.title }}</td>
|
||
<td>
|
||
{% if risk.owner %}
|
||
{{ risk.owner }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if risk.category %}
|
||
{{ risk.category }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if risk.asset %}
|
||
{{ risk.asset }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if risk.process %}
|
||
{{ risk.process }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% else %}
|
||
<p class="has-text-grey">Keine Verknüpften Risiken.</p>
|
||
{% endif %}
|
||
</div>
|
||
</div>
|
||
<!-- Ende Maßnahmen -->
|
||
|
||
<!-- Historie -->
|
||
<div class="card">
|
||
<header class="card-header">
|
||
<p class="card-header-title">Historie</p>
|
||
</header>
|
||
<div class="card-content">
|
||
{% if logs %}
|
||
<table class="table is-striped is-fullwidth">
|
||
<thead>
|
||
<tr>
|
||
<th>Zeitpunkt</th>
|
||
<th>Benutzer</th>
|
||
<th>Aktion</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for log in logs %}
|
||
<tr>
|
||
<td>{{ log.action_time|date:"d.m.Y H:i" }}</td>
|
||
<td>{{ log.user.get_full_name|default:log.user.username }}</td>
|
||
<td>{{ log.get_change_message }}</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
{% else %}
|
||
<p class="has-text-grey">Keine Historie vorhanden.</p>
|
||
{% endif %}
|
||
</div>
|
||
</div> <!-- Ende Historie -->
|
||
|
||
<br><br>
|
||
|
||
</div>
|
||
{% endblock %} |