1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-07 18:54:03 +00:00

Small UI fixes

* Smart truncate long titles in overview pages
* Fix responsive grid in overview
* Update favicon
This commit is contained in:
Jan Broer
2016-04-03 23:33:29 +02:00
parent e8b2ea873c
commit 318d65bf3a
8 changed files with 18 additions and 9 deletions

View File

@@ -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):
"""