From d422d4c5b992df48fcd5b7a9d40de9a614c29fc6 Mon Sep 17 00:00:00 2001 From: "holger.trampe" Date: Sun, 23 Feb 2020 11:23:58 +0100 Subject: [PATCH] =?UTF-8?q?Bugliste=20von=20Darius=20abgearbeitet,=20au?= =?UTF-8?q?=C3=9Fer=20Bug=20Profilbild=20(neu-Erstellung)=20und=20Agentur-?= =?UTF-8?q?Default-Bild?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 ++++++ cloud/templates/cloud/cloud_main.html | 7 ++----- dasettings/__pycache__/views.cpython-38.pyc | Bin 13020 -> 13040 bytes .../templates/dasettings/agency_content.html | 11 +---------- .../templates/dasettings/calc_content.html | 7 +++++++ .../templates/dasettings/groups_content.html | 11 +++++------ .../templates/dasettings/profil_content.html | 7 ++++--- dasettings/templates/dasettings/settings.html | 14 ++++++++++++++ dasettings/views.py | 6 +++--- media/userprofilepics/default.jpg | Bin 1871 -> 5787 bytes standards/__pycache__/views.cpython-38.pyc | Bin 9535 -> 9523 bytes standards/views.py | 2 +- users/models.py | 4 ++-- users/signals.py | 1 + users/templates/users/base.html | 4 +++- users/templates/users/searchres.html | 14 ++++++++++++-- users/usersforms.py | 2 +- users/views.py | 12 +++++++++--- 18 files changed, 71 insertions(+), 37 deletions(-) create mode 100644 dasettings/templates/dasettings/calc_content.html 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 d47174033f6204d606cd8403cfcffac4d5a0e111..86489159e6f591b8af41b3fc11ecc9e7b2a08c6f 100644 GIT binary patch literal 5787 zcmeHLc|2788lSN@wic6JwhANJrtFa|6pfiNXcSs##B29PN>pkH$qN4>un#FYk&Kd>{c4K>>b#0rAyqghiw!*2zdqNJ+^ms%?~&S5=Ub zQrfDls;;4}t-WreuAz>mftr@K=1et!pN~VGLmdcQ1(>M?teXwa4V*gwz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diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index dfc7d31fc19888a94fb3be7b3006465ddd928f13..6ba1f57153239f1bd86ad3e17e34e3100490b062 100644 GIT binary patch delta 46 ycmdn*wb_d|l$V!_0SIRL1jQL_$ delta 58 zcmdn&wcm?3l$V!_0SNAg`^0H& {% 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")