Add Follow buttons to Patron Profile pages
mekarpeles opened this issue · comments
Currently, the patron profile page at https://openlibrary.org/people/ScarTissue has to follow button
But the My Books page at https://openlibrary.org/people/ScarTissue/books does
In templates/account/view.html, you can see that the Follow button widget is rendered at
openlibrary/openlibrary/templates/account/view.html
Lines 39 to 40 in 5d78986
public
.
The issue requires you to add a Follow macro to the patron's profile page at https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/type/user/view.html
You will not have th emb
(my books) object available to you and so you will have to calculate
- Whether the patron's account is public or private -- if it's private, don't render the widget!
- Whether this profile page is the current visitor's profile page -- if so, don't render the widget!
- Whether the visitor is subscribed or not to this patron
Most of this information is already accessible from the profile page:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/templates/type/user/view.html#L5-L6
This code block shows how you might determine if this page is the patron's page and whether the visitor is subscribed to this patron:
https://github.com/internetarchive/openlibrary/blob/master/openlibrary/plugins/upstream/mybooks.py#L442-L447
Hello! Mind if I take this one on?