mirror of https://github.com/logos-co/open-law.git
issue change sort copy to `Most favorited` #148
This commit is contained in:
parent
02c36ec16a
commit
f3988e2873
|
@ -17,6 +17,7 @@
|
||||||
"CLEANR",
|
"CLEANR",
|
||||||
"CUDA",
|
"CUDA",
|
||||||
"Divs",
|
"Divs",
|
||||||
|
"favorited",
|
||||||
"flowbite",
|
"flowbite",
|
||||||
"indeterminated",
|
"indeterminated",
|
||||||
"jsonify",
|
"jsonify",
|
||||||
|
|
|
@ -5,7 +5,7 @@ from app.controllers import create_pagination
|
||||||
|
|
||||||
def sort_by(query, sort: str):
|
def sort_by(query, sort: str):
|
||||||
match sort:
|
match sort:
|
||||||
case "favored":
|
case "favorited":
|
||||||
query = query.order_by(text("stars_count DESC"))
|
query = query.order_by(text("stars_count DESC"))
|
||||||
case "upvoted":
|
case "upvoted":
|
||||||
query = query.order_by(text("score DESC"))
|
query = query.order_by(text("score DESC"))
|
||||||
|
|
|
@ -30,8 +30,8 @@
|
||||||
|
|
||||||
{% if selected_tab=='my_library' or selected_tab=='favorite_books' or selected_tab=='explore_books'%}
|
{% if selected_tab=='my_library' or selected_tab=='favorite_books' or selected_tab=='explore_books'%}
|
||||||
<li>
|
<li>
|
||||||
<a href="?sort=favored" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >
|
<a href="?sort=favorited" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >
|
||||||
Most favored
|
Most favorited
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue