internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.11k stars 1.34k forks source link

Implement new read/return buttons on my books page #7443

Closed cdrini closed 1 year ago

cdrini commented 1 year ago

Implement @danafein 's mockups:

In scope:

Stakeholders

@danafein @jimchamp @mekarpeles

protocolog commented 1 year ago

I am an student of BITS Pilani india.If this is still open I would love to be assigned. @cdrini

mekarpeles commented 1 year ago

Hi @protocolog, sounds good to me! @danafein is the lead behind these designs and @jimchamp can help you with the implementation.

JaydenTeoh commented 1 year ago

@cdrini @mekarpeles I have setup a dev environment but I noticed that the borrow function is not supported on dev environment. May I ask how can I mock a borrowed book so that I can implement @danafein designs?

This is the API request that failed when clicking on the borrow button:

image

Please advise me on how I can proceed. Thank you!

mekarpeles commented 1 year ago

I think the button is implemented on the Books Page already (within the macro/LoanStatus.html) If we open a PR, we can put it on testing.openlibrary.org where there lending is available and we can test.

JaydenTeoh commented 1 year ago

@mekarpeles The button is implemented but clicking it and sending the API request results in internal server error. May I ask if there is any way I can visualise and style the buttons that I'm implementing if I am unable to borrow books into the loan page?

JaydenTeoh commented 1 year ago

@cdrini @mekarpeles made a PR for this implementation. I need a little help getting the datestr fn to work. I have the expiry time in UTC format but I am unable to convert it to relative time using datestr. Will also need to test this implementation on testing.openlibrary.org to see if my buttons are working properly