ISO-27001-Risk-Management/templates/risks/list_risks.html

161 lines
6.7 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% load i18n risk_extras %}
{% block crumbs %}
<li><a href="{% url 'risks:list_risks' %}">{% trans "Risk analysis" %}</a></li>
<li><a href="{% url 'admin:risks_risk_add' %}"><span class="icon breadcrumb-add-icon"><i class="fas fa-add"></i></span></a></li>
{% endblock %}
{% block content %}
2025-09-11 15:02:29 +02:00
<!-- Filter Section -->
<section class="section has-background-light py-2">
<form method="get" class="mb-4">
<div class="columns is-multiline is-vcentered">
2025-09-11 15:02:29 +02:00
<!-- Filter: Risk -->
<div class="column is-2">
<label class="label is-small">{% trans "Risks" %}</label>
<div class="select is-small is-fullwidth">
<select name="risk" onchange="this.form.submit()">
<option value="">{% trans "All" %}</option>
{% for r in risk_choices %}
<option value="{{ r.id }}" {% if request.GET.risk == r.id|stringformat:"s" %}selected{% endif %}>
{{ r.title }}
</option>
{% endfor %}
</select>
</div>
2025-09-11 15:02:29 +02:00
</div><!-- Filter: Risk End -->
2025-09-11 15:02:29 +02:00
<!-- Filter: Asset -->
<div class="column is-2">
<label class="label is-small">{% trans "Assets" %}</label>
<div class="select is-small is-fullwidth">
<select name="asset" onchange="this.form.submit()">
<option value="">{% trans "All" %}</option>
{% for a in asset_choices %}
<option value="{{ a }}" {% if request.GET.asset == a|stringformat:"s" %}selected{% endif %}>
{{ a }}
</option>
{% endfor %}
</select>
</div>
2025-09-11 15:02:29 +02:00
</div><!-- Filter: Asset End -->
2025-09-11 15:02:29 +02:00
<!-- Filter: Category -->
<div class="column is-2">
<label class="label is-small">{% trans "Categories" %}</label>
<div class="select is-small is-fullwidth">
<select name="category" onchange="this.form.submit()">
<option value="">{% trans "All" %}</option>
{% for cat in category_choices %}
<option value="{{ cat }}" {% if request.GET.category == cat|stringformat:"s" %}selected{% endif %}>
{{ cat }}
</option>
{% endfor %}
</select>
</div>
2025-09-11 15:02:29 +02:00
</div><!-- Filter: Category End -->
2025-09-11 15:02:29 +02:00
<!-- Filter: Process -->
<div class="column is-2">
<label class="label is-small">{% trans "Processes" %}</label>
<div class="select is-small is-fullwidth">
<select name="process" onchange="this.form.submit()">
<option value="">{% trans "All" %}</option>
{% for p in process_choices %}
<option value="{{ p }}" {% if request.GET.process == p|stringformat:"s" %}selected{% endif %}>
{{ p }}
</option>
{% endfor %}
</select>
</div>
2025-09-11 15:02:29 +02:00
</div><!-- Filter: Process End -->
2025-09-11 15:02:29 +02:00
<!-- Filter: Owner -->
<div class="column is-2">
<label class="label is-small">{% trans "Owners" %}</label>
<div class="select is-small is-fullwidth">
<select name="owner" onchange="this.form.submit()">
<option value="">{% trans "All" %}</option>
{% for u in owner_choices %}
<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>
2025-09-11 15:02:29 +02:00
</div><!-- Filter: Owner End -->
2025-09-11 15:02:29 +02:00
<!-- Filter: Reset -->
<div class="column is-2">
<label class="label is-small">&nbsp;</label>
<div class="control">
<a href="{% url 'risks:list_risks' %}" class="button is-small is-light is-fullwidth">
<span class="icon"><i class="fas fa-undo"></i></span>
<span>{% trans "Reset filters" %}</span>
</a>
</div>
2025-09-11 15:02:29 +02:00
</div><!-- Filter: Reset End -->
2025-09-11 15:02:29 +02:00
</div>
</form>
</section><!-- Filter Section End -->
2025-09-11 15:02:29 +02:00
<!-- Risk Table -->
<div class="table-container">
<table class="table is-bordered is-striped is-narrow is-hoverable is-fullwidth">
<thead>
<tr class="has-background-prosoft">
<th class="has-text-centered">
<a href="{% sort_url request 'id' current_sort current_dir %}">{% trans "No." %}</a>
</th>
<th class="has-text-centered"><abbr title="{% trans 'Confidentiality' %}">C</abbr></th>
<th class="has-text-centered"><abbr title="{% trans 'Integrity' %}">I</abbr></th>
<th class="has-text-centered"><abbr title="{% trans 'Availability' %}">A</abbr></th>
<th class="has-text-centered">
<a href="{% sort_url request 'title' current_sort current_dir %}">{% trans "Risk" %}</a>
</th>
<th class="has-text-centered">
<a href="{% sort_url request 'asset' current_sort current_dir %}">{% trans "Asset" %}</a>
</th>
<th class="has-text-centered">
<a href="{% sort_url request 'category' current_sort current_dir %}">{% trans "Category" %}</a>
</th>
<th class="has-text-centered">
<a href="{% sort_url request 'process' current_sort current_dir %}">{% trans "Process" %}</a>
</th>
<th class="has-text-centered">
<a href="{% sort_url request 'status' current_sort current_dir %}">{% trans "Status" %}</a>
</th>
<th class="has-text-centered has-text-prosoft">{% trans "Created" %}</th>
<th class="has-text-centered has-text-prosoft">{% trans "by" %}</th>
<th class="has-text-centered has-text-prosoft">{% trans "Changed" %}</th>
<th class="has-text-centered has-text-prosoft">{% trans "by" %}</th>
</tr>
</thead>
<tbody>
{% for r in risks %}
<tr onclick="window.location.href='{% url 'risks:show_risk' r.id %}'" style="cursor:pointer;">
<td>{{ r.id }}</td>
<td class="has-text-centered"><input type="checkbox" disabled {% if "1" in r.cia %}checked{% endif %}></td>
<td class="has-text-centered"><input type="checkbox" disabled {% if "2" in r.cia %}checked{% endif %}></td>
<td class="has-text-centered"><input type="checkbox" disabled {% if "3" in r.cia %}checked{% endif %}></td>
<td>{{ r.title }}</td>
<td>{{ r.asset }}</td>
<td>{{ r.category }}</td>
<td>{{ r.process }}</td>
<td>{{ r.get_status_display }}</td>
<td>{{ r.created_at|date:"d.m.Y H:i" }}</td>
<td>{{ r.owner|user_display }}</td>
<td>{{ r.updated_at|date:"d.m.Y H:i" }}</td>
<td>{{ r.owner|user_display }}</td>
</tr>
{% empty %}
<tr><td colspan="13" class="has-text-grey has-text-centered">{% trans "No data" %}</td></tr>
{% endfor %}
</tbody>
</table>
</div><!-- Risk Table End -->
2025-09-11 15:02:29 +02:00
{% endblock %}