Skip to content

Commit bbfb5f5

Browse files
committed
Integrate locate button into read dropper, add icon option for locate macro
1 parent 1e45029 commit bbfb5f5

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

openlibrary/i18n/messages.pot

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7493,10 +7493,6 @@ msgstr ""
74937493
msgid "Listen"
74947494
msgstr ""
74957495

7496-
#: ReadButton.html
7497-
msgid "Locate"
7498-
msgstr ""
7499-
75007496
#: ReadMore.html
75017497
msgid "Read more"
75027498
msgstr ""
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
$def with(edition_key)
1+
$def with(edition_key, icon=False)
22

33
$ locateUrl = "/books/XXX/-/borrow?action=locate".replace('XXX', edition_key or '')
44

5-
<a class="cta-btn cta-btn--available cta-btn--w-icon cta-btn--external" href="$locateUrl" target="_blank"
6-
data-ol-link-track="CTAClick|Locate">$_('Locate')</a>
5+
$if icon:
6+
<a class="cta-btn cta-btn--available cta-btn--w-icon cta-btn--external" href="$locateUrl" target="_blank"
7+
data-ol-link-track="CTAClick|Locate">
8+
9+
<span class="btn-icon map"></span>
10+
<span class="btn-label">$_("Locate")</span>
11+
</a>
12+
$else:
13+
<a class="cta-btn cta-btn--available cta-btn--w-icon cta-btn--external" href="$locateUrl" target="_blank"
14+
data-ol-link-track="CTAClick|Locate">$_('Locate')</a>

openlibrary/macros/ReadButton.html

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@
4242
</li>
4343
$if edition_key:
4444
<li>
45-
<a class="cta-btn cta-btn--available cta-btn--w-icon">
46-
<span class="btn-icon map"></span>
47-
<span class="btn-label">$_("Locate")</span>
48-
</a>
45+
$:macros.LocateButton(edition_key, icon=True)
4946
</li>
5047
</ul>
5148
</details>

0 commit comments

Comments
 (0)