Commit ca9431b7 authored by Baptiste Fournier's avatar Baptiste Fournier Committed by Fabien Zucchet

Inchallah ça passe j'ai pas testé

parent e6804ddd
......@@ -3,7 +3,7 @@
{% block title %}
Nofist - Accueil
{% endblock title %}
{% block navbar %}
{% include "core/components/navbar.html" with item='home' %}
{% endblock navbar %}
......@@ -11,23 +11,22 @@
{% block content %}
{% include "core/components/searchbar.html" %}
<div class="ui horizontal divider">Recherche par catégorie</div>
{% include "core/components/course_browser.html" %}
<div class="ui horizontal divider">Documents récents</div>
<div class="ui horizontal divider">Documents les plus appréciés</div>
<div class="ui cards three column stackable grid container">
{% for document in latest_document_list %}
{% include "core/components/document_sum.html" %}
{% endfor %}
</div>
<div class="ui horizontal divider">Cours</div>
<div class="ui cards three column stackable grid container">
{% for course in random_course_list %}
{% include "core/components/course_sum.html" %}
{% endfor %}
{% endfor %}
</div>
{% endblock content %}
......@@ -38,14 +37,3 @@
$('.ui.accordion').accordion();
</script>
{% endblock script %}
......@@ -16,7 +16,7 @@ from .utils import count_to_moderate
@login_required
def home(request):
latest_document_list = Document.objects.filter(isAccepted=True).annotate(likes=Count('documentlike')).order_by('-likes')[:6]
latest_document_list = Document.objects.filter(isAccepted=True).annotate(likes=Count('documentlike')).order_by('-likes')[:3]
for document in latest_document_list:
document.like_list = [like.user.pk for like in document.documentlike_set.all()]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment