mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-31 15:23:02 +00:00 
			
		
		
		
	Small UI fixes
* Smart truncate long titles in overview pages * Fix responsive grid in overview * Update favicon
This commit is contained in:
		| @@ -8,7 +8,7 @@ a{color: #45b29d}a:hover{color: #444;} | |||||||
| .container-fluid img{display:block;max-width:100%;height:auto} | .container-fluid img{display:block;max-width:100%;height:auto} | ||||||
| .container-fluid .discover{margin-bottom:50px} | .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 .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{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 .title{font-weight:bold;font-size:15px;color:#444} | ||||||
| .container-fluid .book .meta .author{font-size:12px;color:#999} | .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 {padding-bottom: 20px;} | ||||||
| .book-meta .tags a {display: inline;} | .book-meta .tags a {display: inline;} | ||||||
| .container-fluid .single .cover img { | .container-fluid .single .cover img { | ||||||
|     border: 3px solid #fff; |     border: 1px solid #fff; | ||||||
|     border-radius: 5px; |     /*border-radius: 7px;*/ | ||||||
|     box-sizeing: border-box; |     box-sizeing: border-box; | ||||||
|     -webkit-box-shadow: 0 5px 8px -6px #777; |     -webkit-box-shadow: 0 5px 8px -6px #777; | ||||||
|     -moz-box-shadow: 0 5px 8px -6px #777; |     -moz-box-shadow: 0 5px 8px -6px #777; | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 519 B After Width: | Height: | Size: 1.1 KiB | 
| @@ -9,7 +9,7 @@ | |||||||
|         {% endif %} |         {% endif %} | ||||||
|       </div> |       </div> | ||||||
|     </div> |     </div> | ||||||
|     <div class="col-lg-7 book-meta"> |     <div class="col-sm-9 col-lg-9 book-meta"> | ||||||
|       <h2>{{entry.title}}</h2> |       <h2>{{entry.title}}</h2> | ||||||
|       <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a> |       <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a> | ||||||
|       </p> |       </p> | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
|         {% endif %} |         {% endif %} | ||||||
|       </div> |       </div> | ||||||
|       <div class="meta"> |       <div class="meta"> | ||||||
|         <p class="title">{{entry.title}}</p> |         <p class="title">{{entry.title|shortentitle}}</p> | ||||||
|         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> |         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> | ||||||
|         {% if entry.ratings.__len__() > 0 %} |         {% if entry.ratings.__len__() > 0 %} | ||||||
|         <div class="rating"> |         <div class="rating"> | ||||||
|   | |||||||
| @@ -15,7 +15,7 @@ | |||||||
|         {% endif %} |         {% endif %} | ||||||
|       </div> |       </div> | ||||||
|       <div class="meta"> |       <div class="meta"> | ||||||
|         <p class="title">{{entry.title}}</p> |         <p class="title">{{entry.title|shortentitle}}</p> | ||||||
|         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> |         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> | ||||||
|         {% if entry.ratings.__len__() > 0 %} |         {% if entry.ratings.__len__() > 0 %} | ||||||
|         <div class="rating"> |         <div class="rating"> | ||||||
| @@ -50,7 +50,7 @@ | |||||||
|         {% endif %} |         {% endif %} | ||||||
|       </div> |       </div> | ||||||
|       <div class="meta"> |       <div class="meta"> | ||||||
|         <p class="title">{{entry.title}}</p> |         <p class="title">{{entry.title|shortentitle}}</p> | ||||||
|         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> |         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> | ||||||
|         {% if entry.ratings.__len__() > 0 %} |         {% if entry.ratings.__len__() > 0 %} | ||||||
|         <div class="rating"> |         <div class="rating"> | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ | |||||||
|         {% endif %} |         {% endif %} | ||||||
|       </div> |       </div> | ||||||
|       <div class="meta"> |       <div class="meta"> | ||||||
|         <p class="title">{{entry.title}}</p> |         <p class="title">{{entry.title|shortentitle}}</p> | ||||||
|         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> |         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> | ||||||
|         {% if entry.ratings.__len__() > 0 %} |         {% if entry.ratings.__len__() > 0 %} | ||||||
|         <div class="rating"> |         <div class="rating"> | ||||||
|   | |||||||
| @@ -14,7 +14,7 @@ | |||||||
|         {% endif %} |         {% endif %} | ||||||
|       </div> |       </div> | ||||||
|       <div class="meta"> |       <div class="meta"> | ||||||
|         <p class="title">{{entry.title}}</p> |         <p class="title">{{entry.title|shortentitle}}</p> | ||||||
|         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> |         <p class="author"><a href="{{url_for('author', name=entry.authors[0].name) }}">{{entry.authors[0].name}}</a></p> | ||||||
|         {% if entry.ratings.__len__() > 0 %} |         {% if entry.ratings.__len__() > 0 %} | ||||||
|         <div class="rating"> |         <div class="rating"> | ||||||
|   | |||||||
| @@ -4,6 +4,7 @@ | |||||||
| import mimetypes | import mimetypes | ||||||
| import logging | import logging | ||||||
| import sys | import sys | ||||||
|  | import textwrap | ||||||
| mimetypes.add_type('application/xhtml+xml','.xhtml') | 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 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 | 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 | 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): | def admin_required(f): | ||||||
|     """ |     """ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jan Broer
					Jan Broer