diff --git a/.gitignore b/.gitignore index 80ef707..86d22a8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ media/agencymain/* !media/agencymain/default.jpg !media/agencymain/linkdefault.png +digitaleagentur/__pycache__/* + media/userprofilepics/* !media/userprofilepics/default.jpg media/uploadsCK/* @@ -40,5 +42,9 @@ notificsys/migrations/* !notificsys/migrations/__init__.py notificsys/__pycache__/* +dasettings/migrations/* +!dasettings/migrations/__init__.py +dasettings/__pycache__/* + orga/__pycache__/* diff --git a/cloud/templates/cloud/cloud_main.html b/cloud/templates/cloud/cloud_main.html index 7dd6315..0ee8057 100644 --- a/cloud/templates/cloud/cloud_main.html +++ b/cloud/templates/cloud/cloud_main.html @@ -3,9 +3,6 @@ {% load counter_tag %} {% load static %} {% block content %} - - - -
- +
+
{% endif %} -
-
Abrechnung
-

Kontostand: {{request.user.profile.agency.balance|floatformat:0}} €

-

Nächste Abbuchung am {{request.user.profile.agency.nextdebiting|date:"d.m.Y"}}

-

Max. Nutzungszeit:  {{request.user.profile.agency.balance|div:30|floatformat:0}} Monate

-

IBAN: DE4412345678912345

-

Laden Sie das Konto mit einem beliebigen Geldbetrag auf. Die Kosten belaufen sich auf 40 € pro Monat.

-
+
diff --git a/dasettings/templates/dasettings/calc_content.html b/dasettings/templates/dasettings/calc_content.html new file mode 100644 index 0000000..c251475 --- /dev/null +++ b/dasettings/templates/dasettings/calc_content.html @@ -0,0 +1,7 @@ +{% load mathfilters %} +{% load humanize %} +

Kontostand: {{request.user.profile.agency.balance|floatformat:0}} €

+

Nächste Abbuchung am {{request.user.profile.agency.nextdebiting|date:"d.m.Y"}}

+

Max. Nutzungszeit:  {{request.user.profile.agency.balance|div:30|floatformat:0}} Monate

+

IBAN: DE4412345678912345

+

Laden Sie das Konto mit einem beliebigen Geldbetrag auf. Die Kosten belaufen sich auf 30 € pro Monat zzgl. gebuchter Module.

diff --git a/dasettings/templates/dasettings/groups_content.html b/dasettings/templates/dasettings/groups_content.html index 432cbec..a9e3dc0 100644 --- a/dasettings/templates/dasettings/groups_content.html +++ b/dasettings/templates/dasettings/groups_content.html @@ -3,8 +3,6 @@ - -
@@ -24,14 +22,15 @@     + + {% if not aggroup.savefordel %} + {% endif %} + {% if not aggroup.savefordel %} {% endif %} - {% if aggroup.savefordel %} - - {% endif %} +
diff --git a/dasettings/templates/dasettings/profil_content.html b/dasettings/templates/dasettings/profil_content.html index 855b187..7a6e04d 100644 --- a/dasettings/templates/dasettings/profil_content.html +++ b/dasettings/templates/dasettings/profil_content.html @@ -87,7 +87,8 @@ type: "GET", url: "/dasettings/ajax", data:{ - action : "change_showtooltips" + action : "change_showtooltips", + newtoolvalue : $("#showtooltips").prop("checked") }, success: function( data ) { @@ -97,10 +98,10 @@ $("#toast_savecontent").html("Tooltipseinstellung erfolgreich gespeichert!"); if(data['data']['newttvalue']){ - $('*').tooltip("enable"); + $('*').tooltip("enable"); } else{ - $('*').tooltip("disable"); + $('*').tooltip("disable"); } } else{ diff --git a/dasettings/templates/dasettings/settings.html b/dasettings/templates/dasettings/settings.html index ecdd3dc..441ebdb 100644 --- a/dasettings/templates/dasettings/settings.html +++ b/dasettings/templates/dasettings/settings.html @@ -48,6 +48,11 @@ Agentur {% endif %} + {% if user|usergperm:"agencyinfo" %} + + {% endif %} {% if user|usergperm:"structuremanager" %}
+ {% endif %} + {% if user|usergperm:"agencyinfo" %} +
+
Abrechnung 
+
+ {% block calc_content %} + {% include "dasettings/calc_content.html" %} + {% endblock %} +
{% endif %} {% if user|usergperm:"structuremanager" %}
diff --git a/dasettings/views.py b/dasettings/views.py index ab270f9..02ffe3f 100644 --- a/dasettings/views.py +++ b/dasettings/views.py @@ -226,11 +226,11 @@ def SettingsAjaxRouter(request): elif request.method == 'GET' and request.GET['action'] == "change_showtooltips" : newtooltipvalue = False user = User.objects.get(pk=request.user.pk, profile__agency=request.user.profile.agency) - if user.profile.showtooltips: - user.profile.showtooltips = False - else: + if(request.GET['newtoolvalue'] == "true"): user.profile.showtooltips = True newtooltipvalue = True + else: + user.profile.showtooltips = False user.save() success = True data = {'newttvalue' : newtooltipvalue} diff --git a/media/userprofilepics/default.jpg b/media/userprofilepics/default.jpg index d471740..8648915 100644 Binary files a/media/userprofilepics/default.jpg and b/media/userprofilepics/default.jpg differ diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index dfc7d31..6ba1f57 100644 Binary files a/standards/__pycache__/views.cpython-38.pyc and b/standards/__pycache__/views.cpython-38.pyc differ diff --git a/standards/views.py b/standards/views.py index 620bc6f..cc92fa5 100644 --- a/standards/views.py +++ b/standards/views.py @@ -345,7 +345,7 @@ def updatesbyajax(request, pk): success = True workingstandard = Standards.objects.get(pk=pk, agency=request.user.profile.agency) # Check for correct user and userrights - if(request.user.profile.agency == workingstandard.agency and request.user.has_perm("standardmanager")): + if(request.user.profile.agency == workingstandard.agency and request.user.has_perm("users.standardmanager")): # CHANGE GROUP # ADD if(request.GET["action"] == "s_addgroup"): diff --git a/users/models.py b/users/models.py index 62723cf..d795a8e 100644 --- a/users/models.py +++ b/users/models.py @@ -1,10 +1,10 @@ from django.db import models -from django.contrib.auth.models import User, AbstractUser +from django.contrib.auth.models import User from django.conf import settings from PIL import Image from django.utils import timezone # MAKE EMAIL UNIQUE -from django.contrib.auth.models import AbstractUser, User, Group, Permission +from django.contrib.auth.models import User, Group, Permission from django.contrib.contenttypes.models import ContentType diff --git a/users/signals.py b/users/signals.py index fdd42ca..1c34c1c 100644 --- a/users/signals.py +++ b/users/signals.py @@ -10,6 +10,7 @@ from django.template.loader import render_to_string from tasks.models import Tasks from cloud.models import DataFile import os + # Deletes all Notifications added to to delete news @receiver(pre_delete, sender=News) def del_news_notifications(sender, instance, **kwargs): diff --git a/users/templates/users/base.html b/users/templates/users/base.html index daa47b6..ea102cd 100644 --- a/users/templates/users/base.html +++ b/users/templates/users/base.html @@ -36,7 +36,9 @@ {% endif %} - + + + diff --git a/users/templates/users/searchres.html b/users/templates/users/searchres.html index 5b4479f..565655e 100644 --- a/users/templates/users/searchres.html +++ b/users/templates/users/searchres.html @@ -20,13 +20,23 @@ {% endif %}
-

Aufgaben

+

Tätigkeiten

{% if res_tasks|length > 0 %} {% for s in res_tasks %}   {{s.name|striptags}}

{% endfor %} {% else %} -

Keine Ergebnisse in Aufgaben

+

Keine Ergebnisse in Tätigkeiten

+ {% endif %} + +
+

News

+ {% if res_news|length > 0 %} + {% for s in res_news %} +   {{s.name}}

+ {% endfor %} + {% else %} +

Keine Ergebnisse in News

{% endif %}
diff --git a/users/usersforms.py b/users/usersforms.py index 485cd47..bccad41 100644 --- a/users/usersforms.py +++ b/users/usersforms.py @@ -149,7 +149,7 @@ class SupportForm(forms.Form): def __init__(self, user, *args, **kwargs): super().__init__(*args, **kwargs) user_name = user.first_name + " " + user.last_name - self.fields['name'] = forms.CharField(required=True, label="Ihr Name", initial=user_name) + self.fields['name'] = forms.CharField(required=True, label="Name", initial=user_name) self.fields['mail'] = forms.EmailField(required=True, label="E-Mail", initial=user.email) self.fields['problemconc'] = forms.CharField(required=True, label="Problemzusammenfassung") self.fields['problem'] = forms.CharField(required=True, widget=forms.Textarea, label="Ausführliche Beschreibung") diff --git a/users/views.py b/users/views.py index 252c44a..1912637 100644 --- a/users/views.py +++ b/users/views.py @@ -68,7 +68,7 @@ def toUpdate(request): # VERWALTUNG temgroup_verwaltung = Group(name=str(request.user.profile.agency.pk) + "_" + randomString(8)) temgroup_verwaltung.save() - temgroup_verwaltung_ag = AgencyGroup(savefordel=True, is_admin=True, group=temgroup_verwaltung, agency=request.user.profile.agency, agencygroupname="Verwaltung") + temgroup_verwaltung_ag = AgencyGroup(savefordel=True, is_admin=True, group=temgroup_verwaltung, agency=request.user.profile.agency, agencygroupname="Administratoren") temgroup_verwaltung_ag.save() print("default groups created...adding users...") users_of_agency = User.objects.filter(profile__agency__pk=request.user.profile.agency.pk) @@ -273,7 +273,7 @@ class UsersPermUpdateView(LoginRequiredMixin, View): user_tochange.user_permissions.add(tempperm) else: # Eingeloggter User darf sich nicht selbst die Userverwaltungsrechte entziehen - if user_tochange == request.user and ele[0]=='users_usermanagement': + if user_tochange == request.user and ele[0]=='usermanager': messages.warning(request, f'Benutzerverwaltungsrechte für {user_tochange.first_name} {user_tochange.last_name} kann nicht entfernt werden.') else: user_tochange.user_permissions.remove(tempperm) @@ -475,11 +475,17 @@ def GlobalSearch(request): searchfor = request.GET['searchstring'] ag = request.user.profile.agency.pk res_standard = Standards.objects.filter(agency__pk=ag, public=True).filter(name__icontains=searchfor) | Standards.objects.filter(agency__pk=ag, public=True).filter(content__icontains=searchfor) | Standards.objects.filter(agency__pk=ag, public=True).filter(area__name__icontains=searchfor) | Standards.objects.filter(agency__pk=ag, public=True).filter(task__name__icontains=searchfor) | Standards.objects.filter(agency__pk=ag, public=True).filter(created_standard_by__last_name__icontains=searchfor)|Standards.objects.filter(agency__pk=ag, public=True).filter(created_standard_by__first_name__icontains=searchfor) + + res_news = News.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) | News.objects.filter(agency__pk=ag).filter(content__icontains=searchfor) | News.objects.filter(agency__pk=ag).filter(created_by__last_name__icontains=searchfor)|News.objects.filter(agency__pk=ag).filter(created_by__first_name__icontains=searchfor) + + + res_areas = Areas.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) res_tasks = Tasks.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) |Tasks.objects.filter(agency__pk=ag).filter(area__name__icontains=searchfor) res_pers = User.objects.filter(profile__agency__pk=ag).filter(first_name__icontains=searchfor) | User.objects.filter(profile__agency__pk=ag).filter(last_name__icontains=searchfor) links = QuickLinks.objects.filter(agency__pk=ag).filter(name__icontains=searchfor) | QuickLinks.objects.filter(agency__pk=ag).filter(link__icontains=searchfor) - html = render_to_string('users/searchres.html', {'links': links, 'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers}) + + html = render_to_string('users/searchres.html', {'links': links, 'res_standard': res_standard, 'res_areas': res_areas, 'res_tasks': res_tasks, 'res_pers': res_pers, 'res_news' : res_news}) return HttpResponse(html) else: return HttpResponse("Request method is not a GET")