From c77825371df4be04d4e9098e3b7bf1d7e0772908 Mon Sep 17 00:00:00 2001
From: hexeth <7627137+hexeth@users.noreply.github.com>
Date: Mon, 7 Jan 2019 12:13:51 -0800
Subject: [PATCH 1/2] Add classes to shelves for easier css selection (#751)
proposed class changes will assist caliBlur in targeting this element, resolving language compatibility issues.
---
cps/templates/layout.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/cps/templates/layout.html b/cps/templates/layout.html
index 7609c2b9..558cad1a 100644
--- a/cps/templates/layout.html
+++ b/cps/templates/layout.html
@@ -166,11 +166,11 @@
{{_('Languages')}}
{%endif%}
{% if g.user.is_authenticated or g.user.is_anonymous %}
- {{_('Public Shelves')}}
+ {{_('Public Shelves')}}
{% for shelf in g.public_shelfes %}
{{shelf.name|shortentitle(40)}}
{% endfor %}
- {{_('Your Shelves')}}
+ {{_('Your Shelves')}}
{% for shelf in g.user.shelf %}
{{shelf.name|shortentitle(40)}}
{% endfor %}
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 2/2] 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 %}