Comments (20)
@maneprajakta I actually went through the code and that's when I got the idea for this feature the section will only be visible after user authentication Which is quite easy to implement. As for fetching books rated by the user there are two functions that I thought would help me with the same in helpers.py
I could make use of get_rated_bookids
function to get the list of book ids of already rated books and I could use this list as input to the function get_book_dict
to get the book details which would be used as the context for the rendered template.
As for, when there are no books rated I actually hadn't thought of that but I am thinking that we could put an if else statement and simply redirect the user to the index view if they haven't rated any books with an error message of Please rate or add books it should work.
Please let me know if I have misinterpreted something or there is a better way to do this.
from kitabe.
@maneprajakta I do have an understanding on how to write the necessary function in views.py to handle the request as well as to update urls.py accordingly.
As for the condition when there are no books rated your idea seems doable.
So, should I start working on it?
from kitabe.
Great!
Thanks a lot.
from kitabe.
@Praful932 Yes agree with you adding a rating button here will also be great.
@Fairspy also look for font size like make this card look better because it looks like a lot of white space is there.
from kitabe.
Great, I'll start working on it.
from kitabe.
@Fairspy the feature seems great to me
This section will be visible in the navbar only when the user signs in. After that, you need to fetch the books rated by the user from the database and render them on-page also think for when user has not rated any book .
Also, go through our Starter Guide it will help you a lot to get started with this project
from kitabe.
@Fairspy I hope you are clear that we will need a function in views.py to handle it and url.py will be referenced to it accordingly.
Now coming to the function which will handle everything in views.py it will filter out all the ratings given by the user to different books Sort of Like this from here onwards your approach it's correct get_rated_bookids
then get_book_dict
and at last rendering.
If user has not rated anything than what I could think is put if condition if length of list is 0 then render on page simple message that rate some book and in else the remaining part
All set then.
from kitabe.
@Fairspy Yes go for it
from kitabe.
@Fairspy Nice job for thoroughly thinking about it!
- In case of 0 books you can reuse the message which shows when users with 0 rated books trys to enter recommendation section.
- Make sure to write the corresponding unit tests :)
- You also need to add a wireframe/mockup for the page that you are designing before the implementation
from kitabe.
@Fairspy also everything needs to be responsive.
from kitabe.
@Praful932 @maneprajakta I'll definitely keep all of these points in mind while implementing the page.
As for the wireframe I'll try to make one as soon as possible. I was thinking that I could make it similar to the genres page of the website but without the rate this book button as it's already been rated.
from kitabe.
@Fairspy Great
Yep, np. I think it would be nice if you go for horizontal cards for an individual book.
from kitabe.
@maneprajakta
Do you want something like this?
Large screen size:
I was also thinking of adding pagination for users with more than 20 read books let me know what you think about it.
from kitabe.
@Fairspy
Yes, seems cool.
Ya, it's nice after 10 books you can go for pagination.
from kitabe.
@Fairspy On large screen it would be nice if you could center the card info
from kitabe.
@maneprajakta Great then I'll start working on pagination.
@Praful932 Did you want it to be something like this?
from kitabe.
@Fairspy yes
@maneprajakta Adding the rating button too here would be better right, incase the user wants to change the rating?
from kitabe.
@maneprajakta @Praful932 Please take a look and let me know if any further changes are required.
Small screen sizes:
Large screen sizes:
I've also added the pagination let me know what you think.
from kitabe.
LGTM @Fairspy
from kitabe.
Go ahead @Fairspy
from kitabe.
Related Issues (20)
- Enhancing features of home and explore page HOT 5
- Navbar(sticky) HOT 1
- Improper positioning HOT 4
- QA : Add formatter and linter HOT 2
- Different heights of button HOT 1
- Adding custom scrollbar in firefox HOT 6
- Redesign login text box for better user experience HOT 4
- After refereshing the info remains HOT 1
- Incorrect display in a range HOT 1
- Download database for user rating directly from Django admin as csv file HOT 1
- The Navbar is disturbed in small screen sizes HOT 3
- Hovering effect on More Details button in explore section. HOT 8
- Blinking Cursor Coincides With Search Icon In Nav Search HOT 5
- To create a fixed top navbar. HOT 1
- Recommendations based on what the user views HOT 1
- Recommendations not being displayed while searching a book HOT 3
- Deployment alternative to heroku 🛠
- Move dependency management to poetry
- Add Pre-commit hooks
- Search bar is not working and summary is not showing HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kitabe.