Fakultas Ilmu Komputer UI
Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
PMPL
Class Project
DIGIPUS
Commits
9d89111a
Commit
9d89111a
authored
Oct 31, 2020
by
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
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/services.py
View file @
9d89111a
...
...
@@ -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
...
...
app/templates/app/katalog_materi.html
View file @
9d89111a
...
...
@@ -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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment