From 0809d2f6ee1fcaaf734ba68f48b62b16f5f1ea2a Mon Sep 17 00:00:00 2001 From: GRiker Date: Sun, 27 Jun 2010 13:42:12 -0600 Subject: [PATCH] GwR wip --- resources/recipes/nytimes.recipe | 1 + resources/recipes/nytimes_sub.recipe | 1 + src/calibre/customize/profiles.py | 85 +++++++++++++++++++++------- src/calibre/web/feeds/templates.py | 28 +++++---- 4 files changed, 81 insertions(+), 34 deletions(-) diff --git a/resources/recipes/nytimes.recipe b/resources/recipes/nytimes.recipe index 3e02363f68..4c87b68436 100644 --- a/resources/recipes/nytimes.recipe +++ b/resources/recipes/nytimes.recipe @@ -89,6 +89,7 @@ class NYTimes(BasicNewsRecipe): 'relatedSearchesModule', 'side_tool', 'singleAd', + 'subNavigation clearfix', 'subNavigation tabContent active', 'subNavigation tabContent active clearfix', ]}), diff --git a/resources/recipes/nytimes_sub.recipe b/resources/recipes/nytimes_sub.recipe index f8ad12afe9..cd2b83ae4c 100644 --- a/resources/recipes/nytimes_sub.recipe +++ b/resources/recipes/nytimes_sub.recipe @@ -76,6 +76,7 @@ class NYTimes(BasicNewsRecipe): 'relatedSearchesModule', 'side_tool', 'singleAd', + 'subNavigation clearfix', 'subNavigation tabContent active', 'subNavigation tabContent active clearfix', ]}), diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index d352ce5de7..4bd679407f 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -275,13 +275,43 @@ class iPadOutput(OutputProfile): # touchscreen_news_css {{{ touchscreen_news_css = u''' /* hr used in articles */ + .article_articles_list { + width:18%; + } + .article_link { + font-style: italic; + } + .article_next { + -webkit-border-top-right-radius:4px; + -webkit-border-bottom-right-radius:4px; + font-style: italic; + width:32%; + } + + .article_prev { + -webkit-border-top-left-radius:4px; + -webkit-border-bottom-left-radius:4px; + font-style: italic; + width:32%; + } + .article_sections_list { + width:18%; + } + .articles_link { + font-weight: bold; + } + .sections_link { + font-weight: bold; + } + + .caption_divider { border:#ccc 1px solid; } .touchscreen_navbar { background:#ccc; - border:#ccc 1px solid; + border:#ccc 0px solid; border-collapse:separate; border-spacing:1px; margin-left: 5%; @@ -295,18 +325,6 @@ class iPadOutput(OutputProfile): font-size:90%; padding: 5px; text-align:center; - } - .touchscreen_navbar td:first-child { - -webkit-border-top-left-radius:4px; - -webkit-border-bottom-left-radius:4px; - } - .touchscreen_navbar td:last-child { - -webkit-border-top-right-radius:4px; - -webkit-border-bottom-right-radius:4px; - } - - .feed_link { - font-style: italic; } /* Index formatting */ @@ -318,12 +336,47 @@ class iPadOutput(OutputProfile): border-top:1px solid gray; } + hr.caption_divider { + border-color:black; + border-style:solid; + border-width:1px; + } + /* Feed summary formatting */ + .feed { + font-family:sans-serif; + font-weight:bold; + font-size:larger; + } + + .feed_link { + font-style: italic; + } + + .feed_next { + -webkit-border-top-right-radius:4px; + -webkit-border-bottom-right-radius:4px; + font-style: italic; + width:40%; + } + + .feed_prev { + -webkit-border-top-left-radius:4px; + -webkit-border-bottom-left-radius:4px; + font-style: italic; + width:40%; + } + .feed_title { text-align: center; font-size: 160%; } + .feed_up { + font-weight: bold; + width:20%; + } + .summary_headline { font-weight:bold; text-align:left; @@ -338,12 +391,6 @@ class iPadOutput(OutputProfile): text-align:left; } - .feed { - font-family:sans-serif; - font-weight:bold; - font-size:larger; - } - ''' # }}} diff --git a/src/calibre/web/feeds/templates.py b/src/calibre/web/feeds/templates.py index df414e2e52..1ea7aea9d4 100644 --- a/src/calibre/web/feeds/templates.py +++ b/src/calibre/web/feeds/templates.py @@ -269,11 +269,11 @@ class TouchscreenFeedTemplate(Template): link = A(CLASS('feed_link'), trim_title(feeds[f-1].title), href = '../feed_%d/index.html' % int(f-1)) - navbar_tr.append(TD(link, width="40%", align="center")) + navbar_tr.append(TD(CLASS('feed_prev'),link)) # Up to Sections - link = A(STRONG('Sections'), href="../index.html") - navbar_tr.append(TD(link,width="20%",align="center")) + link = A('Sections', href="../index.html") + navbar_tr.append(TD(CLASS('feed_up'),link)) # Next Section link = '' @@ -281,7 +281,7 @@ class TouchscreenFeedTemplate(Template): link = A(CLASS('feed_link'), trim_title(feeds[f+1].title), href = '../feed_%d/index.html' % int(f+1)) - navbar_tr.append(TD(link, width="40%", align="center", )) + navbar_tr.append(TD(CLASS('feed_next'),link)) navbar_t.append(navbar_tr) top_navbar = navbar_t bottom_navbar = copy.copy(navbar_t) @@ -354,27 +354,25 @@ class TouchscreenNavBarTemplate(Template): # | Previous if art > 0: - href = '%s../article_%d/index.html'%(prefix, art-1) - navbar_tr.append(TD(A(EM('Previous'),href=href), - width="32%")) + link = A(CLASS('article_link'),'Previous',href='%s../article_%d/index.html'%(prefix, art-1)) + navbar_tr.append(TD(CLASS('article_prev'),link)) else: - navbar_tr.append(TD('', width="32%")) + navbar_tr.append(TD(CLASS('article_prev'),'')) # | Articles | Sections | - href = '%s../index.html#article_%d'%(prefix, art) - navbar_tr.append(TD(A(STRONG('Articles'), href=href),width="18%")) + link = A(CLASS('articles_link'),'Articles', href='%s../index.html#article_%d'%(prefix, art)) + navbar_tr.append(TD(CLASS('article_articles_list'),link)) - href = '%s../../index.html#feed_%d'%(prefix, feed) - navbar_tr.append(TD(A(STRONG('Sections'), href=href),width="18%")) + link = A(CLASS('sections_link'),'Sections', href='%s../../index.html#feed_%d'%(prefix, feed)) + navbar_tr.append(TD(CLASS('article_sections_list'),link)) # | Next next = 'feed_%d'%(feed+1) if art == number_of_articles_in_feed - 1 \ else 'article_%d'%(art+1) up = '../..' if art == number_of_articles_in_feed - 1 else '..' - href = '%s%s/%s/index.html'%(prefix, up, next) - navbar_tr.append(TD(A(EM('Next'),href=href), - width="32%")) + link = A(CLASS('article_link'),'Next', href='%s%s/%s/index.html'%(prefix, up, next)) + navbar_tr.append(TD(CLASS('article_next'),link)) navbar_t.append(navbar_tr) navbar.append(navbar_t) #print "\n%s\n" % etree.tostring(navbar, pretty_print=True)