
- Added verbose names for Incident and ResidualRisk models for better clarity in admin interface. - Updated impact choices for ResidualRisk and Risk models to ensure consistency and clarity. - Implemented gettext_lazy for translatable strings in models and choices. - Enhanced the Risk, ResidualRisk, Control, AuditLog, and Incident models with Meta options for better admin representation. - Added login required decorators to views for improved security. - Introduced new CSS variables and classes for better visual representation of risk levels. - Created custom template tags for dynamic CSS class assignment based on risk likelihood and impact. - Improved dashboard and statistics views with user authentication checks. - Updated templates for risks, controls, incidents, and admin interface to include edit and delete options for staff users. - Added new login and logout templates for user authentication. - Enhanced list views for risks, controls, and incidents to include action buttons for staff users. - Improved overall UI/UX with Bulma CSS framework for a more modern look and feel.
151 lines
No EOL
5.5 KiB
HTML
151 lines
No EOL
5.5 KiB
HTML
{% extends "base.html" %}
|
||
{% block crumbs %}
|
||
<li><a href="{% url 'risks:list_risks' %}">Risikoanalyse</a></li>
|
||
{% endblock %}
|
||
{% block content %}
|
||
<section class="section">
|
||
<div class="box">
|
||
<h2 class="title is-5">Auswahl</h2>
|
||
|
||
<!-- Filter -->
|
||
<form method="get">
|
||
<div class="columns is-multiline">
|
||
|
||
<!-- Risiko Filter -->
|
||
<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>
|
||
|
||
<!-- Maßnahmen Filter -->
|
||
<div class="column is-3">
|
||
<div class="field">
|
||
<label class="label">Maßnahmen</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>
|
||
|
||
<!-- Risikoeigner Filter -->
|
||
<div class="column is-3">
|
||
<div class="field">
|
||
<label class="label">Risikoeigner</label>
|
||
<div class="control">
|
||
<div class="select is-fullwidth">
|
||
<select name="owner" onchange="this.form.submit()">
|
||
<option value="">Alle</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">Risiken</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>Risiko</th>
|
||
<th>Asset / Prozes</th>
|
||
<th>Kategorie</th>
|
||
<th>Eintritt</th>
|
||
<th>Schaden</th>
|
||
<th>Score</th>
|
||
<th>Stufe</th>
|
||
<th>Risikoeigner</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 %}'" style="cursor:pointer;">{{ r.get_likelihood_display }}</td>
|
||
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">{{ r.get_impact_display }}</td>
|
||
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">{{ r.score }}</td>
|
||
<td onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" 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.get_full_name|default:r.owner.username }}
|
||
{% else %}
|
||
–
|
||
{% endif %}
|
||
</td>
|
||
</tr>
|
||
{% empty %}
|
||
<tr>
|
||
<td colspan="8" class="has-text-centered has-text-grey">Keine Risiken vorhanden</td>
|
||
</tr>
|
||
{% endfor %}
|
||
</tbody>
|
||
</table>
|
||
</div> <!-- Ende Risiken -->
|
||
</div>
|
||
</section>
|
||
|
||
{% endblock %} |