internetarchive / openlibrary

One webpage for every book ever published!

Home Page:https://openlibrary.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix List pages so MyBooks sidebar + Follows btn appear

mekarpeles opened this issue · comments

commented

Thank you @Realmbird -- can you see if you can add a "Follow" button to the List pages?

When a visitor goes to a patron's Lists page, they see a follow button.
Screenshot 2024-05-24 at 11 17 24 AM

Here's an example of all a patron's lists, that show follow btn:
https://openlibrary.org/people/mekBot/lists

This is handled by the code in:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/account/view.html

However, if a visitor goes to a specific patron's list (i.e. /people/xxx), then the follow button disappears, as does the my books sidebar and we want (a) the sidebar to appear and (b) the follow button to remain.

Screenshot 2024-05-24 at 11 17 05 AM

Here's an example of a specific list: https://openlibrary.org/people/mekBot/lists/OL104041L/Popular_Books

Note: This already does the right thing, when a patron is logged in and goes to their own List:
Screenshot 2024-05-24 at 11 29 12 AM

The template we'll need to worry about for the single list case is:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/type/list/view.html#L11-L20

Instead of if else blocks, we always want to return https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/type/list/view.html#L12-L17 except the value of is_owner should be determined by the is_owner variable rather than True

@mekarpeles Sure I can try