From 973afc073333c6cccbb10284cc688319dce68c38 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 19 Oct 2010 11:34:46 -0600 Subject: [PATCH] Content server: Make /mobile a little prettier --- resources/content_server/mobile.css | 17 +++++++++++++++++ src/calibre/library/server/mobile.py | 21 +++++++++++---------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/resources/content_server/mobile.css b/resources/content_server/mobile.css index a887684841..28d12bb6db 100644 --- a/resources/content_server/mobile.css +++ b/resources/content_server/mobile.css @@ -1,5 +1,9 @@ /* CSS for the mobile version of the content server webpage */ +.body { + font-family: sans-serif; +} + .navigation table.buttons { width: 100%; } @@ -85,4 +89,17 @@ div.navigation { clear: both; } +.data-container { + display: inline-block; + vertical-align: middle; +} +.first-line { + font-size: larger; + font-weight: bold; +} + +.second-line { + margin-top: 0.75ex; + display: block; +} diff --git a/src/calibre/library/server/mobile.py b/src/calibre/library/server/mobile.py index b9ca24a823..7c2f959131 100644 --- a/src/calibre/library/server/mobile.py +++ b/src/calibre/library/server/mobile.py @@ -112,7 +112,6 @@ def build_index(books, num, search, sort, order, start, total, url_base, CKEYS): CLASS('thumbnail')) data = TD() - last = None for fmt in book['formats'].split(','): a = ascii_filename(book['authors']) t = ascii_filename(book['title']) @@ -124,9 +123,11 @@ def build_index(books, num, search, sort, order, start, total, url_base, CKEYS): ), CLASS('button')) s.tail = u'' - last = s data.append(s) + div = DIV(CLASS('data-container')) + data.append(div) + series = u'[%s - %s]'%(book['series'], book['series_index']) \ if book['series'] else '' tags = u'Tags=[%s]'%book['tags'] if book['tags'] else '' @@ -137,13 +138,13 @@ def build_index(books, num, search, sort, order, start, total, url_base, CKEYS): if val: ctext += '%s=[%s] '%tuple(val.split(':#:')) - text = u'\u202f%s %s by %s - %s - %s %s %s' % (book['title'], series, - book['authors'], book['size'], book['timestamp'], tags, ctext) - - if last is None: - data.text = text - else: - last.tail += text + first = SPAN(u'\u202f%s %s by %s' % (book['title'], series, + book['authors']), CLASS('first-line')) + div.append(first) + second = SPAN(u'%s - %s %s %s' % ( book['size'], + book['timestamp'], + tags, ctext), CLASS('second-line')) + div.append(second) bookt.append(TR(thumbnail, data)) # }}} @@ -229,7 +230,7 @@ class MobileServer(object): no_tag_count=True) book['title'] = record[FM['title']] for x in ('timestamp', 'pubdate'): - book[x] = strftime('%Y/%m/%d %H:%M:%S', record[FM[x]]) + book[x] = strftime('%b, %Y', record[FM[x]]) book['id'] = record[FM['id']] books.append(book) for key in CKEYS: