Openlibrary: Improve mobile CTA on Editions pages

Created on 20 Oct 2019  路  6Comments  路  Source: internetarchive/openlibrary

Read/borrow button appears far below the fold on mobile UI for editions page

Screenshot

openlibrary org_books_OL25930651M_The_Three-Body_Problem(Pixel 2)

Relevant url?


https://openlibrary.org/books/OL25930651M/The_Three-Body_Problem

Expectation

Show CTA much higher -- e.g. under the bookcover

Details

  • Logged in (Y/N)?
  • Browser type/version?
  • Operating system?

Proposal & Constraints

The read/borrow CTA button may be duplicated under or above the Want to Read button and show when the right mobile breakpoints are triggered

Stakeholders

Good First Issue 1 Work In Progress Bug hacktoberfest

All 6 comments

I can work on this! 馃檵

@cecyc Since you volunteered to work on this project, I am making you assignee and changing the state of this project to work in progress.

@cecyc do you have a proposal for how this should be implemented? You may want to look at macros/LoanStatus.html and how it's used already within openlibrary/templates/type/edition/view.html.

We'll probably want the LoanStatus button to be above the Want to Read -- i.e. $:render_template("lists/widget", page, include_header=False) -- button, but hidden on desktop (and visible when mobile) within the editionCover block.

If you're wondering where the read/borrow button is coming from...

openlibrary/templates/type/edition/view.html is the edition page which calls...
$:macros.databarWork(page, editions_page=True) which is in openlibrary/macros/databarWork.html which calls..
$:macros.LoanStatus(page, ctx.user, editions_page=editions_page, block_name="read-options-panel") -- this call will need to be adjusted slightly and added into the editionCover block described above.

@mekarpeles thank you! I was a bit stuck trying to figure out the best way to pull in that element, but this should hopefully set me in the right path, thank you!

@mekarpeles have a PR here. Let me know your thoughts! Thanks!

We'll take a look as soon as we can! Thank you for your hard work on this @cecyc. Will merge before Oct 31

Was this page helpful?
0 / 5 - 0 ratings