diff --git a/.gitignore b/.gitignore index 18dc8c8..8d54bba 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,8 @@ notificsys/migrations/* notificsys/__pycache__/* dasettings/migrations/* +!dasettings/migrations/__init__.py +dasettings/__pycache__/* news/migrations/* !news/migrations/__init__.py diff --git a/cloud/views.py b/cloud/views.py index d470658..0195ac2 100644 --- a/cloud/views.py +++ b/cloud/views.py @@ -11,7 +11,6 @@ from django.conf import settings from django.core.files.storage import default_storage from digitaleagentur.settings import BASE_DIR from django.http import JsonResponse -import os from .models import DataDir, DataFile from datetime import datetime from users.models import AgencyGroup @@ -247,8 +246,8 @@ def adddirbyajax(request, parent): datadir_parentid = list(DataDir.objects.filter(is_defaultstandard=True, agency__pk=request.user.profile.agency.pk))[0] else: datadir_parentid = tempdir - - tempdatafile = DataFile(file=request.FILES['uploadedfile'], name=request.FILES['uploadedfile'].name, owner=request.user, parent=datadir_parentid, agency=request.user.profile.agency) + + tempdatafile = DataFile(file=request.FILES['uploadedfile'], name=str(request.FILES['uploadedfile'].name), owner=request.user, parent=datadir_parentid, agency=request.user.profile.agency) tempdatafile.save() data = {'savedobj_id' : tempdatafile.pk, 'savedobj_name' : tempdatafile.name} else: diff --git a/dasettings/forms.py b/dasettings/forms.py index eb9c025..39f563f 100644 --- a/dasettings/forms.py +++ b/dasettings/forms.py @@ -1,9 +1,21 @@ 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 users.models import AgencyGroup, Agency, Profile, AgencyJob, AgencyNetwork from PIL import Image + +class AgencyNetworkForm(forms.ModelForm): + class Meta: + model = AgencyNetwork + fields = ['name', 'publicjoin'] + + labels = { + "name" : "Name des Agentuverbunds", + "publicjoin" : "Beitritt ohne Bestätigung" + } + + # Change logged Users Data (Usernamen an Email) NUR HIER MÖGLICH! class UsersSelfChangeForm(forms.ModelForm): email = forms.EmailField() diff --git a/dasettings/templates/dasettings/addagencynetwork_content.html b/dasettings/templates/dasettings/addagencynetwork_content.html new file mode 100644 index 0000000..30b032b --- /dev/null +++ b/dasettings/templates/dasettings/addagencynetwork_content.html @@ -0,0 +1,24 @@ +{% extends "users/base.html" %} +{% load crispy_forms_tags %} +{% block content %} +
+

Agenturverbund

+
+

Informationen zum Agenturverbund

+

+ Ein Agenturverbund schließt mehrere Agenturen zusammen. Dabei legen Sie als Ersteller fest, wie der Verbund heißt und wie andere Agenturen beitreten können. Nachdem der Verbund angelegt ist, erhalten Sie einen Link. Mit diesem Link können andere Agenturen beitreten, in dem sie auf den Link klicken. Anschließend erhalten Sie eine Informationen, welche Agenturen beitreten wollen und können diese dann aufnehmen. +

+

+ Wollen Sie einen öffentlichen Verbund, in der jede Agentur ohne Ihre Bestätigung beitreten kann, aktivieren Sie die Checkbox "Beitritt ohne Bestätigung". Standardmäßig können diese Agenturen nur Standards übernehmen, aber nicht eigene in den Verbund teilen. In unserem Wiki erhalten Sie dazu weitere Informationen. +

+
+
+ {% csrf_token %} + {{ form|crispy }} +
+ Abbrechen + +
+
+ +{% endblock content %} \ No newline at end of file diff --git a/dasettings/templates/dasettings/agencynetwork_agmanagement_content.html b/dasettings/templates/dasettings/agencynetwork_agmanagement_content.html new file mode 100644 index 0000000..1dac772 --- /dev/null +++ b/dasettings/templates/dasettings/agencynetwork_agmanagement_content.html @@ -0,0 +1,93 @@ +{% extends "users/base.html" %} +{% load crispy_forms_tags %} +{% load counter_tag %} +{% load static %} +{% block content %} +
+

Agenturen in Verbund {{agn.name}}

+{% if outstanding|length > 0 %} +
+
Ausstehende Einladungen
+ +
+ + + + + + + + + {% for agn_s in outstanding %} + + + + + {% endfor %} + +
Agenturname 
{{agn_s.wanted_agency.name}} + Annehmen Ablehnen +
+
+{% endif %} + + +
+
Agenturen im Verbund
+
+ + + + + + + + + + + + {% for agn_s in allagofagn %} + + + + + + + + {% endfor %} + +
AgenturnameNur MitgliedInhalte teilenAdministratives Mitglied 
{{agn_s.name}} + +
+
+
+ + + + + +{% endblock content %} \ No newline at end of file diff --git a/dasettings/templates/dasettings/agencynetwork_content.html b/dasettings/templates/dasettings/agencynetwork_content.html new file mode 100644 index 0000000..ee76080 --- /dev/null +++ b/dasettings/templates/dasettings/agencynetwork_content.html @@ -0,0 +1,111 @@ +{% load crispy_forms_tags %} +{% load counter_tag %} +{% load static %} + Agenturverbund erstellen +
+ + + +

Ihre Agenturverbünde

+
+ + + + + + + + + + + + + + + + {% for agn in agencynetworks %} + {% getsumofallag agn.pk as agsum %} + {% getsumofallstandards agn.pk as ag_standardsum %} + {% getoutstandinginvites agn.pk as outstanding %} + {% ifaginadminagn agn.pk request.user.profile.agency.pk as is_adminag %} + + + + + + + + + + + + {% endfor %} + +
NameLink{% if request.user.profile.showtooltips %} {% endif %}ErstelleragenturErstellt durchErstellt amLetzte Aktivität amAgenturenStandards 
{{agn.name}} + {% if is_adminag %} + +     + + {% endif %} + {{agn.creator_agency.name }}{{agn.creator.first_name }} {{agn.creator.last_name }}{{agn.created_on }}{{agn.last_activity}}{% if is_adminag %}   {% endif %} {% if outstanding %} {% endif %}  {{agsum}}{% if is_adminag %}{% endif %}{{ag_standardsum}} + {% if is_adminag %} + + + {% endif %} +
+
+ + + + + + + \ No newline at end of file diff --git a/dasettings/templates/dasettings/delagencynetwork_content.html b/dasettings/templates/dasettings/delagencynetwork_content.html new file mode 100644 index 0000000..fc48e7d --- /dev/null +++ b/dasettings/templates/dasettings/delagencynetwork_content.html @@ -0,0 +1,16 @@ +{% extends "users/base.html" %} +{% load crispy_forms_tags %} +{% block content %} +
+

Agenturverbund löschen

+
+ Achtung! Wenn Sie den Agenturverbund löschen, können die Agenturen innerhalb des Verbunds keine Informationen mehr austauschen. +
+ {% csrf_token %} +
+   + Abbrechen +
+
+
+{% endblock content %} \ No newline at end of file diff --git a/dasettings/templates/dasettings/groups_content.html b/dasettings/templates/dasettings/groups_content.html index 09ea0c1..81e47cd 100644 --- a/dasettings/templates/dasettings/groups_content.html +++ b/dasettings/templates/dasettings/groups_content.html @@ -447,7 +447,7 @@ function validateGroupName(groupname){ diff --git a/dasettings/templates/dasettings/joinagn_first.html b/dasettings/templates/dasettings/joinagn_first.html new file mode 100644 index 0000000..0d2e5ef --- /dev/null +++ b/dasettings/templates/dasettings/joinagn_first.html @@ -0,0 +1,34 @@ +{% extends "users/base.html" %} +{% load crispy_forms_tags %} +{% load counter_tag %} +{% block content %} +
+

Agenturverbund {{agn.name}} beitreten

+
+

Verbundinfos

+ {% getsumofallag agn.pk as agsum %} + {% getsumofallstandards agn.pk as ag_standardsum %} + +
+
+
Gründeragentur {{agn.creator_agency.name }}
+
Gegründet von {{agn.creator.first_name }} {{agn.creator.last_name }}
+
Grüdungsdatum {{agn.created_on }}
+
Agenturen {{agsum}}
+
Standards {{ag_standardsum}}
+
Letzte Aktivität {{agn.last_activity}}
+
+
+ {% if agn.publicjoin %} + Das Beitreten zu diesem Verbund ist öffentlich. Sie können daher sofort nach Beitritt die geteilten Informationen einsehen, aber selber keine Informationen in den Verbund teilen. + {% endif %} +
+ Möchten Sie diesem Verbund beitreten? +
+
+ Abbrechen + Verbund beitreten +
+ +
+{% endblock content %} diff --git a/dasettings/templates/dasettings/settings.html b/dasettings/templates/dasettings/settings.html index 730e685..84abc21 100644 --- a/dasettings/templates/dasettings/settings.html +++ b/dasettings/templates/dasettings/settings.html @@ -47,12 +47,17 @@ - {% endif %} + {% endif %} {% if user|usergperm:"agencyinfo" %} {% endif %} + {% if user|usergperm:"agencynetwork" %} + + {% endif %} {% if user|usergperm:"structuremanager" %}