diff --git a/dasettings/__pycache__/views.cpython-38.pyc b/dasettings/__pycache__/views.cpython-38.pyc index 4c316c7..d8f0f4b 100644 Binary files a/dasettings/__pycache__/views.cpython-38.pyc and b/dasettings/__pycache__/views.cpython-38.pyc differ diff --git a/dasettings/views.py b/dasettings/views.py index b9bcb4a..6e22252 100644 --- a/dasettings/views.py +++ b/dasettings/views.py @@ -383,11 +383,9 @@ def SettingsAjaxRouter(request): # GET POSSIBLE TO ADD USERS k = 0 possible_users = User.objects.filter(profile__agency__pk=request.user.profile.agency.pk).exclude(pk__in=added_users) - print(possible_users) for us in possible_users: posus.update({ k : {"fullname" : us.first_name + " " + us.last_name, "userid" : us.pk}}) k += 1 - print(posus) data = {"taskname" : task.name, "visible" : task.visible, "added_users" : addus, "addedl" : i, "possl" : k, "possible_users" : posus, "taskarea" : task.area.pk} success = True # REMOVE Task diff --git a/standards/__pycache__/forms.cpython-38.pyc b/standards/__pycache__/forms.cpython-38.pyc index c7250da..92df15c 100644 Binary files a/standards/__pycache__/forms.cpython-38.pyc and b/standards/__pycache__/forms.cpython-38.pyc differ diff --git a/standards/__pycache__/models.cpython-38.pyc b/standards/__pycache__/models.cpython-38.pyc index df81997..4a1625b 100644 Binary files a/standards/__pycache__/models.cpython-38.pyc and b/standards/__pycache__/models.cpython-38.pyc differ diff --git a/standards/__pycache__/views.cpython-38.pyc b/standards/__pycache__/views.cpython-38.pyc index f9b4a9d..5c9e239 100644 Binary files a/standards/__pycache__/views.cpython-38.pyc and b/standards/__pycache__/views.cpython-38.pyc differ diff --git a/standards/forms.py b/standards/forms.py index 3723e2f..081e45e 100644 --- a/standards/forms.py +++ b/standards/forms.py @@ -22,11 +22,10 @@ class StandardAddStandard(forms.ModelForm): "task" : "Tätigkeitsbereich", "content": "Inhalt", "public" : "Direkt veröffentlichen?", - "representative" : "Vertreter", - "executor" : "Ausführender", - "authority" : "Verantwortlicher", + "freefield_title" : "Freifeld Titel", + "freefield_content" : "Freifeld Inhalt", } - fields = ['name', 'area', 'task', 'content', 'public', "authority", "executor", "representative"] + fields = ['name', 'area', 'task', 'content', 'public',"freefield_title", "freefield_content"] ''' @@ -51,14 +50,22 @@ class StandardAddStandard(forms.ModelForm): elif self.instance.pk: self.fields['task'].queryset = Tasks.objects.none() - self.fields['representative'].queryset = UserFullName.objects.filter(profile__agency__pk=kwargs['instance'].profile.agency.pk) - self.fields['executor'].queryset = UserFullName.objects.filter(profile__agency__pk=kwargs['instance'].profile.agency.pk) - self.fields['authority'].queryset = UserFullName.objects.filter(profile__agency__pk=kwargs['instance'].profile.agency.pk) + self.fields['freefield_title'].required = False + self.fields['freefield_content'].required = False + self.fields['freefield_content'].widget.attrs['rows'] = 2 + + #self.fields['representative'].queryset = UserFullName.objects.filter(profile__agency__pk=kwargs['instance'].profile.agency.pk) + #self.fields['executor'].queryset = UserFullName.objects.filter(profile__agency__pk=kwargs['instance'].profile.agency.pk) + #self.fields['authority'].queryset = UserFullName.objects.filter(profile__agency__pk=kwargs['instance'].profile.agency.pk) self.fields['checked_groups'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput()) self.fields['added_files'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput()) self.fields['added_standards'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput()) + self.fields['us_verant'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput()) + self.fields['us_ex'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput()) + self.fields['us_ver'] = forms.CharField(initial="", required=False, widget=forms.HiddenInput()) + class StandardAddStandardEditor(forms.ModelForm): @@ -84,11 +91,10 @@ class StandardUpdateStandard(forms.ModelForm): "area" : "Übergeordneter Bereich", "task" : "Tätigkeitsbereich", "content": "Inhalt", - "representative" : "Vertreter", - "executor" : "Ausführender", - "authority" : "Verantwortlicher", + "freefield_title" : "Freifeld Titel", + "freefield_content" : "Freifeld Inhalt", } - fields = ['name', 'area', 'task', 'content', "authority", "executor", "representative"] + fields = ['name', 'area', 'task', 'content',"freefield_title", "freefield_content"] ''' Hier werden die Elemente für die DropDowns erstellt, damit @@ -115,9 +121,13 @@ class StandardUpdateStandard(forms.ModelForm): elif loggeduser.pk: self.fields['task'].queryset = Tasks.objects.filter(area__pk=standard.area.pk) - self.fields['representative'].queryset = UserFullName.objects.filter(profile__agency__pk=loggeduser.profile.agency.pk) - self.fields['executor'].queryset = UserFullName.objects.filter(profile__agency__pk=loggeduser.profile.agency.pk) - self.fields['authority'].queryset = UserFullName.objects.filter(profile__agency__pk=loggeduser.profile.agency.pk) + + self.fields['freefield_title'].required = False + self.fields['freefield_content'].required = False + self.fields['freefield_content'].widget.attrs['rows'] = 2 + #self.fields['representative'].queryset = UserFullName.objects.filter(profile__agency__pk=loggeduser.profile.agency.pk) + #self.fields['executor'].queryset = UserFullName.objects.filter(profile__agency__pk=loggeduser.profile.agency.pk) + #self.fields['authority'].queryset = UserFullName.objects.filter(profile__agency__pk=loggeduser.profile.agency.pk) class StandardUpdateStandardEditor(forms.ModelForm): diff --git a/standards/models.py b/standards/models.py index c44af06..11b975d 100644 --- a/standards/models.py +++ b/standards/models.py @@ -29,6 +29,9 @@ class Standards(models.Model): public = models.BooleanField(default=False) + freefield_title = models.CharField(max_length=200, blank=False, default="") + freefield_content = models.TextField(max_length=500, blank=False, default="") + # USER # VERTRETER diff --git a/standards/templates/standards/standards_add.html b/standards/templates/standards/standards_add.html index 1f3a6b3..dd4ec34 100644 --- a/standards/templates/standards/standards_add.html +++ b/standards/templates/standards/standards_add.html @@ -9,17 +9,26 @@ {% csrf_token %}
{% for field in normalForm %} + {% if field.is_hidden == False %} {% if forloop.counter|divisibleby:6 %}
{{field|as_crispy_field }} {% else %} {{field|as_crispy_field }} {% endif %} + {% endif %} {% endfor %} + + {% for field in normalForm %} + {% if field.is_hidden %} + {{field}} + {% endif %} + {% endfor %} + - + -
+
@@ -105,23 +114,6 @@
-
@@ -172,10 +164,202 @@ + + + +