Skip to content

Add new carousel read button definition #10630

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions openlibrary/macros/ReadButton.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
$ title = _("Read ebook from Internet Archive")
$ analytics_action = "Read"

<div class="cta-dropper">
<div class="cta-button-group cta-dropper-button">
<a href="$(stream_url)" title="$title" class="cta-btn cta-btn--ia cta-btn--available cta-btn--$(action)"
$:analytics_attr(analytics_action)
$if loan:
data-userid="$(loan['userid'])"
>$label</a>
</div>
$ menu_items = [listen, edition_key]
$ is_carousel = "BookCarousel" in str(analytics_attr(analytics_action))
$if any(menu_items) and not is_carousel:
$ menu_items = [listen, edition_key]
$ is_carousel = "BookCarousel" in str(analytics_attr(analytics_action))
$if any(menu_items) and not is_carousel:
<div class="cta-dropper">
<div class="cta-button-group cta-dropper-button">
<a href="$(stream_url)" title="$title" class="cta-btn cta-btn--ia cta-btn--available cta-btn--$(action)"
$:analytics_attr(analytics_action)
$if loan:
data-userid="$(loan['userid'])"
>$label</a>
</div>
<details>
<summary>
</summary>
Expand All @@ -49,4 +49,12 @@
</li>
</ul>
</details>
</div>
</div>
$else:
<div class="cta-button-group">
<a href="$(stream_url)" title="$title" class="cta-btn cta-btn--ia cta-btn--available cta-btn--$(action)"
$:analytics_attr(analytics_action)
$if loan:
data-userid="$(loan['userid'])"
>$label</a>
</div>
Loading