
- Updated Risk model to include description, created_at, and updated_at fields. - Modified RiskSerializer to include created_at and updated_at in serialized output. - Improved logging in signals for Risk and Control models, including serialization of values. - Added new template tags for CIA label mapping. - Refactored URL patterns for better clarity and added detail views for risks, controls, and incidents. - Implemented list and detail views for risks, controls, and incidents with filtering options. - Enhanced CSS for better UI/UX, including breadcrumbs and table styling. - Created new templates for displaying individual risks, controls, and incidents with detailed information.
154 lines
No EOL
4.9 KiB
HTML
154 lines
No EOL
4.9 KiB
HTML
{% extends "base.html" %}
|
||
{% block crumbs %}
|
||
<li><a href="{% url 'risks:list_controls' %}">Maßnahmen</a></li>
|
||
{% endblock %}
|
||
{% block content %}
|
||
<!-- Filter -->
|
||
<section class="section">
|
||
<div class="box">
|
||
<h2 class="title is-5">Auswahl</h2>
|
||
|
||
<form method="get">
|
||
<div class="columns is-multiline">
|
||
|
||
<!-- Maßnahmen -->
|
||
<div class="column is-3">
|
||
<div class="field">
|
||
<label class="label">Maßnahme</label>
|
||
<div class="control">
|
||
<div class="select is-fullwidth">
|
||
<select name="control" onchange="this.form.submit()">
|
||
<option value="">Alle</option>
|
||
{% for c in controls %}
|
||
<option value="{{ c.id }}" {% if request.GET.control == c.id|stringformat:"s" %}selected{% endif %}>
|
||
{{ c.title }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Risiko -->
|
||
<div class="column is-3">
|
||
<div class="field">
|
||
<label class="label">Risiko</label>
|
||
<div class="control">
|
||
<div class="select is-fullwidth">
|
||
<select name="risk" onchange="this.form.submit()">
|
||
<option value="">Alle</option>
|
||
{% for r in risks %}
|
||
<option value="{{ r.id }}" {% if request.GET.risk == r.id|stringformat:"s" %}selected{% endif %}>
|
||
{{ r.title }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Status -->
|
||
<div class="column is-3">
|
||
<div class="field">
|
||
<label class="label">Status</label>
|
||
<div class="control">
|
||
<div class="select is-fullwidth">
|
||
<select name="status" onchange="this.form.submit()">
|
||
<option value="">Alle</option>
|
||
{% for key,label in status_choices %}
|
||
<option value="{{ key }}" {% if request.GET.status == key %}selected{% endif %}>
|
||
{{ label }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- Verantwortliche/r -->
|
||
<div class="column is-3">
|
||
<div class="field">
|
||
<label class="label">Verantwortliche/r</label>
|
||
<div class="control">
|
||
<div class="select is-fullwidth">
|
||
<select name="responsible" onchange="this.form.submit()">
|
||
<option value="">Alle</option>
|
||
{% for u in users %}
|
||
<option value="{{ u.id }}" {% if request.GET.responsible == u.id|stringformat:"s" %}selected{% endif %}>
|
||
{{ u.get_full_name|default:u.username }}
|
||
</option>
|
||
{% endfor %}
|
||
</select>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
</div>
|
||
</form>
|
||
|
||
<h2 class="title is-5">Maßnahmen</h2>
|
||
|
||
<div class="table-container">
|
||
<table class="table is-bordered is-striped is-hoverable is-fullwidth">
|
||
<thead>
|
||
<tr>
|
||
<th>Maßnahme</th>
|
||
<th>Risiken</th>
|
||
<th>Verantwortliche/r</th>
|
||
<th>Status</th>
|
||
<th>Frist</th>
|
||
<th>Link</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
{% for c in controls %}
|
||
<tr onclick="window.location.href='{% url 'risks:show_control' c.id %}'" style="cursor:pointer;">
|
||
<td>{{ c.title }}</td>
|
||
<td>
|
||
{% if c.risk %}
|
||
<a href="{% url 'risks:show_risk' c.risk.id %}" onclick="event.stopPropagation();">
|
||
{{ c.risk.title }}
|
||
</a>
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if c.responsible %}
|
||
{{ c.responsible.get_full_name|default:c.responsible.username }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
<td>{{ c.get_status_display }}</td>
|
||
<td>
|
||
{% if c.due_date %}
|
||
{{ c.due_date|date:"d.m.Y" }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
<td>
|
||
{% if c.wiki_link %}
|
||
<a href="{{ c.wiki_link }}" target="_blank">🔗</a>
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr>
|
||
<td colspan="6" class="has-text-centered has-text-grey">Keine Maßnahmen gefunden</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div>
|
||
</div>
|
||
</section>
|
||
|
||
{% endblock %} |