{{= story["story_date"] }}
+Index: applications/mobileblur/controllers/default.py
==================================================================
--- applications/mobileblur/controllers/default.py
+++ applications/mobileblur/controllers/default.py
@@ -24,10 +24,11 @@
response.cookies["nb_cookie"] = newsblur.cookies["newsblur_sessionid"]
response.cookies["nb_cookie"]["path"] = "/"
redirect(URL("index"))
except Exception as ex:
login_form.insert(-1, ex.message)
+ login_form._class = "alert-message block-message error"
return dict(login_form=login_form)
def logout():
Index: applications/mobileblur/controllers/feeds.py
==================================================================
--- applications/mobileblur/controllers/feeds.py
+++ applications/mobileblur/controllers/feeds.py
@@ -1,14 +1,30 @@
# -*- coding: utf-8 -*-
from pprint import pprint
+import time
def view():
- stories = newsblur.feed(request.args[0])["stories"]
- feeds = newsblur.feeds(flat=True)["feeds"]
- feed = [feed for feed in feeds.itervalues() if feed["id"]==int(request.args[0])][0]
+ print ""
+ s = time.time()
+ feed = newsblur.feed(request.args[0])
+ stories = feed["stories"]
+ print time.time() - s
+
+ print feed.keys()
+
+ if not feed.has_key("feed_title"):
+ s = time.time()
+ feeds = newsblur.feeds(flat=True)["feeds"]
+ print time.time() - s
+
+ s = time.time()
+ feed = [feed for feed in feeds.itervalues() if feed["id"]==int(request.args[0])][0]
+ print time.time() - s
+
return dict(stories=stories, feed=feed)
+
def mark_read():
if len(request.args) > 0:
newsblur.mark_feed_as_read(request.args[0])
redirect(URL("default", "index"))
Index: applications/mobileblur/static/css/base.css
==================================================================
--- applications/mobileblur/static/css/base.css
+++ applications/mobileblur/static/css/base.css
@@ -25,17 +25,17 @@
- form and table padding
- code blocks
- left and right padding to quoted text
- page layout alignment, width and padding (change this for spaces)
- column widths (change this to use left_sidebar and right_sidebar)
-- backrgound images and colors (change this for colors)
+- background images and colors (change this for colors)
- web2py specific (.flash, .error)
Notice:
- even if you use a different layout/css you may need classes .flash and .error
- this is all color neutral except for #349C01 (header, links, lines)
-- there are two backrgound images: images/background.png and images/header.png
+- there are two background images: images/background.png and images/header.png
License: This file is released under BSD and MIT
*/
@@ -328,63 +328,18 @@
fieldset { border: 1px solid #dedede; padding: 6px; }
legend { font-weight: bold; }
input:focus, textarea:focus { background: #fafafa; }
-p {text-indent:30px;}
-
-p, blockquote {
- margin-bottom: 10px;
-}
-
h1,h2,h3,h4,h5,h6 { line-height: 170%; }
h1 {font-size: 2.0em;}
h2 {font-size: 1.8em;}
h3 {font-size: 1.4em;}
h4 {font-size: 1.2em;}
h5 {font-size: 1.0em;}
h6 {font-size: 0.8em;}
-/*********** page layout alignment, width and padding ***********/
-/*body {background-color: #000;}*/
-#container, #header, #page, #content, #statusbar,
-#footer, #wrapper { display:block; line-height: 170%; }
-#wrapper {width: 900px;}
-#container {
- margin: 0 auto;
- padding: 0;
-}
-#wrapper {margin: 0 auto;}
-#wrapper {background-color: #fff; padding: 5px;}
-#statusbar { margin: 5px 0px 20px 0px;}
-#footer {
- margin-top: 30px;
- padding: 5px;
-}
-#statusbar, #footer {
- background: #eaeaea;
- border-top: 1px #aaa solid;
-}
-#logo {
- width: 68px;
- height: 62px;
- background: url(../images/logo.png);
-}
-#appname {
- color: #cccccc;
-}
-
-#right_sidebar { width: 160px; float:right; display: none; }
-#left_sidebar { width: 160px; float:left; display: none; }
-#content { float: left; /*width: 740px;*//*width: 63%;*/ /*width: 640px; float:left;*/ } /* uncomment this if you are going to use sidebars */
-
-.auth_navbar {
- top: 0px;
- float: right;
- padding: 3px 10px 3px 10px;
-}
-
/*********** web2py specific ***********/
div.flash {
font-weight: bold;
display: none;
position: fixed;
@@ -553,11 +508,72 @@
@page { margin: 0.5cm; }
p, h2, h3 { orphans: 3; widows: 3; }
h2, h3{ page-break-after: avoid; }
}
-#story-list > .read > h2 {
- color: #607890;
+body {
+}
+
+header {
+ background-color: #cc0000;
+ padding: 1%;
+ border-bottom: 1px solid black;
+ color: white;
+}
+header > h1 > a {
+ text-decoration: none;
+ color: white;
+ font-weight: bold;
+}
+
+#story-list {
+}
+
+#story-list > .story > a {
+ text-decoration: none;
+ font-weight: bold;
+ margin-top: 0;
+}
+#story-list > .story > p {
+ font-size: .75em;
+}
+
+#story-list > .story > .read {
+ color: #CC3333;
+}
+#story-list > .story > .unread {
+ color: #CC0000;
+/* color: #A8A8EE;*/
+}
+
+#story-list > .story {
+ padding: .5%;
+ padding-top: 0;
+ border-top: 1px solid black;
+ margin-top: .33%;
+}
+
+span.ps, span.nt, span.ng {
+ padding: .05em;
+ border-radius: 5px;
+}
+span.ps {
+ background-color: #35C030;
+}
+span.nt {
+ background-color: yellow;
+}
+span.ng {
+ background-color: red;
+}
+
+footer {
+ background-color: #cc0000;
+ padding: 1%;
+ border-top: 1px solid black;
+ color: white;
}
-#story-list > .unread > h2 {
- color: #306;
+footer > a {
+ text-decoration: none;
+ color: white;
+ font-weight: bold;
}
Index: applications/mobileblur/views/default/index.html
==================================================================
--- applications/mobileblur/views/default/index.html
+++ applications/mobileblur/views/default/index.html
@@ -1,12 +1,8 @@
-{{left_sidebar_enabled=right_sidebar_enabled=False}}
{{extend 'layout.html'}}
{{ for feed in feeds.itervalues(): }}
- {{ if threshold == -1 and feed["ng"] > 0: }} [ {{= feed["ng"] }} ] {{ pass }}
- {{ if threshold <= 0 and feed["nt"] > 0: }} [ {{= feed["nt"] }} ] {{ pass }}
- {{if feed["ps"] > 0: }}[ {{= feed["ps"] }} ] {{ pass }}
+ {{ if threshold == -1 and feed["ng"] > 0: }} {{= feed["ng"] }} {{ pass }}
+ {{ if threshold <= 0 and feed["nt"] > 0: }} {{= feed["nt"] }} {{ pass }}
+ {{if feed["ps"] > 0: }}{{= feed["ps"] }} {{ pass }}
{{= feed["feed_title"] }}
{{ pass }}
-
-{{block left_sidebar}}New Left Sidebar Content{{end}}
-{{block right_sidebar}}New Right Sidebar Content{{end}}
Index: applications/mobileblur/views/feeds/view.html
==================================================================
--- applications/mobileblur/views/feeds/view.html
+++ applications/mobileblur/views/feeds/view.html
@@ -1,15 +1,22 @@
-{{left_sidebar_enabled=right_sidebar_enabled=False}}
{{extend 'layout.html'}}
-
{{= story["story_date"] }}
+{{= story["story_date"] }}
+