diff --git a/cps/static/css/style.css b/cps/static/css/style.css index 52e2f1e4..8a16b3f0 100644 --- a/cps/static/css/style.css +++ b/cps/static/css/style.css @@ -8,7 +8,7 @@ a{color: #45b29d}a:hover{color: #444;} .container-fluid img{display:block;max-width:100%;height:auto} .container-fluid .discover{margin-bottom:50px} .container-fluid .new-books{border-top:1px solid #ccc}.container-fluid .new-books h2{margin:50px 0 0 0} -.container-fluid .book{margin-top:20px}.container-fluid .book .cover{height:225px;position:relative}.container-fluid .book .cover img{border:3px solid #fff;border-radius:5px;box-sizeing:border-box;height:100%;bottom:0;position:absolute;-webkit-box-shadow: 0 5px 8px -6px #777;-moz-box-shadow: 0 5px 8px -6px #777;box-shadow: 0 5px 8px -6px #777;} +.container-fluid .book{margin-top:20px}.container-fluid .book .cover{height:225px;position:relative}.container-fluid .book .cover img{border:1px solid #fff;/*border-radius:7px;*/box-sizeing:border-box;height:100%;bottom:0;position:absolute;-webkit-box-shadow: 0 5px 8px -6px #777;-moz-box-shadow: 0 5px 8px -6px #777;box-shadow: 0 5px 8px -6px #777;} .container-fluid .book .meta{margin-top:10px}.container-fluid .book .meta p{margin:0} .container-fluid .book .meta .title{font-weight:bold;font-size:15px;color:#444} .container-fluid .book .meta .author{font-size:12px;color:#999} @@ -21,8 +21,8 @@ span.glyphicon.glyphicon-tags {padding-right: 5px;color: #999;vertical-align: te .book-meta {padding-bottom: 20px;} .book-meta .tags a {display: inline;} .container-fluid .single .cover img { - border: 3px solid #fff; - border-radius: 5px; + border: 1px solid #fff; + /*border-radius: 7px;*/ box-sizeing: border-box; -webkit-box-shadow: 0 5px 8px -6px #777; -moz-box-shadow: 0 5px 8px -6px #777; diff --git a/cps/static/favicon.ico b/cps/static/favicon.ico index 75e6ecc3..46339365 100644 Binary files a/cps/static/favicon.ico and b/cps/static/favicon.ico differ diff --git a/cps/templates/detail.html b/cps/templates/detail.html index 316ab098..98ba03f7 100644 --- a/cps/templates/detail.html +++ b/cps/templates/detail.html @@ -9,7 +9,7 @@ {% endif %} -
+

{{entry.title}}

{{entry.authors[0].name}}

diff --git a/cps/templates/discover.html b/cps/templates/discover.html index 792bd2a2..5480cedd 100644 --- a/cps/templates/discover.html +++ b/cps/templates/discover.html @@ -14,7 +14,7 @@ {% endif %}
-

{{entry.title}}

+

{{entry.title|shortentitle}}

{{entry.authors[0].name}}

{% if entry.ratings.__len__() > 0 %}
diff --git a/cps/templates/index.html b/cps/templates/index.html index 5b061133..d7b0a022 100755 --- a/cps/templates/index.html +++ b/cps/templates/index.html @@ -15,7 +15,7 @@ {% endif %}
-

{{entry.title}}

+

{{entry.title|shortentitle}}

{{entry.authors[0].name}}

{% if entry.ratings.__len__() > 0 %}
@@ -50,7 +50,7 @@ {% endif %}
-

{{entry.title}}

+

{{entry.title|shortentitle}}

{{entry.authors[0].name}}

{% if entry.ratings.__len__() > 0 %}
diff --git a/cps/templates/search.html b/cps/templates/search.html index fa9f5a23..dd32ab7e 100644 --- a/cps/templates/search.html +++ b/cps/templates/search.html @@ -21,7 +21,7 @@ {% endif %}
-

{{entry.title}}

+

{{entry.title|shortentitle}}

{{entry.authors[0].name}}

{% if entry.ratings.__len__() > 0 %}
diff --git a/cps/templates/shelf.html b/cps/templates/shelf.html index 4d89c472..9a06dddc 100644 --- a/cps/templates/shelf.html +++ b/cps/templates/shelf.html @@ -14,7 +14,7 @@ {% endif %}
-

{{entry.title}}

+

{{entry.title|shortentitle}}

{{entry.authors[0].name}}

{% if entry.ratings.__len__() > 0 %}
diff --git a/cps/web.py b/cps/web.py index dc28f2b8..1b75f13c 100755 --- a/cps/web.py +++ b/cps/web.py @@ -4,6 +4,7 @@ import mimetypes import logging import sys +import textwrap mimetypes.add_type('application/xhtml+xml','.xhtml') from flask import Flask, render_template, session, request, Response, redirect, url_for, send_from_directory, make_response, g, flash, abort from cps import db, config, ub, helper @@ -122,6 +123,14 @@ def url_for_other_page(page): app.jinja_env.globals['url_for_other_page'] = url_for_other_page +## custom jinja filters +@app.template_filter('shortentitle') +def shortentitle_filter(s): + if len(s) > 60: + s = s.split(':', 1)[0] + if len(s) > 60: + s = textwrap.wrap(s, 60, break_long_words=False)[0]+' [...]' + return s def admin_required(f): """