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", "CLEANR",
"CUDA", "CUDA",
"Divs", "Divs",
"favorited",
"flowbite", "flowbite",
"indeterminated", "indeterminated",
"jsonify", "jsonify",

View File

@ -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"))

View File

@ -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 %}