-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a Trending Books Carousel in the Home page #6568
Create a Trending Books Carousel in the Home page #6568
Conversation
Hi @mekarpeles , this is our first implementation of the carouzel. We would like to get some feedback from you in order to make any needed change and finish with the implementation. |
hi @mekarpeles we checked your reviews. Is there anything else we need to add to this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactoring
0267ca4
to
f75e06c
Compare
69b78da
to
2e17b3e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm!
If and when we add pagination to the /trending/*
pages, we may need to adjust default limit
s if we see repeated books on each page.
Closes #6186
With this PR, a carousel containing the Today's Trending Books in the Home page.
Technical
The
get_most_logged_books
method used to fetch the Trending Books for the/trending/today
page did not return the books in the correct format in order for the carousel to process and view them. So, we created theget_logged_books_carousel
which callsget_most_logged_books
and then formats the output. This created the carousel for the first step of the implementation.Considering the second step and the carousels ability to load more books, we adjusted
browse.json
with adding the trending parameter. Iftrending = true
, then theget_logged_books_carousel
is called. To achieve pagination, themost_logged_books
method gets the page number as a parameter. Lastly, we added an offset variableoffset=(page-1)*limit
and integrated it in the sql query.Testing
If testing in a localhost environment make sure to mark books as 'Want to Read' in order for the carousel to appear (works only for today's trending books). A
docker-compose restart memcached
is needed.Stakeholders
@mekarpeles
Attribution Disclaimer: By proposing this pull request, I affirm to have made a best-effort and exercised my discretion to make sure relevant sections of this code which substantially leverage code suggestions, code generation, or code snippets from sources (e.g. Stack Overflow, GitHub) have been annotated with basic attribution so reviewers & contributors may have confidence and access to the correct context to evaluate and use this code.