ISO-27001-Risk-Management/templates/risks/list_risks.html
Kevin Heyer ebfcbddd5c Implement notification system and status update forms
- Added Notification model with admin interface for managing notifications.
- Created context processor to count unread notifications for the user.
- Introduced forms for updating the status of Risk, Control, Incident, and ResidualRisk.
- Added views for displaying and managing notifications, including marking them as read.
- Updated URLs to include routes for notifications and status updates.
- Enhanced templates to support notifications display and status update forms.
- Improved CSS for avatar and badge display in the navbar.
- Translated various static texts to support internationalization.
2025-09-10 13:44:03 +02:00

160 lines
No EOL
6.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% extends "base.html" %}
{% load i18n risk_extras %}
{% block crumbs %}
<li><a href="{% url 'risks:list_risks' %}">{% trans "Risk analysis" %}</a></li>
{% endblock %}
{% block content %}
<section class="section">
<div class="box">
<h2 class="title is-5">{% trans "Filter" %}</h2>
<!-- Filter -->
<form method="get">
<div class="columns is-multiline">
<!-- Risiko Filter -->
<div class="column is-3">
<div class="field">
<label class="label">{% trans "Risk" %}</label>
<div class="control">
<div class="select is-fullwidth">
<select name="risk" onchange="this.form.submit()">
<option value="">{% trans "All" %}</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>
<!-- Maßnahmen Filter -->
<div class="column is-3">
<div class="field">
<label class="label">{% trans "Controls" %}</label>
<div class="control">
<div class="select is-fullwidth">
<select name="control" onchange="this.form.submit()">
<option value="">{% trans "All" %}</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>
<!-- Risikoeigner Filter -->
<div class="column is-3">
<div class="field">
<label class="label">{% trans "Risk Owner" %}</label>
<div class="control">
<div class="select is-fullwidth">
<select name="owner" onchange="this.form.submit()">
<option value="">{% trans "All" %}</option>
{% for u in owners %}
<option value="{{ u.id }}" {% if request.GET.owner == 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">{% trans "Risks" %}</h2>
<!-- Risiken -->
<div class="table-container">
<table class="table is-bordered is-striped is-hoverable is-fullwidth">
<thead>
<tr>
{% if request.user.is_staff %}<th></th>{% endif %}
<th>{% trans "Risk" %}</th>
<th>{% trans "Asset / Process" %}</th>
<th>{% trans "Category" %}</th>
<th>{% trans "Likelihood" %}</th>
<th>{% trans "Impact" %}</th>
<th>{% trans "Score" %}</th>
<th>{% trans "Level" %}</th>
<th>{% trans "Risk Owner" %}</th>
</tr>
</thead>
<tbody>
{% if request.user.is_staff %}
<tr>
<td class="has-text-centered">
<a class="icon has-text-success" href="{% url 'admin:risks_risk_add' %}" title="Risiko hinzufügen">
<i class="fas fa-add"></i>
</a>
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
{% endif %}
{% for r in risks %}
<tr>
{% if request.user.is_staff %}
<td class="has-text-centered">
<a class="icon has-text-warning" href="{% url 'admin:risks_risk_change' r.id %}" title="Risiko bearbeiten">
<i class="fas fa-edit"></i>
</a>
</td>
{% endif %}
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">{{ r.title }}</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">
{{ r.asset }}
{% if r.process %}
<br><small>{{ r.process }}</small>
{% endif %}
</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">{{ r.category }}</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" class="has-text-centered {{ r.likelihood|likelihood_class|to_bg }}" style="cursor:pointer;">
{{ r.likelihood|likelihood_id_label }}
</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" class="has-text-centered {{ r.impact|impact_class|to_bg }}" style="cursor:pointer;">
{{ r.impact|impact_id_label }}
</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" class="has-text-centered {{ r.score|score_class|to_bg }}" style="cursor:pointer;">
{{ r.score }}
</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" class="has-text-centered {{ r.level|level_class|to_bg }}" style="cursor:pointer;">
{{ r.level }}
</td>
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">
{% if r.owner %}
{{ r.owner|user_display }}
{% else %}
{% endif %}
</td>
</tr>
{% empty %}
<tr>
<td colspan="8" class="has-text-centered has-text-grey">{% trans "No risks present" %}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div> <!-- Ende Risiken -->
</div>
</section>
{% endblock %}