diff --git a/digitaleagentur/__pycache__/settings.cpython-38.pyc b/digitaleagentur/__pycache__/settings.cpython-38.pyc index ed30bd7..898d79a 100644 Binary files a/digitaleagentur/__pycache__/settings.cpython-38.pyc and b/digitaleagentur/__pycache__/settings.cpython-38.pyc differ diff --git a/standards/templates/standards/agencynetwork_content.html b/standards/templates/standards/agencynetwork_content.html index 8a74c42..2f12284 100644 --- a/standards/templates/standards/agencynetwork_content.html +++ b/standards/templates/standards/agencynetwork_content.html @@ -51,7 +51,7 @@
Beliebte Standards

- {% for s in allagencynetworkstandards %} + {% for s in famestandards %} {% if forloop.counter < 10 %} {{s.name|truncatechars:30}} ({{s.agencynetworkcounter}})
{% endif %} diff --git a/standards/views.py b/standards/views.py index 59a8bf1..a3a4c18 100644 --- a/standards/views.py +++ b/standards/views.py @@ -60,8 +60,16 @@ class StandardsManagement(LoginRequiredMixin, ListView): allagencynetworkstandards.sort(key=lambda x: x.agencynetworkcounter, reverse=True) + + # Beliebte Standards + famestandards = [] + famecounter = 0 + for s in allagencynetworkstandards: + if famecounter < 10 and s not in famestandards: + famestandards.append(s) + famecounter += 1 - context.update({'active_link' : 'standards', 'unpubstandards_of_user' : unpubstandards_of_user, 'areas' : areas, 'standards_of_user' : standards_of_user, 'standardcontent' : standardcontent, "agencynetworks" : agencynetworks, "allagencynetworkstandards" : allagencynetworkstandards}) + context.update({'active_link' : 'standards', 'unpubstandards_of_user' : unpubstandards_of_user, 'areas' : areas, 'standards_of_user' : standards_of_user, 'standardcontent' : standardcontent, "agencynetworks" : agencynetworks, "allagencynetworkstandards" : allagencynetworkstandards, 'famestandards' : famestandards}) return context