diff --git a/cps/static/css/style.css b/cps/static/css/style.css index be91f295..87f7b4c5 100644 --- a/cps/static/css/style.css +++ b/cps/static/css/style.css @@ -53,10 +53,12 @@ span.glyphicon.glyphicon-tags {padding-right: 5px;color: #999;vertical-align: te .spinner2 {margin:0 41%;} .block-label {display: block;} +.fake-input {position: absolute; pointer-events: none; top: 0;} + +.author-bio img {margin: 0 1em 1em 0;} +.author-link img {display: inline-block;max-width: 100px;} #remove-from-shelves .btn, #shelf-action-errors { margin-left: 5px; } -.author-bio img {margin: 0 1em 1em 0;} -.author-link img {display: inline-block;max-width: 100px;} diff --git a/cps/static/js/libs/plugins.js b/cps/static/js/libs/plugins.js index eb88e4ce..1a623a3d 100644 --- a/cps/static/js/libs/plugins.js +++ b/cps/static/js/libs/plugins.js @@ -1,3 +1,7 @@ +/*! modernizr 3.5.0 (Custom Build) | MIT * + * https://modernizr.com/download/?-inputtypes-addtest-setclasses !*/ +!function(e,t,n){function o(e,t){return typeof e===t}function i(){var e,t,n,i,s,a,l;for(var f in u)if(u.hasOwnProperty(f)){if(e=[],t=u[f],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nr;r++)d.setAttribute("type",o=e[r]),s="text"!==d.type&&"style"in d,s&&(d.value=l,d.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(o)&&d.style.WebkitAppearance!==n?(c.appendChild(d),i=t.defaultView,s=i.getComputedStyle&&"textfield"!==i.getComputedStyle(d,null).WebkitAppearance&&0!==d.offsetHeight,c.removeChild(d)):/^(search|tel)$/.test(o)||(s=/^(url|email)$/.test(o)?d.checkValidity&&d.checkValidity()===!1:d.value!=l)),m[e[r]]=!!s;return m}(h);var g;!function(){var e={}.hasOwnProperty;g=o(e,"undefined")||o(e.call,"undefined")?function(e,t){return t in e&&o(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),f._l={},f.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),Modernizr.hasOwnProperty(e)&&setTimeout(function(){Modernizr._trigger(e,Modernizr[e])},0)},f._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,o;for(e=0;e { + options.async = true; + options.cache = true; + }; + preFilters.add(useCache); + + $.get(e.relatedTarget.href).done(function(content) { + $modalBody.html(content); + preFilters.remove(useCache); + }); + }) + .on("hidden.bs.modal", function() { + $(this).find(".modal-body").html("..."); + }); + $(window).resize(function(event) { $(".discover .row").isotope("reLayout"); }); diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index 7ccd826d..c1c319df 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -9,10 +9,10 @@ {% if gdrive %}
- +
-
+
@@ -155,21 +155,9 @@
{% endblock %} {% block js %} - {% endblock %} diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 08f84ca6..882b2ba2 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -1,4 +1,4 @@ -{% extends "layout.html" %} +{% extends is_xhr|yesno("fragment.html", "layout.html") %} {% block body %}
@@ -59,7 +59,6 @@ {% endif %}
-

{{entry.title}}

{% for author in entry.authors %} @@ -260,6 +259,5 @@ {% endblock %} {% block js %} - {% endblock %} diff --git a/cps/templates/discover.html b/cps/templates/discover.html index 32f89a47..ff79c23b 100644 --- a/cps/templates/discover.html +++ b/cps/templates/discover.html @@ -8,7 +8,7 @@

{% if entry.has_cover is defined %} - + {% endif %} diff --git a/cps/templates/fragment.html b/cps/templates/fragment.html new file mode 100644 index 00000000..1421ea6a --- /dev/null +++ b/cps/templates/fragment.html @@ -0,0 +1,4 @@ +
+ {% block body %}{% endblock %} +
+{% block js %}{% endblock %} diff --git a/cps/templates/index.html b/cps/templates/index.html index 768c28bd..72df252a 100755 --- a/cps/templates/index.html +++ b/cps/templates/index.html @@ -8,7 +8,7 @@ {% for entry in random %}
+ {% block modal %}{% endblock %} {% block js %}{% endblock %} diff --git a/cps/templates/search.html b/cps/templates/search.html index 7e82c1fc..3f705c47 100644 --- a/cps/templates/search.html +++ b/cps/templates/search.html @@ -15,7 +15,7 @@
{% if entry.has_cover is defined %} - + {% endif %} diff --git a/cps/templates/shelf.html b/cps/templates/shelf.html index a81538e1..46586925 100644 --- a/cps/templates/shelf.html +++ b/cps/templates/shelf.html @@ -15,7 +15,7 @@
{% if entry.has_cover is defined %} - + {% endif %} diff --git a/cps/web.py b/cps/web.py index 1437cb3a..9050028d 100755 --- a/cps/web.py +++ b/cps/web.py @@ -428,6 +428,11 @@ def timestamptodate(date, fmt=None): return native.strftime(time_format) +@app.template_filter('yesno') +def yesno(value, yes, no): + return yes if value else no + + def admin_required(f): """ Checks if current_user.role == 1 @@ -1292,7 +1297,7 @@ def show_book(book_id): else: have_read = None - return render_title_template('detail.html', entry=entries, cc=cc, + return render_title_template('detail.html', entry=entries, cc=cc, is_xhr=request.is_xhr, title=entries.title, books_shelfs=book_in_shelfs, have_read=have_read) else: flash(_(u"Error opening eBook. File does not exist or file is not accessible:"), category="error")