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

Display vendor beneath omnibar on mobile book page views #7071

Conversation

ztjhz
Copy link
Contributor

@ztjhz ztjhz commented Oct 11, 2022

Closes #7009

Feature: Display vendor beneath omnibar on mobile book page views

Technical

Tried this method suggested in the issue:

It's probably best to pass an optional string to the template containing any additional classes that will be needed to display the correct vendor section. You can add the new classes the the ul element in AffiliateLinks.html.

Inside AffiliateLinks.html

$def with (page, opts, classes='')
...
<ul class="buy-options-table $_(classes)">

Inside view.html

$:macros.AffiliateLinks(page, {'isbn': isbn_13, 'asin': asin, 'prices': prices}, 'mobile-vendor')

Inside read-panel.less

.mobile-vendor {
  display: none;
}
...
@media only screen and (max-width: @width-breakpoint-desktop){
  .mobile-vendor {
    display: inline;
  }
  .desktop-vendor {
    display: none;
  }
}

Result:
image

Only the ul is hidden but the Buy this book and its container is still visible.

So, instead of applying it to the AffliateLinks.html template, I applied it to its container in view.html and databarWork.html.

<div class="panel mobile-vendor">   <!-- view.html -->
<div class="panel desktop-vendor"> <!-- databarWork.html -->

The result is shown in the screenshots below.

Testing

  1. Go to one of the book pages (e.g. http://localhost:8080/works/OL118420W/Flatland)
  2. View the page in desktop view (only the vendor on the side should be visible)
  3. View the page in mobile view (only the vendor below the omibar should be visible)

Screenshot

image
image

Stakeholders

@jimchamp

@mekarpeles
Copy link
Member

Thank you @ztjhz for making this contribution!

Copy link
Collaborator

@jimchamp jimchamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm! Thanks @ztjhz!

@jimchamp jimchamp merged commit 628ca04 into internetarchive:master Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display vendors beneath omnibar on mobile book page views
3 participants