+{% endblock %}
\ No newline at end of file
diff --git a/dasettings/__init__.py b/dasettings/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dasettings/__pycache__/__init__.cpython-38.pyc b/dasettings/__pycache__/__init__.cpython-38.pyc
new file mode 100644
index 0000000..5b34a81
Binary files /dev/null and b/dasettings/__pycache__/__init__.cpython-38.pyc differ
diff --git a/dasettings/__pycache__/admin.cpython-38.pyc b/dasettings/__pycache__/admin.cpython-38.pyc
new file mode 100644
index 0000000..af142da
Binary files /dev/null and b/dasettings/__pycache__/admin.cpython-38.pyc differ
diff --git a/dasettings/__pycache__/apps.cpython-38.pyc b/dasettings/__pycache__/apps.cpython-38.pyc
new file mode 100644
index 0000000..79620bc
Binary files /dev/null and b/dasettings/__pycache__/apps.cpython-38.pyc differ
diff --git a/dasettings/__pycache__/forms.cpython-38.pyc b/dasettings/__pycache__/forms.cpython-38.pyc
new file mode 100644
index 0000000..278fb38
Binary files /dev/null and b/dasettings/__pycache__/forms.cpython-38.pyc differ
diff --git a/dasettings/__pycache__/models.cpython-38.pyc b/dasettings/__pycache__/models.cpython-38.pyc
new file mode 100644
index 0000000..a0bfe95
Binary files /dev/null and b/dasettings/__pycache__/models.cpython-38.pyc differ
diff --git a/dasettings/__pycache__/urls.cpython-38.pyc b/dasettings/__pycache__/urls.cpython-38.pyc
new file mode 100644
index 0000000..91cb794
Binary files /dev/null and b/dasettings/__pycache__/urls.cpython-38.pyc differ
diff --git a/dasettings/__pycache__/views.cpython-38.pyc b/dasettings/__pycache__/views.cpython-38.pyc
new file mode 100644
index 0000000..e8b88b4
Binary files /dev/null and b/dasettings/__pycache__/views.cpython-38.pyc differ
diff --git a/dasettings/admin.py b/dasettings/admin.py
new file mode 100644
index 0000000..8c38f3f
--- /dev/null
+++ b/dasettings/admin.py
@@ -0,0 +1,3 @@
+from django.contrib import admin
+
+# Register your models here.
diff --git a/dasettings/apps.py b/dasettings/apps.py
new file mode 100644
index 0000000..8764e82
--- /dev/null
+++ b/dasettings/apps.py
@@ -0,0 +1,5 @@
+from django.apps import AppConfig
+
+
+class DASettingsConfig(AppConfig):
+ name = 'dasettings'
diff --git a/dasettings/forms.py b/dasettings/forms.py
new file mode 100644
index 0000000..b4fe5b9
--- /dev/null
+++ b/dasettings/forms.py
@@ -0,0 +1,110 @@
+from django import forms
+from django.db import models
+from django.contrib.auth.models import User
+from users.models import AgencyGroup, Agency, Profile, AgencyJob
+from PIL import Image
+
+# Change logged Users Data (Usernamen an Email) NUR HIER MÖGLICH!
+class UsersSelfChangeForm(forms.ModelForm):
+ email = forms.EmailField()
+
+ class Meta:
+ model = User
+ fields = ['email']
+
+# Form für die Benachrichtigungseinstellungen
+class UsersNotificationForm(forms.ModelForm):
+
+ class Meta:
+ model = Profile
+ labels = {
+ "news_mail" : "Agentur-News",
+ "user_standard_public_mail" : "Veröffentlichung meiner Standards",
+ "agency_new_standard_mail" : "Neue Agentur-Standards",
+ 'add_new_group_mail' : "Gruppenmitgliedschaften",
+ 'add_task_mail' : "Tätigkeitsbereich"
+ }
+ fields = ['news_mail', 'news_push', 'user_standard_public_mail', 'user_standard_public_push', 'agency_new_standard_mail', 'agency_new_standard_push', 'add_new_group_mail', 'add_new_group_push', 'add_task_mail', 'add_task_push']
+
+# PERMISSION GROUPS FORM
+class AgencyGroupPerms(forms.Form):
+ '''
+ Permission-System
+
+ Persmissions werden im Model gesetzt, hier automatisch als Form ausgegeben.
+ Hat der Nutzer eine der genannten Rechte, wird die Checkbox automatisch TRUE gesetzt.
+ Die erstellen Felder werden entsprechend den Feldern hinzugefügt und ausgegeben.
+
+ @param: user
+ - User ist der aufgerufene User!
+ '''
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ temprof = AgencyGroup
+ for ele in temprof._meta.permissions:
+ self.fields[ele[0]] = forms.BooleanField(required=False, initial=False, help_text=(ele[1]))
+
+# LOADING ALL MODUL-OPTIONS
+class AgencyModulsForm(forms.ModelForm):
+
+ class Meta:
+ model = Agency
+ labels = {
+ 'module_news' : "Agentur-News",
+ 'module_quicklinks' : "Quicklinks",
+ 'module_files' : "Dateien",
+ 'module_organigramm' : "Organigramm",
+ }
+ fields = ['module_news','module_quicklinks','module_files','module_organigramm']
+
+# NEW USER FORM
+class UserNewUserForm(forms.ModelForm):
+
+ class Meta:
+ model = User
+ fields = ["first_name", "last_name", "email"]
+
+# NEW USER PROFILE FORM
+class UserProfileForm(forms.ModelForm):
+
+ x = forms.FloatField(widget=forms.HiddenInput())
+ y = forms.FloatField(widget=forms.HiddenInput())
+ width = forms.FloatField(widget=forms.HiddenInput())
+ height = forms.FloatField(widget=forms.HiddenInput())
+ rotation = forms.FloatField(widget=forms.HiddenInput())
+
+ class Meta:
+ model = Profile
+ labels = {
+ "persnumber" : "Personalnummer",
+ "visible" : "Im Organigramm sichtbar",
+ "phonemobile" : "Mobilnummer",
+ "phoneland" : "Festnetznummer",
+ "image": "Profilbild",
+ "func" : "Agenturfunktion",
+ "compfunc" : "Tätigkeit"
+ }
+ widgets = {"parent" : forms.HiddenInput()}
+ fields = ["parent", "func", "compfunc", "visible", "phoneland", "phonemobile", "persnumber", "image" ]
+
+ def __init__(self, *args, **kwargs):
+ super().__init__(*args, **kwargs)
+ self.fields['func'].queryset = AgencyJob.objects.filter(agency__pk=self.instance.agency.pk)
+
+ def save(self):
+ photo = super(UserProfileForm, self).save()
+ try:
+ x = self.cleaned_data.get('x')
+ y = self.cleaned_data.get('y')
+ w = self.cleaned_data.get('width')
+ h = self.cleaned_data.get('height')
+ rotation = self.cleaned_data.get('rotation')
+ image = Image.open(photo.image)
+ rotatet_image = image.rotate(rotation, expand=True)
+ cropped_image = rotatet_image.crop((x, y, w+x, h+y))
+ resized_image = cropped_image.resize((300, 300), Image.ANTIALIAS)
+ resized_image.save(photo.image.path)
+ return photo
+ except:
+ print("no photo")
+
diff --git a/dasettings/migrations/__init__.py b/dasettings/migrations/__init__.py
new file mode 100644
index 0000000..e69de29
diff --git a/dasettings/migrations/__pycache__/__init__.cpython-38.pyc b/dasettings/migrations/__pycache__/__init__.cpython-38.pyc
new file mode 100644
index 0000000..06057d3
Binary files /dev/null and b/dasettings/migrations/__pycache__/__init__.cpython-38.pyc differ
diff --git a/dasettings/models.py b/dasettings/models.py
new file mode 100644
index 0000000..71a8362
--- /dev/null
+++ b/dasettings/models.py
@@ -0,0 +1,3 @@
+from django.db import models
+
+# Create your models here.
diff --git a/dasettings/templates/dasettings/agency_content.html b/dasettings/templates/dasettings/agency_content.html
new file mode 100644
index 0000000..81cd17c
--- /dev/null
+++ b/dasettings/templates/dasettings/agency_content.html
@@ -0,0 +1,340 @@
+{% load crispy_forms_tags %}
+{% load static %}
+{% load mathfilters %}
+{% load humanize %}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bereich bestimmen
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Agenturfunktionen bearbeiten
+
+
+
+
+
+ {% for ele in agencyjobs %}
+
+
+
+
+
+
+
+
+ {% endfor %}
+
+
+
Falsche Eingabe! Es wird nichts gespeichert.
+
Speichern pausiert...
+
Agenturfunktionen aktualisiert.
+
+
+
+
+
+
+
+
+
+
+
+
+
Agenturfunktion löschen
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dasettings/templates/dasettings/groups_content.html b/dasettings/templates/dasettings/groups_content.html
new file mode 100644
index 0000000..432cbec
--- /dev/null
+++ b/dasettings/templates/dasettings/groups_content.html
@@ -0,0 +1,476 @@
+{% load counter_tag %}
+
+
+
+
+
+
+
+
+
+{% for aggroup in agencygroups %}
+{% setvar 0 %}
+ {% for user in usersofagency %}
+ {% for group in user.groups.all %}
+ {% if group.name == aggroup.group.name %}
+ {% incvar %}
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+{% getvar as varcounter %}
+
+
+
+
+
+
+ {% if not aggroup.savefordel %}
+
+ {% endif %}
+ {% if aggroup.savefordel %}
+
+ {% endif %}
+
+
+
+
+
+
Gruppenrechte
+
+
+ {% for perm in perms %}
+ {% if forloop.counter|divisibleby:7 %}
+
+
+
+
+
+
+ {% else %}
+
+
+
+
+ {% endif %}
+ {% endfor %}
+
+
+
+
+
Mitarbeiter zur Gruppe {{aggroup.agencygroupname}} hinzufügen
+
+
+
+
+
+
+
+
+
+
Gruppenmitglieder in {{aggroup.agencygroupname}}
+ {% if varcounter > 0 %}
+ Diese Gruppe hat noch keine Mitglieder.
+ {% else %}
+ Diese Gruppe hat noch keine Mitglieder.
+ {% endif %}
+
+ {% for user in usersofagency %}
+ {% for group in user.groups.all %}
+ {% if group.name == aggroup.group.name %}
+ {% if request.user == user and aggroup.is_admin %}
+
+ {% else %}
+ {{ user.first_name }} {{ user.last_name }}
+
+ {% endif %}
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+
+
+
+
+
+
+{% endfor %}
+
+
+
+
+{% for aggroup in agencygroups %}
+ {% for p in aggroup.group.permissions.all %}
+ {% for perm in perms %}
+ {% if p.codename == perm.name %}
+
+ {% endif %}
+ {% endfor %}
+ {% endfor %}
+{% endfor %}
+
+
+
+
+
+
+
+
+
+
+
+
+
Falsche Eingabe! Keine Sonderzeichen!
+
+
+
+
+
+
+
+
+
+
+
+
Gruppe löschen
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/dasettings/templates/dasettings/moduls_content.html b/dasettings/templates/dasettings/moduls_content.html
new file mode 100644
index 0000000..4db9b03
--- /dev/null
+++ b/dasettings/templates/dasettings/moduls_content.html
@@ -0,0 +1,28 @@
+{% load crispy_forms_tags %}
+
+{% block javascript %}
+
+{% endblock %}
+
+
+{% endblock content %}
\ No newline at end of file
diff --git a/users/templates/users/users_adduser_DELETE.html b/users/templates/users/users_adduser_DELETE.html
new file mode 100644
index 0000000..e91c08e
--- /dev/null
+++ b/users/templates/users/users_adduser_DELETE.html
@@ -0,0 +1,24 @@
+{% extends "users/base.html" %}
+{% load crispy_forms_tags %}
+{% block content %}
+
+
Neuer Benutzer
+
+
+
+
+
+{% endblock content %}
\ No newline at end of file
diff --git a/users/templates/users/users_management_DELETE.html b/users/templates/users/users_management_DELETE.html
new file mode 100644
index 0000000..61af915
--- /dev/null
+++ b/users/templates/users/users_management_DELETE.html
@@ -0,0 +1,81 @@
+
+
+
+
+{% extends "users/base.html" %}
+{% block content %}
+
+
Benutzerverwaltung
+
+
+ Erstellen Sie weitere Mitarbeiter ihrer Agentur. Die neuen Benutzer erhalten eine E-Mail mit einem entsprechenden Link, um ihr Passwort zu generieren.
+