From 686b1e80b1096bdf97f27a56386652ff911f7912 Mon Sep 17 00:00:00 2001 From: GRiker Date: Sun, 14 Nov 2010 03:16:12 -0700 Subject: [PATCH 1/2] GwR wip catalog revisions --- resources/catalog/stylesheet.css | 30 +++++++++++++++++++++--------- src/calibre/library/catalog.py | 16 ++++++++++++++-- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/resources/catalog/stylesheet.css b/resources/catalog/stylesheet.css index f57aafdd44..d3d093743a 100644 --- a/resources/catalog/stylesheet.css +++ b/resources/catalog/stylesheet.css @@ -12,8 +12,8 @@ p.title { p.author { margin-top:0em; margin-bottom:0em; - text-align: left; - text-indent: 1em; + text-align: center; + text-indent: 0em; font-size:large; } @@ -27,17 +27,29 @@ p.author_index { } p.tags { - margin-top:0em; + margin-top:0.5em; margin-bottom:0em; text-align: left; - text-indent: 1em; - font-size:small; + text-indent: 0.0in; } -p.description { - text-align:left; - font-style:normal; - margin-top: 0em; +p.formats { + font-size:90%; + margin-top:0em; + margin-bottom:0.5em; + text-align: left; + text-indent: 0.0in; + } + +/* +div.description > p:first-child { + margin: 0 0 0 0; + text-indent: 0em; + } +*/ +div.description { + margin: 0 0 0 0; + text-indent: 1em; } p.date_index { diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 270311b7a8..ad9aebac1b 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -1666,7 +1666,8 @@ class EPUB_MOBI(CatalogPlugin): elif self.opts.connected_kindle and title['id'] in self.bookmarked_books: authorTag.insert(0, NavigableString(self.READING_SYMBOL + " by ")) else: - authorTag.insert(0, NavigableString(self.NOT_READ_SYMBOL + " by ")) + #authorTag.insert(0, NavigableString(self.NOT_READ_SYMBOL + " by ")) + authorTag.insert(0, NavigableString("by ")) authorTag.insert(1, aTag) ''' @@ -1695,6 +1696,7 @@ class EPUB_MOBI(CatalogPlugin): tagsTag = body.find(attrs={'class':'tags'}) ttc = 0 + ''' # Insert a spacer to match the author indent fontTag = Tag(soup,"font") fontTag['style'] = 'color:white;font-size:large' @@ -1703,6 +1705,7 @@ class EPUB_MOBI(CatalogPlugin): fontTag.insert(0, NavigableString(" by ")) tagsTag.insert(ttc, fontTag) ttc += 1 + ''' for tag in title['tags']: aTag = Tag(soup,'a') @@ -1711,11 +1714,19 @@ class EPUB_MOBI(CatalogPlugin): aTag.insert(0,escape(NavigableString(tag))) emTag = Tag(soup, "em") emTag.insert(0, aTag) - if ttc < len(title['tags']): + if ttc < len(title['tags'])-1: emTag.insert(1, NavigableString(' · ')) tagsTag.insert(ttc, emTag) ttc += 1 + # Insert formats + if 'formats' in title: + formatsTag = body.find(attrs={'class':'formats'}) + formats = [] + for format in sorted(title['formats']): + formats.append(format.rpartition('.')[2].upper()) + formatsTag.insert(0, NavigableString(' · '.join(formats))) + # Insert the cover if available imgTag = Tag(soup,"img") if 'cover' in title: @@ -4238,6 +4249,7 @@ class EPUB_MOBI(CatalogPlugin):

 

+

 

From 6cca4b4d97d2afb2e91d368faaacb7ec79740c6a Mon Sep 17 00:00:00 2001 From: GRiker Date: Wed, 17 Nov 2010 03:58:40 -0700 Subject: [PATCH 2/2] GwR updates to catalog --- resources/catalog/stylesheet.css | 5 ++--- src/calibre/library/catalog.py | 29 +++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/resources/catalog/stylesheet.css b/resources/catalog/stylesheet.css index d3d093743a..057c6c9f42 100644 --- a/resources/catalog/stylesheet.css +++ b/resources/catalog/stylesheet.css @@ -41,12 +41,11 @@ p.formats { text-indent: 0.0in; } -/* div.description > p:first-child { margin: 0 0 0 0; text-indent: 0em; } -*/ + div.description { margin: 0 0 0 0; text-indent: 1em; @@ -133,5 +132,5 @@ td.rating { text-align: center; } td.thumbnail img { - -webkit-box-shadow: 6px 6px 6px #888; + -webkit-box-shadow: 4px 4px 12px #999; } \ No newline at end of file diff --git a/src/calibre/library/catalog.py b/src/calibre/library/catalog.py index 2008d20c8f..1734e14d1d 100644 --- a/src/calibre/library/catalog.py +++ b/src/calibre/library/catalog.py @@ -1870,7 +1870,7 @@ class EPUB_MOBI(CatalogPlugin): ptc = 0 # book with read|reading|unread symbol or wishlist item - if self.opts.wishlist_tag in book['tags']: + if self.opts.wishlist_tag in book.get('tags', []): pBookTag['class'] = "wishlist_item" pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) ptc += 1 @@ -2177,7 +2177,7 @@ class EPUB_MOBI(CatalogPlugin): ptc = 0 # book with read|reading|unread symbol or wishlist item - if self.opts.wishlist_tag in new_entry['tags']: + if self.opts.wishlist_tag in new_entry.get('tags', []): pBookTag['class'] = "wishlist_item" pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) ptc += 1 @@ -2228,7 +2228,7 @@ class EPUB_MOBI(CatalogPlugin): ptc = 0 # book with read|reading|unread symbol or wishlist item - if self.opts.wishlist_tag in new_entry['tags']: + if self.opts.wishlist_tag in new_entry.get('tags', []): pBookTag['class'] = "wishlist_item" pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) ptc += 1 @@ -2682,7 +2682,7 @@ class EPUB_MOBI(CatalogPlugin): book['read'] = False # book with read|reading|unread symbol or wishlist item - if self.opts.wishlist_tag in book['tags']: + if self.opts.wishlist_tag in book.get('tags', []): pBookTag['class'] = "wishlist_item" pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) ptc += 1 @@ -3975,7 +3975,7 @@ class EPUB_MOBI(CatalogPlugin): for x in output_profiles(): if x.short_name == self.opts.output_profile: # .9" width aspect ratio: 3:4 - self.thumbWidth = int(x.dpi * .9) + self.thumbWidth = int(x.dpi * 1) self.thumbHeight = int(self.thumbWidth * 1.33) if 'kindle' in x.short_name and self.opts.fmt == 'mobi': # Kindle DPI appears to be off by a factor of 2 @@ -4180,7 +4180,8 @@ class EPUB_MOBI(CatalogPlugin): pBookTag = Tag(soup, "p") ptc = 0 - # book with read|reading|unread symbol or wishlist item + ''' + # This if clause does not display MISSING_SYMBOL for wishlist items # If this is the wishlist_tag genre, don't show missing symbols # normalized_wishlist_tag = self.genre_tags_dict[self.opts.wishlist_tag] if self.opts.wishlist_tag in book['tags'] and \ @@ -4188,6 +4189,13 @@ class EPUB_MOBI(CatalogPlugin): pBookTag['class'] = "wishlist_item" pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) ptc += 1 + ''' + + # book with read|reading|unread symbol or wishlist item + if self.opts.wishlist_tag in book.get('tags', []): + pBookTag['class'] = "wishlist_item" + pBookTag.insert(ptc,NavigableString(self.MISSING_SYMBOL)) + ptc += 1 else: if book['read']: # check mark @@ -4252,32 +4260,25 @@ class EPUB_MOBI(CatalogPlugin):

 

- - + - - - - - -