issue change sort copy to `Most favorited` #148

This commit is contained in:
Kostiantyn Stoliarskyi 2023-06-16 10:09:47 +03:00
parent 02c36ec16a
commit f3988e2873
3 changed files with 4 additions and 3 deletions

View File

@ -17,6 +17,7 @@
"CLEANR",
"CUDA",
"Divs",
"favorited",
"flowbite",
"indeterminated",
"jsonify",

View File

@ -5,7 +5,7 @@ from app.controllers import create_pagination
def sort_by(query, sort: str):
match sort:
case "favored":
case "favorited":
query = query.order_by(text("stars_count DESC"))
case "upvoted":
query = query.order_by(text("score DESC"))

View File

@ -30,8 +30,8 @@
{% if selected_tab=='my_library' or selected_tab=='favorite_books' or selected_tab=='explore_books'%}
<li>
<a href="?sort=favored" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >
Most favored
<a href="?sort=favorited" class="block px-4 py-2 hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white" >
Most favorited
</a>
</li>
{% endif %}