diff --git a/openlibrary/macros/EditionNavBar.html b/openlibrary/macros/EditionNavBar.html
index 83322a290fb..1f65c01dcf4 100644
--- a/openlibrary/macros/EditionNavBar.html
+++ b/openlibrary/macros/EditionNavBar.html
@@ -10,7 +10,7 @@
- $_("This Edition")
+ $_("Details")
$_("Reviews")
diff --git a/openlibrary/macros/SubjectTags.html b/openlibrary/macros/SubjectTags.html
index 371a4a947cd..2fe88b64fee 100644
--- a/openlibrary/macros/SubjectTags.html
+++ b/openlibrary/macros/SubjectTags.html
@@ -1,10 +1,10 @@
-$def with(work,location,tags=[])
+$def with(work, tags=[])
$def render_subjects(label, subjects, track_value, prefix=""):
$if subjects:
+
$label
-
$for subject in subjects:
$subject$cond(not loop.last, ",", "")
@@ -13,13 +13,10 @@ $label
$if work:
$for tag in tags:
$if tag=="Subjects":
- $if location=="work":
- $:render_subjects(_("Subjects"), work.get_subjects(),"WorkSection|SubjectClick")
- $else:
- $:render_subjects(_("Subjects"), work.get_subjects(),"BookOverview|SubjectClick")
- $elif tag=="People":
- $:render_subjects(_("People"), work.subject_people,"WorkSection|SubjectPeopleClick", prefix="person:")
- $elif tag=="Places":
- $:render_subjects(_("Places"), work.subject_places,"WorkSection|SubjectPlacesClick", prefix="place:")
- $elif tag=="Times":
- $:render_subjects(_("Times"), work.subject_times,"WorkSection|SubjectTimesClick", prefix="time:")
+ $:render_subjects(_("Subjects"), work.get_subjects(),"BookOverview|SubjectClick")
+ $if tag=="People":
+ $:render_subjects(_("People"), work.subject_people,"BookOverview|SubjectPeopleClick", prefix="person:")
+ $if tag=="Places":
+ $:render_subjects(_("Places"), work.subject_places,"BookOverview|SubjectPlacesClick", prefix="place:")
+ $if tag=="Times":
+ $:render_subjects(_("Times"), work.subject_times,"BookOverview|SubjectTimesClick", prefix="time:")
diff --git a/openlibrary/plugins/openlibrary/js/index.js b/openlibrary/plugins/openlibrary/js/index.js
index 002714a5855..1bf2d2c0a7d 100644
--- a/openlibrary/plugins/openlibrary/js/index.js
+++ b/openlibrary/plugins/openlibrary/js/index.js
@@ -196,9 +196,18 @@ jQuery(function () {
.then(module => module.initRealTimeValidation());
}
// conditionally load readmore button based on class in the page
- if (document.getElementsByClassName('read-more-button').length) {
+ const readMoreButtons = document.getElementsByClassName('read-more-button');
+ const clampers = document.getElementsByClassName('clamp');
+ if (readMoreButtons.length || clampers.length) {
import(/* webpackChunkName: "readmore" */ './readmore.js')
- .then(module => module.initReadMoreButton());
+ .then(module => {
+ if (readMoreButtons.length) {
+ module.initReadMoreButton();
+ }
+ if (clampers.length) {
+ module.initClampers();
+ }
+ });
}
// conditionally loads Goodreads import based on class in the page
if (document.getElementsByClassName('import-table').length) {
diff --git a/openlibrary/plugins/openlibrary/js/readmore.js b/openlibrary/plugins/openlibrary/js/readmore.js
index ce5ee8d579c..c268e7a71c2 100644
--- a/openlibrary/plugins/openlibrary/js/readmore.js
+++ b/openlibrary/plugins/openlibrary/js/readmore.js
@@ -19,3 +19,22 @@ export function initReadMoreButton() {
}
});
}
+
+export function initClampers() {
+ /*
+ Clamper shows used to show more/less by toggling `hidden`
+ style on parent .clamp tag
+ */
+ $('.clamp').on('click', function(){
+ const up = $(this);
+ if (up.hasClass('clamp')) {
+ up.css({display: up.css('display') === '-webkit-box' ? 'unset' : '-webkit-box'});
+
+ if (up.attr('data-before') === '+ ') {
+ up.attr('data-before', '- ')
+ } else {
+ up.attr('data-before', '+ ')
+ }
+ }
+ });
+}
diff --git a/openlibrary/templates/site/head.html b/openlibrary/templates/site/head.html
index cd2adc29772..8e50e06b8db 100644
--- a/openlibrary/templates/site/head.html
+++ b/openlibrary/templates/site/head.html
@@ -31,7 +31,10 @@
$ style = 'build/page-%s.css'%ctx.get('cssfile', 'user')
-
+
+