diff --git a/standards/models.py b/standards/models.py index e0cb86f..bcc46eb 100644 --- a/standards/models.py +++ b/standards/models.py @@ -65,6 +65,8 @@ class Standards(models.Model): # FIELD FOR AGENCYNETWORK comments = models.ManyToManyField("StandardComments", blank=True, related_name='comments') parent_standard = models.ForeignKey("Standards", related_name='partentedstandard', on_delete=models.PROTECT, blank=True, null=True, default=None) + shared_on = models.DateTimeField(default=timezone.now, blank=True) + #Counter, wie oft dieser Standard in eine andere Agentur kopiert wird diff --git a/standards/templates/standards/agencynetwork_content.html b/standards/templates/standards/agencynetwork_content.html index c7e3a6d..bf42b3b 100644 --- a/standards/templates/standards/agencynetwork_content.html +++ b/standards/templates/standards/agencynetwork_content.html @@ -1,9 +1,42 @@ + {% load counter_tag %}

- + + +

+ + + + + + + + + + + + {% for agn in agencynetworks %} + {% getsumofallag agn.pk as agsum %} + {% getoutstandinginvites agn.pk as outstanding %} + {% ifaginadminagn agn.pk request.user.profile.agency.pk as is_adminag %} + + + + + + + + + {% endfor %} + +
NameErstelleragenturLetzte Aktivität amAgenturenStandards
{{agn.name}}{{agn.creator_agency.name }}{{agn.lastactivity}}{{agsum}}{{agn.standards.all|length}}
+
+ + +

@@ -28,194 +61,39 @@
+ \ No newline at end of file diff --git a/standards/templates/standards/agencynetwork_content.html_SAVE.html b/standards/templates/standards/agencynetwork_content.html_SAVE.html new file mode 100644 index 0000000..c7e3a6d --- /dev/null +++ b/standards/templates/standards/agencynetwork_content.html_SAVE.html @@ -0,0 +1,221 @@ +
+
+
+
+

+ +

+
+
+
+ + +
+
+
Beliebte Standards
+

+ Keine +

+
+
+
+
+ \ No newline at end of file diff --git a/standards/templates/standards/standards_from_agn.html b/standards/templates/standards/standards_from_agn.html new file mode 100644 index 0000000..c85e069 --- /dev/null +++ b/standards/templates/standards/standards_from_agn.html @@ -0,0 +1,86 @@ +{% extends "users/base.html" %} +{% load counter_tag %} + +{% block content %} + +
+

Standards aus Agenturverbund {{agn.name}}

+ Sie sehen nur veröffentlichte Standards innerhalb des Verbunds und Standards, die nicht von Ihrer Agentur geteilt sind. +
+ + +

+ +
+ + + + + + + + + + + {% for standard in standards_of_agency_network %} + {% if standard.public and standard.agency != request.user.profile.agency %} + + + + + + + {% endif %} + {% endfor %} + +
TitelAgenturZuletzt geändert amGeteilt
{{standard.name}}{{standard.agency.name}}{{standard.last_modified_on|date:"d.m.Y, H:i"}}{{standard.agencynetworkcounter}}
+ + +
+
+ + + + + +{% endblock content %} \ No newline at end of file diff --git a/standards/templates/standards/standards_single_agn.html b/standards/templates/standards/standards_single_agn.html new file mode 100644 index 0000000..1fb52e7 --- /dev/null +++ b/standards/templates/standards/standards_single_agn.html @@ -0,0 +1,64 @@ +{% extends "users/base.html" %} +{% load counter_tag %} +{% block content %} +
+

{{standard.name}}

+ +
+
+ {% if standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.authority.count > 0 or standard.executor.count > 0 or standard.representative.count > 0 or standard.addedfiles.all|length > 0 or standard.linked_standards.all|length > 0 or standard.freefield_title|length > 0 %} +
+ {% else %} +
+ {% endif %} +
+
+

+ {{standard.media}} + {{standard.content|safe}} +

+
+
+ +
+ + + {% if standard.freefield_title|length > 0 %} +
+
+
{{standard.freefield_title}}
+

+ {{standard.freefield_content}} +

+
+
+ {% endif %} + + + + + + + + {% if standard.addedfiles.all|length > 0 %} +
+
+
Dateien
+

+ {% for files in standard.addedfiles.all %} + {{files.name|truncatechars:30}} + {% endfor %} +

+
+
+ {% endif %} + +
+
+
+ + Erstellt in Agentur {{standard.agency.name}} und zuletzt bearbeitet am {{ standard.last_modified_on}}. Der Standard wurde bereits {{standard.agencynetworkcounter}} geteilt. + +
+
+{% endblock content %} \ No newline at end of file diff --git a/standards/urls.py b/standards/urls.py index 013d97c..59ccdae 100644 --- a/standards/urls.py +++ b/standards/urls.py @@ -16,6 +16,8 @@ urlpatterns = [ path('standards//delete', StandardDeleteView.as_view(), name='standard-delete'), path('standard//changestat', views.StandardChangePublic, name="standard-status"), path('standard//single', views.StandardSingle, name="standard-single"), + path('standard//singleagn', views.StandardSingleAgn, name="standard-single-agn"), path('standard//area', views.StandardArea, name="standard-area"), - path('standard//task', views.StandardTask, name="standard-task") + path('standard//task', views.StandardTask, name="standard-task"), + path('standardsagn/', views.StandardFromAgn, name="standard-agn"), ] \ No newline at end of file diff --git a/standards/views.py b/standards/views.py index 3055108..d637038 100644 --- a/standards/views.py +++ b/standards/views.py @@ -44,6 +44,7 @@ class StandardsManagement(LoginRequiredMixin, ListView): + context.update({'active_link' : 'standards', 'unpubstandards_of_user' : unpubstandards_of_user, 'areas' : areas, 'standards_of_user' : standards_of_user, 'standardcontent' : standardcontent, "agencynetworks" : agencynetworks}) return context @@ -373,6 +374,15 @@ def StandardSingle(request, pk): } return render(request, 'standards/standards_noentrie.html', context) +@login_required +def StandardSingleAgn(request, pk): + + context = { + 'active_link':'standards', + 'standard' : Standards.objects.get(pk=pk) + } + return render(request, 'standards/standards_single_agn.html', context) + @login_required def StandardArea(request, pk): @@ -463,3 +473,17 @@ def updatesbyajax(request, pk): success = False return JsonResponse({"success" : success}) + + +@login_required +def StandardFromAgn(request, pk): + + agn = AgencyNetwork.objects.get(pk=pk) + + print(agn.standards.all()) + context = { + 'active_link':'standards', + 'standards_of_agency_network' : agn.standards.all(), + 'agn' :agn, + } + return render(request, 'standards/standards_from_agn.html', context)