add notes app

This commit is contained in:
Java-Fish 2025-06-10 14:49:08 +02:00
parent acb398be1c
commit a29376b3c5
38 changed files with 1720 additions and 45 deletions

View file

@ -0,0 +1,138 @@
{% extends "base.html" %}
{% load crispy_forms_tags %}
{% block title %}{{ notiz.name }} - Notizen{% endblock %}
{% block content %}
<div class="container-fluid">
<div class="row">
<div class="col">
<div class="d-flex justify-content-between align-items-center mb-4">
<h1>
<i class="fas fa-sticky-note text-primary"></i>
{{ notiz.name }}
</h1>
<div class="btn-group" role="group">
<a href="{% url 'notizen:list' %}" class="btn btn-outline-secondary">
<i class="fas fa-arrow-left"></i> Zurück zur Liste
</a>
<a href="{% url 'notizen:edit' notiz.pk %}" class="btn btn-primary">
<i class="fas fa-edit"></i> Bearbeiten
</a>
</div>
</div>
{% if notiz.attached_to_object_str %}
<div class="alert alert-info mb-4">
<i class="fas fa-paperclip"></i>
Diese Notiz ist angehängt an: <strong>{{ notiz.attached_to_model_name }} - {{ notiz.attached_to_object_str }}</strong>
</div>
{% endif %}
<div class="card">
<div class="card-header">
<div class="row">
<div class="col">
<small class="text-muted">
Erstellt von: {{ notiz.erstellt_von.get_full_name|default:notiz.erstellt_von.username }}
am {{ notiz.erstellt_am|date:"d.m.Y H:i" }}
</small>
</div>
<div class="col-auto">
<small class="text-muted">
Zuletzt geändert: {{ notiz.geaendert_am|date:"d.m.Y H:i" }}
</small>
</div>
</div>
</div>
<div class="card-body">
<div class="notiz-content">
{{ html_content|safe }}
</div>
</div>
<div class="card-footer bg-transparent">
<div class="btn-group" role="group">
<a href="{% url 'notizen:edit' notiz.pk %}" class="btn btn-primary">
<i class="fas fa-edit"></i> Bearbeiten
</a>
<a href="{% url 'notizen:delete' notiz.pk %}" class="btn btn-outline-danger">
<i class="fas fa-trash"></i> Löschen
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.notiz-content {
line-height: 1.6;
}
.notiz-content h1, .notiz-content h2, .notiz-content h3,
.notiz-content h4, .notiz-content h5, .notiz-content h6 {
margin-top: 1.5rem;
margin-bottom: 1rem;
}
.notiz-content h1:first-child, .notiz-content h2:first-child,
.notiz-content h3:first-child, .notiz-content h4:first-child,
.notiz-content h5:first-child, .notiz-content h6:first-child {
margin-top: 0;
}
.notiz-content p {
margin-bottom: 1rem;
}
.notiz-content pre {
background-color: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 0.375rem;
padding: 1rem;
overflow-x: auto;
}
.notiz-content code {
background-color: #f8f9fa;
padding: 0.125rem 0.25rem;
border-radius: 0.25rem;
font-size: 0.875em;
}
.notiz-content pre code {
background-color: transparent;
padding: 0;
}
.notiz-content blockquote {
border-left: 4px solid #dee2e6;
padding-left: 1rem;
margin: 1rem 0;
color: #6c757d;
}
.notiz-content ul, .notiz-content ol {
margin-bottom: 1rem;
padding-left: 2rem;
}
.notiz-content table {
width: 100%;
margin-bottom: 1rem;
border-collapse: collapse;
}
.notiz-content table th,
.notiz-content table td {
padding: 0.5rem;
border: 1px solid #dee2e6;
}
.notiz-content table th {
background-color: #f8f9fa;
font-weight: 600;
}
</style>
{% endblock %}