Add FontAwesome webfonts and update templates for Risiko Management
- Added FontAwesome webfont files: fa-brands-400.woff2, fa-regular-400.woff2, fa-solid-900.woff2, and fa-v4compatibility.woff2. - Updated base.html to include FontAwesome stylesheet. - Renamed the application title from "Risiko Management" to "ISO27001 Management". - Enhanced navigation menu with dynamic active states for Dashboard, Statistics, Risks, Controls, and Incidents. - Created new templates for dashboard, controls, incidents, risks, and statistics with breadcrumb navigation.
This commit is contained in:
parent
7f90f67f2a
commit
ff134eee9a
36 changed files with 148 additions and 20 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -1,4 +1,5 @@
|
|||
.venv
|
||||
.startserver.sh
|
||||
.env
|
||||
sb.sqlite3
|
||||
sb.sqlite3
|
||||
__pycache__
|
Binary file not shown.
Binary file not shown.
|
@ -2,14 +2,10 @@ from api.views import ping, secure_ping
|
|||
from django.conf import settings
|
||||
from django.contrib import admin
|
||||
from django.urls import path, include
|
||||
from django.shortcuts import render
|
||||
from django.shortcuts import render, redirect
|
||||
from rest_framework import routers
|
||||
from risks.views import RiskViewSet, ControlViewSet, ResidualRiskViewSet, UserViewSet, AuditViewSet
|
||||
|
||||
# DEBUG
|
||||
def home_view(request):
|
||||
return render(request, "base.html")
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
router.register(r"risks", RiskViewSet)
|
||||
router.register(r"controls", ControlViewSet)
|
||||
|
@ -22,7 +18,8 @@ urlpatterns = [
|
|||
path("api/ping/", ping), # Public healthcheck endpoint
|
||||
path("api/secure-ping/", secure_ping), # Protected API endpoint
|
||||
path("api/", include(router.urls)),
|
||||
path("", home_view, name="home"), # DEBUG
|
||||
path("", include("risks.urls")),
|
||||
path("risks/", include("risks.urls")),
|
||||
]
|
||||
|
||||
# Add OIDC routes only if Single Sign-On is enabled
|
||||
|
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
18
risks/migrations/0008_rename_send_notification_sent.py
Normal file
18
risks/migrations/0008_rename_send_notification_sent.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 5.2.6 on 2025-09-07 19:59
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('risks', '0007_notification'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='notification',
|
||||
old_name='send',
|
||||
new_name='sent',
|
||||
),
|
||||
]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
13
risks/urls.py
Normal file
13
risks/urls.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
from django.urls import path
|
||||
from . import views
|
||||
|
||||
app_name = "risks"
|
||||
|
||||
urlpatterns = [
|
||||
path("", views.dashboard, name="dashboard"),
|
||||
path("risks/index", views.dashboard, name="index"),
|
||||
path("risks/stats", views.stats, name="statistics"),
|
||||
path("risks/risks", views.risks, name="risks"),
|
||||
path("risks/controls", views.controls, name="controls"),
|
||||
path("risks/incidents", views.incidents, name="incidents"),
|
||||
]
|
|
@ -1,9 +1,13 @@
|
|||
from django.contrib.auth import get_user_model
|
||||
from rest_framework import viewsets
|
||||
from rest_framework.permissions import IsAuthenticated
|
||||
from django.shortcuts import render
|
||||
from .models import Risk, Control, ResidualRisk, AuditLog, Incident
|
||||
from .serializers import ControlSerializer, RiskSerializer, ResidualRiskSerializer, UserSerializer, AuditSerializer, IncidentSerializer
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# API
|
||||
# ---------------------------------------------------------------------------
|
||||
class RiskViewSet(viewsets.ModelViewSet):
|
||||
"""
|
||||
API endpoint for managing Risks.
|
||||
|
@ -91,4 +95,23 @@ class IncidentViewSet(viewsets.ModelViewSet):
|
|||
def perform_update(self, serializer):
|
||||
instance = serializer.save()
|
||||
instance._changed_by = self.request.user
|
||||
instance.save()
|
||||
instance.save()
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Web
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
def dashboard(request):
|
||||
return render(request, "risks/dashboard.html")
|
||||
|
||||
def stats(request):
|
||||
return render(request, "risks/statistics.html")
|
||||
|
||||
def risks(request):
|
||||
return render(request, "risks/list_risks.html")
|
||||
|
||||
def controls(request):
|
||||
return render(request, "risks/list_controls.html")
|
||||
|
||||
def incidents(request):
|
||||
return render(request, "risks/list_incidents.html")
|
|
@ -34,4 +34,20 @@ html, body {
|
|||
margin-left: 0;
|
||||
padding-top: 2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Breadcrumps
|
||||
**/
|
||||
|
||||
.breadcrumb {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.content li{
|
||||
margin-top: 5px !important;
|
||||
}
|
||||
|
||||
.content li+li {
|
||||
margin: 0 !important;
|
||||
}
|
9
static/css/fontawesome.min.css
vendored
Normal file
9
static/css/fontawesome.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
static/webfonts/fa-brands-400.woff2
Normal file
BIN
static/webfonts/fa-brands-400.woff2
Normal file
Binary file not shown.
BIN
static/webfonts/fa-regular-400.woff2
Normal file
BIN
static/webfonts/fa-regular-400.woff2
Normal file
Binary file not shown.
BIN
static/webfonts/fa-solid-900.woff2
Normal file
BIN
static/webfonts/fa-solid-900.woff2
Normal file
Binary file not shown.
BIN
static/webfonts/fa-v4compatibility.woff2
Normal file
BIN
static/webfonts/fa-v4compatibility.woff2
Normal file
Binary file not shown.
|
@ -7,6 +7,7 @@
|
|||
<title>Risiko Management</title>
|
||||
<link rel="stylesheet" href="{% static '/css/bulma.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static '/css/design.css' %}">
|
||||
<link rel="stylesheet" href="{% static '/css/fontawesome.min.css' %}">
|
||||
<link rel="stylesheet" href="{% static '/css/print.css' %}" media="print">
|
||||
|
||||
<meta name="description" content="Effizientes Risiko Management für Unternehmen: Analysieren, bewerten und steuern Sie Risiken sicher und zuverlässig.">
|
||||
|
@ -15,11 +16,11 @@
|
|||
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
||||
</head>
|
||||
<body>
|
||||
<!-- Obere Navbar -->
|
||||
<!-- User Navbar -->
|
||||
<nav class="navbar is-fixed-top has-shadow">
|
||||
<div class="navbar-brand">
|
||||
<a class="navbar-item" href="#">
|
||||
<strong>Risiko Management</strong>
|
||||
<strong>ISO27001 Management</strong>
|
||||
</a>
|
||||
<a role="button" class="navbar-burger" aria-label="menu" aria-expanded="false" data-target="navbarMenu">
|
||||
<span aria-hidden="true"></span>
|
||||
|
@ -49,22 +50,40 @@
|
|||
<aside class="menu sidebar">
|
||||
<p class="menu-label">Allgemein</p>
|
||||
<ul class="menu-list">
|
||||
<li><a class="is-active" href="#">Dashboard</a></li>
|
||||
<li><a href="#">Aufgaben</a></li>
|
||||
<li><a href="#">Statistiken</a></li>
|
||||
<li><a class="{% if request.path == '/risks/' %}is-active{% endif %}" href="/risks/">Dashboard</a></li>
|
||||
<li><a class="{% if request.path == '/risks/stats' %}is-active{% endif %}" href="/risks/stats">Statistiken</a></li>
|
||||
</ul>
|
||||
<p class="menu-label">Risikomanagement</p>
|
||||
<ul class="menu-list">
|
||||
<li><a class="{% if request.path == '/risks/risks' %}is-active{% endif %}" href="/risks/risks">Risiken</a></li>
|
||||
<li><a class="{% if request.path == '/risks/controls' %}is-active{% endif %}" href="/risks/controls">Maßnahmen</a></li>
|
||||
<li><a class="{% if request.path == '/risks/incidents' %}is-active{% endif %}" href="/risks/incidents">Vorfälle</a></li>
|
||||
</ul>
|
||||
<p class="menu-label">Verwaltung</p>
|
||||
<ul class="menu-list">
|
||||
<li><a href="#">Risiken</a></li>
|
||||
<li><a href="#">Maßnahmen</a></li>
|
||||
<li><a href="#">Adminbereich</a></li>
|
||||
<li><a href="/admin">Adminbereich</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
<!-- Hauptinhalt -->
|
||||
<!-- Content -->
|
||||
<main class="content">
|
||||
<h1 class="title">Willkommen zum Dashboard</h1>
|
||||
<p>Hier ist der Hauptinhalt des Dashboards.</p>
|
||||
{% block breadcrumbs %}
|
||||
<nav class="breadcrumb has-arrow-separator" aria-label="breadcrumbs">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{% url 'risks:index' %}">
|
||||
<span class="icon is-small">
|
||||
<i class="fas fa-home" aria-hidden="true"></i>
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
{% block crumbs %}
|
||||
{% if title %} › {{ title }}{% endif %}
|
||||
{% endblock %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
||||
{% block content %}{% endblock %}
|
||||
</main>
|
||||
|
||||
<!-- Bulma Navbar Burger Script -->
|
||||
|
|
4
templates/risks/dashboard.html
Normal file
4
templates/risks/dashboard.html
Normal file
|
@ -0,0 +1,4 @@
|
|||
{% extends "base.html" %}
|
||||
{% block content %}
|
||||
Dashboard
|
||||
{% endblock %}
|
7
templates/risks/list_controls.html
Normal file
7
templates/risks/list_controls.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% block crumbs %}
|
||||
<li><a href="{% url 'risks:controls' %}">Maßnahmen</a></li>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
Maßnahmen
|
||||
{% endblock %}
|
7
templates/risks/list_incidents.html
Normal file
7
templates/risks/list_incidents.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% block crumbs %}
|
||||
<li><a href="{% url 'risks:incidents' %}">Vorfälle</a></li>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
Vorfälle
|
||||
{% endblock %}
|
7
templates/risks/list_risks.html
Normal file
7
templates/risks/list_risks.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% block crumbs %}
|
||||
<li><a href="{% url 'risks:risks' %}">Risiken</a></li>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
Risiken
|
||||
{% endblock %}
|
7
templates/risks/statistics.html
Normal file
7
templates/risks/statistics.html
Normal file
|
@ -0,0 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% block crumbs %}
|
||||
<li><a href="{% url 'risks:statistics' %}">Statistiken</a></li>
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
Statistiken
|
||||
{% endblock %}
|
Loading…
Add table
Reference in a new issue