Skip to content
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

Add ability for a user to filter lists by date added #4267

Closed
arawden opened this issue Dec 14, 2020 · 4 comments · Fixed by #5334
Closed

Add ability for a user to filter lists by date added #4267

arawden opened this issue Dec 14, 2020 · 4 comments · Fixed by #5334
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Lists Issues related to reading Lists

Comments

@arawden
Copy link

arawden commented Dec 14, 2020

While I'm tracking the list of books that I want to read in the future, I'd like to be able to sort my "Want to Read" list by date added. This way, I'm able to determine which books have been in my backlog the longest, so I can finally get around to reading them.

Describe the problem that you'd like solved

When viewing my "want to read" list, I should be able to sort the list by date in ascending or descending order, so I can view my most recently added books or the books I added years ago and haven't gotten around to reading.

Proposal & Constraints

When viewing the /people/<user>/books/want-to-read list, add a UI control for sorting the list by date added. It's likely that this could be the start of a broader feature request for the ability to filter the list by book title, author, etc, as right now the only controls are pagination.

Additional context

I've attached a screenshot of this feature's implementation in Goodreads
image

Stakeholders

@arawden arawden added the Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] label Dec 14, 2020
@cclauss cclauss added the Theme: Lists Issues related to reading Lists label Mar 3, 2021
@mekarpeles mekarpeles added Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Needs: Help Issues, typically substantial ones, that need a dedicated developer to take them on. [managed] Priority: 3 Issues that we can consider at our leisure. [managed] and removed Needs: Lead Lead: @mekarpeles Issues overseen by Mek (Staff: Program Lead) [managed] Needs: Triage This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed] labels Mar 22, 2021
@Evazisouli
Copy link
Contributor

Hello! I'm a new contributor, should I try to contribute in this issue?

@Evazisouli
Copy link
Contributor

@jamesachamp could you give me some guidelines please?

@mekarpeles
Copy link
Member

mekarpeles commented Apr 21, 2021

Howdy @Evazisouli, this could be a good one!

Working with Reading Log

A mini-tutorial.

Overview

The html template for the reading log code is here:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/account/books.html

This is what the rendered page looks like:
https://openlibrary.org/people/mekBot/books/want-to-read

The template is rendered by a view method here:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/account.py#L733-L760

Data Flow

A user visits https://openlibrary.org/people/mekBot/books/want-to-read. This url pattern is matched by https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/account.py#L734 within the code and thus is handled by the public_my_books function in https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/account.py#L733.

The public_my_books in function in plugins/upstream/account.py calls the Bookshelves API model in https://github.com/internetarchive/openlibrary/blob/master/openlibrary/core/bookshelves.py#L6 which asks/queries for Reading Log data from the database.

The Bookshelves model returns data back to public_my_books where it is used to render (i.e. passed from https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/account.py#L755-L759 into) the html template (https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/account/books.html).

An example

In #5080, you can read through a complicated example of adding a feature to the Reading Log here: #5080 (comment)

This same example (which presumes to add Search filtering to the Reading Log) can be adapted to add an option to sort one's Reading Log entries by date added.

@Evazisouli
Copy link
Contributor

Evazisouli commented Apr 21, 2021

Thanks @mekarpeles! I would really like to work on it!

@mekarpeles mekarpeles removed the Needs: Help Issues, typically substantial ones, that need a dedicated developer to take them on. [managed] label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Lead: @jimchamp Issues overseen by Jim (Front-end Lead, BookNotes) [managed] Priority: 3 Issues that we can consider at our leisure. [managed] Theme: Lists Issues related to reading Lists
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants