Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Mitarbeiter
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Mitarbeiter hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Neuen Mitarbeiter anlegen
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors mb-8">
|
||||
|
||||
<form method="post" enctype="multipart/form-data" class="space-y-4">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
{{ form.as_p }}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn mt-4 btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,68 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Login
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
<div class="flex justify-center">
|
||||
{% if company_settings.logo %}
|
||||
<img src="{{ company_settings.logo.url }}" alt="" class="h-32">
|
||||
|
||||
{% elif company_settings.companyname %}
|
||||
{{ company_settings.companyname }}
|
||||
{% else %}
|
||||
Projektverwaltung
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="flex justify-center items-center min-h-[80vh]">
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors w-full max-w-md">
|
||||
|
||||
<h1 class="text-3xl font-bold text-center mb-6">
|
||||
Anmelden
|
||||
</h1>
|
||||
|
||||
<form method="post" class="space-y-4">
|
||||
{% csrf_token %}
|
||||
|
||||
{% for field in form %}
|
||||
<div class="space-y-1">
|
||||
<label class="block text-sm font-medium text-slate-700 dark:text-slate-300">
|
||||
{{ field.label }}
|
||||
</label>
|
||||
<input
|
||||
type="{{ field.field.widget.input_type }}"
|
||||
name="{{ field.html_name }}"
|
||||
id="{{ field.id_for_label }}"
|
||||
{% if field.value %}value="{{ field.value }}"{% endif %}
|
||||
class="w-full px-4 py-3 rounded-lg border border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-700 text-slate-900 dark:text-white placeholder-slate-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition"
|
||||
placeholder="{{ field.label }}"
|
||||
>
|
||||
{% if field.errors %}
|
||||
<p class="text-sm text-red-500">{{ field.errors|join:", " }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn w-full btn-action"
|
||||
>
|
||||
Anmelden
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,100 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Mitarbeiter
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Mitarbeiter
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Mitarbeiter, Rollen und Berechtigungen verwalten
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% load django_tables2 %}
|
||||
<div class="mb-8">
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4">
|
||||
<div>
|
||||
<h2 class="text-xl font-bold">Aktionen</h2>
|
||||
<p class="text-slate-400 text-sm mt-1">Mitarbeiter oder Rollen hinzufügen</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-2">
|
||||
<a href="{% url 'accounts:user_add' %}" class="btn btn-add">+ Mitarbeiter</a>
|
||||
<a href="{% url 'accounts:role_add' %}" class="btn btn-add">+ Rolle</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors mb-8">
|
||||
|
||||
<div class="mb-6">
|
||||
<h2 class="text-xl font-bold">
|
||||
Benutzer
|
||||
</h2>
|
||||
|
||||
<p class="text-slate-400 text-sm mt-1">
|
||||
Aktive Benutzer mit Rollen und Berechtigungen
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
|
||||
{% render_table table %}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors mb-8">
|
||||
|
||||
<div class="mb-6">
|
||||
<h2 class="text-xl font-bold">
|
||||
Archivierte Benutzer
|
||||
</h2>
|
||||
|
||||
<p class="text-slate-400 text-sm mt-1">
|
||||
Deaktivierte Benutzer
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
|
||||
{% render_table archived_table %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors mt-8">
|
||||
|
||||
<div class="mb-6">
|
||||
<h2 class="text-xl font-bold">
|
||||
Rollen
|
||||
</h2>
|
||||
|
||||
<p class="text-slate-400 text-sm mt-1">
|
||||
Rollen und Berechtigungen verwalten
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
|
||||
{% render_table role_table %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,36 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Mitarbeiter
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Rolle hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Neue Rolle anlegen
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors mb-8">
|
||||
|
||||
<form method="post" enctype="multipart/form-data" class="space-y-4">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
{{ form.as_p }}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn mt-4 btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,121 @@
|
||||
<form method="post" action="{% url 'accounts:user_edit' item.id %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<div>
|
||||
|
||||
<div class="grid md:grid-cols-2 xl:grid-cols-3 gap-4">
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Benutzername
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="username"
|
||||
value="{{ item.username }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Vorname
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="first_name"
|
||||
value="{{ item.first_name }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Nachname
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="last_name"
|
||||
value="{{ item.last_name }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
E-Mail
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
value="{{ item.email }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Rolle
|
||||
</label>
|
||||
|
||||
<select
|
||||
name="role"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
|
||||
<option value="">
|
||||
---
|
||||
</option>
|
||||
|
||||
{% for role in table.roles %}
|
||||
<option
|
||||
value="{{ role.id }}"
|
||||
{% if item.profile.role_id == role.id %}selected{% endif %}>
|
||||
{{ role.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Letzter Login
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
disabled
|
||||
value="{{ item.last_login|date:'d.m.Y H:i' }}"
|
||||
class="border rounded px-3 py-2 w-full bg-slate-100">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5 flex gap-2">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
formaction="{% url 'accounts:user_reactivate' item.id %}"
|
||||
class="btn btn-action">
|
||||
Aktivieren
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,121 @@
|
||||
<form method="post" action="{% url 'accounts:user_edit' item.id %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<div>
|
||||
|
||||
<div class="grid md:grid-cols-2 xl:grid-cols-3 gap-4">
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Benutzername
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="username"
|
||||
value="{{ item.username }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Vorname
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="first_name"
|
||||
value="{{ item.first_name }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Nachname
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="last_name"
|
||||
value="{{ item.last_name }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
E-Mail
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="email"
|
||||
name="email"
|
||||
value="{{ item.email }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Rolle
|
||||
</label>
|
||||
|
||||
<select
|
||||
name="role"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
|
||||
<option value="">
|
||||
---
|
||||
</option>
|
||||
|
||||
{% for role in table.roles %}
|
||||
<option
|
||||
value="{{ role.id }}"
|
||||
{% if item.profile.role_id == role.id %}selected{% endif %}>
|
||||
{{ role.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Letzter Login
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
disabled
|
||||
value="{{ item.last_login|date:'d.m.Y H:i' }}"
|
||||
class="border rounded px-3 py-2 w-full bg-slate-100">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5 flex gap-2">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
formaction="{% url 'accounts:user_archive' item.id %}"
|
||||
class="btn btn-action">
|
||||
Archivieren
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1 @@
|
||||
{{ record.profile.role.name|default:"-" }}
|
||||
@@ -0,0 +1,63 @@
|
||||
<form method="post" action="{% url 'accounts:role_edit' item.id %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<div>
|
||||
|
||||
<h3 class="font-bold mb-4">
|
||||
Berechtigungen
|
||||
</h3>
|
||||
|
||||
|
||||
<div class="grid md:grid-cols-2 xl-grid-cols-3 gap-4">
|
||||
|
||||
{% for permission in item.permissions %}
|
||||
|
||||
<label class="
|
||||
bg-slate-100 dark:bg-slate-700
|
||||
rounded-xl
|
||||
p-3
|
||||
flex
|
||||
items-center
|
||||
gap-3
|
||||
">
|
||||
|
||||
<input
|
||||
type="checkbox"
|
||||
name="{{ permission.name }}"
|
||||
{% if permission.value %}
|
||||
checked
|
||||
{% endif %}
|
||||
class="w-4 h-4">
|
||||
|
||||
<span>
|
||||
{{ permission.verbose_name }}
|
||||
</span>
|
||||
|
||||
</label>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5 flex gap-2">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
formaction="{% url 'accounts:role_delete' item.id %}"
|
||||
class="btn btn-delete">
|
||||
Löschen
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,5 @@
|
||||
{% if record.is_superuser %}
|
||||
Ja
|
||||
{% else %}
|
||||
Nein
|
||||
{% endif %}
|
||||
Reference in New Issue
Block a user