From eb1c87fbae95c0fd93cae87312307cf28d4a0e07 Mon Sep 17 00:00:00 2001 From: hexeth <7627137+hexeth@users.noreply.github.com> Date: Mon, 7 Jan 2019 22:10:10 -0800 Subject: [PATCH] Patch 4 (#752) * Target new class Target new class for caliblur language support * Move publishing date into div Places publishing date in new div to assist caliBlur in targeting this element. This PR does not create any visual difference on the default theme. * Target newly created div --- cps/static/js/caliBlur.js | 11 +++++------ cps/templates/detail.html | 2 ++ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cps/static/js/caliBlur.js b/cps/static/js/caliBlur.js index 0d80860e..43457b10 100644 --- a/cps/static/js/caliBlur.js +++ b/cps/static/js/caliBlur.js @@ -224,14 +224,13 @@ $( '.publishers span:nth-child(3)' ).text(function() { return $(this).text().replace(/^\s+|^\t+|\t+|\s+$/g, ""); }); - published = $( '.book-meta p:contains("Publishing date")' ) + published = $( '.publishing-date p' ) .text().split(': '); - $( '.book-meta p:contains("Publishing date")' ) - .before( '
' ); - $( '.book-meta p:contains("Publishing date")' ).remove(); + $( '.publishing-date p' ).remove(); $.each(published, function(i, val) { - $( '.published-date' ).append( '' + published[i] + '' ); + $( '.publishing-date' ).append( '' + published[i] + '' ); }); + languages = $( '.languages p span' ).text().split( ': ' ); $( '.languages p span' ).remove(); $.each(languages, function(i, val) { @@ -400,7 +399,7 @@ if ( $( 'body.shelf' ).length > 0 ) { } // Move create shelf -$( '#nav_createshelf' ).prependTo( 'li:contains("Your Shelves")' ); +$( '#nav_createshelf' ).prependTo( '.your-shelves' ); // Create drop-down for profile and move elements to it $( '#main-nav' ) diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 7631ce2f..5c96fe61 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -144,7 +144,9 @@ {% endif %} {% if entry.pubdate[:10] != '0101-01-01' %} +

{{_('Publishing date')}}: {{entry.pubdate|formatdate}}

+
{% endif %} {% if cc|length > 0 %}