Keine Doppelten Beliebt-Standards
This commit is contained in:
parent
51deafaff9
commit
05e9f37c3b
Binary file not shown.
|
|
@ -51,7 +51,7 @@
|
|||
<div class="card-body">
|
||||
<h5 class="card-title">Beliebte Standards</h5>
|
||||
<p class="card-text">
|
||||
{% for s in allagencynetworkstandards %}
|
||||
{% for s in famestandards %}
|
||||
{% if forloop.counter < 10 %}
|
||||
<a href="{% url 'standard-single-agn' s.pk s.pk %}">{{s.name|truncatechars:30}}</a> ({{s.agencynetworkcounter}})<br/>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,15 @@ class StandardsManagement(LoginRequiredMixin, ListView):
|
|||
|
||||
allagencynetworkstandards.sort(key=lambda x: x.agencynetworkcounter, reverse=True)
|
||||
|
||||
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})
|
||||
# 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, 'famestandards' : famestandards})
|
||||
|
||||
return context
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue