Fakultas Ilmu Komputer UI

Commit 9d89111a authored by Bunga Amalia Kurniawati's avatar Bunga Amalia Kurniawati 🌺
Browse files

[GREEN] Implement sort material by comment count

parent 6c14976f
Pipeline #60111 passed with stages
in 20 minutes and 43 seconds
......@@ -64,6 +64,8 @@ class DafterKatalogService:
lst_materi = lst_materi.annotate(count=Count('unduh__id')).order_by('-count')
elif (get_sort == "jumlah_tampilan"):
lst_materi = lst_materi.annotate(count=Count('baca__id')).order_by('-count')
elif (get_sort == "jumlah_komentar"):
lst_materi = lst_materi.annotate(count=Count('comment__id')).order_by('-count')
return lst_materi, url
@staticmethod
......
......@@ -149,6 +149,9 @@
<li>
<a href="?sort=jumlah_tampilan">jumlah tampilan</a>
</li>
<li>
<a href="?sort=jumlah_komentar">jumlah komentar</a>
</li>
</ul>
</div>
</div>
......
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