Skip to content

Commit 0757669

Browse files
authored
Merge pull request #13314 from Sadashii/13308/fix/move-preview-options-above-read-for-open-access
Fix: Render Search Inside above Read button for open-access books (#13308)
1 parent ee3d5bf commit 0757669

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎openlibrary/i18n/messages.pot‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7119,6 +7119,10 @@ msgstr ""
71197119
msgid "Checked Out"
71207120
msgstr ""
71217121

7122+
#: LoanStatus.html
7123+
msgid "Only a preview is available."
7124+
msgstr ""
7125+
71227126
#: LocateButton.html
71237127
msgid "Locate"
71247128
msgstr ""

‎openlibrary/macros/LoanStatus.html‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@
5959
data-ol-link-track="CTAClick|$action"
6060

6161
$if lending_state == 'borrowed':
62+
$if secondary_action:
63+
$:macros.PreviewSearchInside(ocaid)
6264
$:macros.ReadButton(ocaid, analytics_attr, loan=user_loan, listen=listen, edition_key=edition_key, book_title=book_title)
6365
$if secondary_action:
6466
$:macros.ReturnForm(ocaid, user_loan['expiry'], analytics_track="LoanStatus|ReturnClick")
@@ -69,9 +71,9 @@
6971

7072
$elif lending_state == 'open':
7173
$# Open / Publicly Readable (Unrestricted)
72-
$:macros.ReadButton(ocaid, analytics_attr, listen=listen, edition_key=edition_key, book_title=book_title)
7374
$if secondary_action:
7475
$:macros.PreviewSearchInside(ocaid)
76+
$:macros.ReadButton(ocaid, analytics_attr, listen=listen, edition_key=edition_key, book_title=book_title)
7577

7678
$elif lending_state == 'printdisabled':
7779
$# Exemptions for patrons with Print Disabilities
@@ -149,9 +151,13 @@
149151
</div>
150152

151153
$elif lending_state == 'preview_only':
152-
$:macros.BookPreview(ocaid, show_only=True)
153154
$if secondary_action:
154155
$:macros.PreviewSearchInside(ocaid)
156+
<div class="cta-button-group">
157+
<p class="waitinglist-message">
158+
<span>$_("Only a preview is available.")</span>
159+
</p>
160+
</div>
155161

156162
$else:
157163
$# Only render LocateButton instead of NotInLibrary when not on an edition's page, for that specific edition.

‎static/css/components/read-panel.css‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
white-space: nowrap;
99
margin: 0 0 10px;
1010
font-size: var(--font-size-label-medium);
11+
width: 100%;
1112
}
1213

1314
.mobile-vendor {
@@ -42,7 +43,6 @@
4243
text-decoration: none;
4344
position: relative;
4445
margin: 0 auto;
45-
margin-top: -15px; /* offsets Illustration margin-bottom: 10px */
4646
background-color: transparent;
4747
transition: background-color 0.2s;
4848

@@ -80,7 +80,6 @@
8080
.btn-notice .waitinglist-message {
8181
margin: 0 0 10px;
8282
font-size: var(--font-size-label-medium);
83-
text-wrap: auto;
8483
}
8584

8685
.read-options .cta-section,

0 commit comments

Comments
 (0)