mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Content server: Allow clicking on the book cover to download it. Useful on small screen devices where clicking the Get button may be difficult
This commit is contained in:
parent
f6a780bf26
commit
4215b41a05
@ -356,6 +356,10 @@ h2.library_name {
|
|||||||
color: red;
|
color: red;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#booklist a.summary_thumb img {
|
||||||
|
border: none
|
||||||
|
}
|
||||||
|
|
||||||
#booklist > #pagelist { display: none; }
|
#booklist > #pagelist { display: none; }
|
||||||
|
|
||||||
#goto_page_dialog ul {
|
#goto_page_dialog ul {
|
||||||
@ -474,5 +478,9 @@ h2.library_name {
|
|||||||
color: red
|
color: red
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.details a.details_thumb img {
|
||||||
|
border: none
|
||||||
|
}
|
||||||
|
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div id="details_{id}" class="details">
|
<div id="details_{id}" class="details">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img alt="Cover of {title}" src="{prefix}/get/cover/{id}" />
|
<a href="{get_url}" title="Click to read {title} in the {fmt} format" class="details_thumb"><img alt="Cover of {title}" src="{prefix}/get/cover/{id}" /></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
<div class="field formats">{formats}</div>
|
<div class="field formats">{formats}</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<div id="summary_{id}" class="summary">
|
<div id="summary_{id}" class="summary">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<img alt="Cover of {title}" src="{prefix}/get/thumb_90_120/{id}" />
|
<a href="{get_url}" class="summary_thumb" title="Click to read {title} in the {fmt} format"><img alt="Cover of {title}" src="{prefix}/get/thumb_90_120/{id}" /></a>
|
||||||
{get_button}
|
{get_button}
|
||||||
</div>
|
</div>
|
||||||
<div class="right">
|
<div class="right">
|
||||||
|
@ -772,6 +772,7 @@ class BrowseServer(object):
|
|||||||
continue
|
continue
|
||||||
args, fmt, fmts, fname = self.browse_get_book_args(mi, id_)
|
args, fmt, fmts, fname = self.browse_get_book_args(mi, id_)
|
||||||
args['other_formats'] = ''
|
args['other_formats'] = ''
|
||||||
|
args['fmt'] = fmt
|
||||||
if fmts and fmt:
|
if fmts and fmt:
|
||||||
other_fmts = [x for x in fmts if x.lower() != fmt.lower()]
|
other_fmts = [x for x in fmts if x.lower() != fmt.lower()]
|
||||||
if other_fmts:
|
if other_fmts:
|
||||||
@ -794,8 +795,9 @@ class BrowseServer(object):
|
|||||||
args['get_button'] = \
|
args['get_button'] = \
|
||||||
'<a href="%s" class="read" title="%s">%s</a>' % \
|
'<a href="%s" class="read" title="%s">%s</a>' % \
|
||||||
(xml(href, True), rt, xml(_('Get')))
|
(xml(href, True), rt, xml(_('Get')))
|
||||||
|
args['get_url'] = xml(href, True)
|
||||||
else:
|
else:
|
||||||
args['get_button'] = ''
|
args['get_button'] = args['get_url'] = ''
|
||||||
args['comments'] = comments_to_html(mi.comments)
|
args['comments'] = comments_to_html(mi.comments)
|
||||||
args['stars'] = ''
|
args['stars'] = ''
|
||||||
if mi.rating:
|
if mi.rating:
|
||||||
@ -825,6 +827,12 @@ class BrowseServer(object):
|
|||||||
else:
|
else:
|
||||||
args, fmt, fmts, fname = self.browse_get_book_args(mi, id_,
|
args, fmt, fmts, fname = self.browse_get_book_args(mi, id_,
|
||||||
add_category_links=True)
|
add_category_links=True)
|
||||||
|
args['fmt'] = fmt
|
||||||
|
if fmt:
|
||||||
|
args['get_url'] = xml(self.opts.url_prefix + '/get/%s/%s_%d.%s'%(
|
||||||
|
fmt, fname, id_, fmt), True)
|
||||||
|
else:
|
||||||
|
args['get_url'] = ''
|
||||||
args['formats'] = ''
|
args['formats'] = ''
|
||||||
if fmts:
|
if fmts:
|
||||||
ofmts = [u'<a href="{4}/get/{0}/{1}_{2}.{0}" title="{3}">{3}</a>'\
|
ofmts = [u'<a href="{4}/get/{0}/{1}_{2}.{0}" title="{3}">{3}</a>'\
|
||||||
@ -879,9 +887,10 @@ class BrowseServer(object):
|
|||||||
c[1]) for c in comments]
|
c[1]) for c in comments]
|
||||||
comments = u'<div class="comments">%s</div>'%('\n\n'.join(comments))
|
comments = u'<div class="comments">%s</div>'%('\n\n'.join(comments))
|
||||||
|
|
||||||
return self.browse_details_template.format(id=id_,
|
return self.browse_details_template.format(
|
||||||
title=xml(mi.title, True), fields=fields,
|
id=id_, title=xml(mi.title, True), fields=fields,
|
||||||
formats=args['formats'], comments=comments)
|
get_url=args['get_url'], fmt=args['fmt'],
|
||||||
|
formats=args['formats'], comments=comments)
|
||||||
|
|
||||||
@Endpoint(mimetype='application/json; charset=utf-8')
|
@Endpoint(mimetype='application/json; charset=utf-8')
|
||||||
def browse_details(self, id=None):
|
def browse_details(self, id=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user