diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index 2d8dda0..c5b95d1 100644 Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ diff --git a/digitaleagentur/settings.py b/digitaleagentur/settings.py index f3ec7b5..2eb2a09 100644 --- a/digitaleagentur/settings.py +++ b/digitaleagentur/settings.py @@ -121,7 +121,7 @@ CKEDITOR_CONFIGS = { } # Database # https://docs.djangoproject.com/en/2.2/ref/settings/#databases - +''' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', @@ -131,6 +131,16 @@ DATABASES = { 'PORT' : 3306 } } +''' +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.mysql', + 'NAME' : 'digitaleagentur', + 'USER' : 'root', + 'PASSWORD' : '', + 'PORT' : 3306 + } +} # Password validation # https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators diff --git a/users/__pycache__/models.cpython-38.pyc b/users/__pycache__/models.cpython-38.pyc index 73738fe..f263358 100644 Binary files a/users/__pycache__/models.cpython-38.pyc and b/users/__pycache__/models.cpython-38.pyc differ diff --git a/users/__pycache__/urls.cpython-38.pyc b/users/__pycache__/urls.cpython-38.pyc index 59c0474..7a56251 100644 Binary files a/users/__pycache__/urls.cpython-38.pyc and b/users/__pycache__/urls.cpython-38.pyc differ diff --git a/users/__pycache__/usersforms.cpython-38.pyc b/users/__pycache__/usersforms.cpython-38.pyc index d4d0a11..f0a65f4 100644 Binary files a/users/__pycache__/usersforms.cpython-38.pyc and b/users/__pycache__/usersforms.cpython-38.pyc differ diff --git a/users/__pycache__/views.cpython-38.pyc b/users/__pycache__/views.cpython-38.pyc index 5928cbc..2855e95 100644 Binary files a/users/__pycache__/views.cpython-38.pyc and b/users/__pycache__/views.cpython-38.pyc differ diff --git a/users/models.py b/users/models.py index 41fe0d5..9a31a4c 100644 --- a/users/models.py +++ b/users/models.py @@ -23,6 +23,8 @@ def picturepath_user(instance, filename): # file will be uploaded to MEDIA_ROOT/agency_// return 'agency_{0}/agencystats/profilepics/{1}'.format(instance.pk, filename) + + ''' Class Agency @@ -47,8 +49,8 @@ class Agency(models.Model): return f'{self.name}' # Hier wird definiert, welche Parameter in der URL übertragen werden inkl. Bezeichner - def get_absolute_url(self): - return reverse('agency-update', kwargs={'pk':self.pk}) + #def get_absolute_url(self): + # return reverse('agency-update', kwargs={'pk':self.pk}) @property def get_photo_url(self): @@ -57,6 +59,17 @@ class Agency(models.Model): else: return "/media/agencymain/default.jpg" +''' + +Class AgencyJob + +''' +class AgencyJob(models.Model): + name = models.CharField(default="", max_length=80) + agency = models.ForeignKey(Agency, on_delete=models.PROTECT) + def __str__(self): + return f'{self.name}' + ''' Class Profile @@ -76,25 +89,15 @@ Klasse für die Zusatzinfos eines Nutzers. - Aufgaben ''' - - class Profile(models.Model): - # AGENCY TASKS - agency_task = [ - ("", ""), - ("lead", "Agenturleitung"), - ("external", "Außendienst"), - ("indoor", "Innendienst"), - ("trainee", "Azubi"), - ] - # Wenn der User gelöscht wird, wird auch das Profil gelöscht user = models.OneToOneField(User, on_delete=models.CASCADE) parent = models.ForeignKey(User, on_delete=models.PROTECT, blank=True, null=True, related_name='parent_user') phoneland = models.CharField(max_length=60, blank=True) phonemobile = models.CharField(max_length=60, blank=True) - func = models.CharField(choices=agency_task, default="", max_length=50) + # Wenn die Funktion gelöscht wird, wird die FUNC auf NULL gesetzt + func = models.ForeignKey(AgencyJob, blank=True, null=True, on_delete=models.SET_NULL) # Wenn dieses Profil gelöscht wird, wird NICHT die Agency geslöscht agency = models.ForeignKey(Agency, on_delete=models.PROTECT) image = models.ImageField(default='userprofilepics/default.jpg', upload_to=picturepath_user, blank=True) diff --git a/users/static/users/css/custom.css b/users/static/users/css/custom.css index f9fe106..e3f5710 100644 --- a/users/static/users/css/custom.css +++ b/users/static/users/css/custom.css @@ -52,7 +52,9 @@ html h1 { } body{ background-color: #f8f9fc; + padding-top: 70px; } +.modal-open {overflow-y: auto} .preview { overflow: hidden; @@ -65,10 +67,6 @@ body{ margin-bottom: 20px; } - body { - padding-top: 70px; - } - .default_content_style { margin-left: 212px !important; } diff --git a/users/templates/users/agency.html b/users/templates/users/agency.html deleted file mode 100644 index d2fb0e6..0000000 --- a/users/templates/users/agency.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "users/base.html" %} -{% block content %} -
-

Agentur {{ request.user.profile.agency.name }}

-
-
-
Inhaber
-

- {{ request.user.profile.agency.inhaber }} -

-
Adresse
-

- {{ request.user.profile.agency.street }} -

-

- {{ request.user.profile.agency.plz }} {{ request.user.profile.agency.city }} -

-
Kontaktdaten
-

- {{ request.user.profile.agency.agency_email }} -

-

- {{ request.user.profile.agency.phone }} -

-
Agenturbild
-

- -

-
-
-{% endblock content %} \ No newline at end of file diff --git a/users/templates/users/base.html b/users/templates/users/base.html index 41b683b..68906d7 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -56,7 +56,7 @@ - + @@ -102,18 +102,18 @@ Organigramm - + {% if active_link == 'quicklinks' %}