MobileBlur

Check-in [b2d6f6e2e9]
Login
Overview
SHA1:b2d6f6e2e967f76afdc43f0302c484f3ce701c1b
Date: 2011-11-22 05:22:25
User: spiffy
Comment:Added some color. It doesn't look very good, but it's at least not atrocious anymore.
Timelines: family | ancestors | descendants | both | feature/pretty
Downloads: Tarball | ZIP archive
Other Links: files | file ages | folders | manifest
Tags And Properties
Context
2011-11-22
05:47
[c5a2ec2308] Story list page is styled much more nicely (user: spiffy, tags: better-story-list, feature/pretty)
05:22
[b2d6f6e2e9] Added some color. It doesn't look very good, but it's at least not atrocious anymore. (user: spiffy, tags: feature/pretty)
2011-11-21
03:15
[e8b2e22e32] Create new branch named "feature/pretty" (user: spiffy, tags: feature/pretty)
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Modified applications/mobileblur/controllers/default.py from [667cfb0951] to [cdfea9e32e].

    22     22           try:
    23     23               results = newsblur.login(login_form.vars["username"], login_form.vars["password"])
    24     24               response.cookies["nb_cookie"] = newsblur.cookies["newsblur_sessionid"]
    25     25               response.cookies["nb_cookie"]["path"] = "/"
    26     26               redirect(URL("index"))
    27     27           except Exception as ex:
    28     28               login_form.insert(-1, ex.message)
           29  +            login_form._class = "alert-message block-message error"
    29     30   
    30     31       return dict(login_form=login_form)
    31     32   
    32     33   
    33     34   def logout():
    34     35       response.cookies["nb_cookie"] = ""
    35     36       response.cookies["nb_cookie"]["expires"] = -10
    36     37       response.cookies["nb_cookie"]["path"] = "/"
    37     38       redirect(URL("index"))

Modified applications/mobileblur/controllers/feeds.py from [353169fb7a] to [1863aef141].

     1      1   # -*- coding: utf-8 -*-
     2      2   
     3      3   from pprint import pprint
            4  +import time
     4      5   
     5      6   def view():
     6         -    stories = newsblur.feed(request.args[0])["stories"]
     7         -    feeds = newsblur.feeds(flat=True)["feeds"]
     8         -    feed = [feed for feed in feeds.itervalues() if feed["id"]==int(request.args[0])][0]
            7  +    print ""
            8  +    s = time.time()
            9  +    feed = newsblur.feed(request.args[0])
           10  +    stories = feed["stories"]
           11  +    print time.time() - s
           12  +
           13  +    print feed.keys()
           14  +
           15  +    if not feed.has_key("feed_title"):
           16  +        s = time.time()
           17  +        feeds = newsblur.feeds(flat=True)["feeds"]
           18  +        print time.time() - s
           19  +
           20  +        s = time.time()
           21  +        feed = [feed for feed in feeds.itervalues() if feed["id"]==int(request.args[0])][0]
           22  +        print time.time() - s
           23  +
     9     24       return dict(stories=stories, feed=feed)
           25  +
    10     26   
    11     27   def mark_read():
    12     28       if len(request.args) > 0:
    13     29           newsblur.mark_feed_as_read(request.args[0])
    14     30       redirect(URL("default", "index"))

Modified applications/mobileblur/static/css/base.css from [b086dc4442] to [037cce1332].

    23     23   - always indent the first line and add space below paragraphs
    24     24   - bullets and numbers style and indent
    25     25   - form and table padding
    26     26   - code blocks
    27     27   - left and right padding to quoted text
    28     28   - page layout alignment, width and padding (change this for spaces)
    29     29   - column widths (change this to use left_sidebar and right_sidebar)
    30         -- backrgound images and colors (change this for colors)
           30  +- background images and colors (change this for colors)
    31     31   - web2py specific (.flash, .error)
    32     32   
    33     33   Notice:
    34     34   - even if you use a different layout/css you may need classes .flash and .error
    35     35   - this is all color neutral except for #349C01 (header, links, lines)
    36         -- there are two backrgound images: images/background.png and images/header.png
           36  +- there are two background images: images/background.png and images/header.png
    37     37   
    38     38   License: This file is released under BSD and MIT
    39     39   
    40     40   */
    41     41   
    42     42   /*     
    43     43     credit is left where credit is due.
................................................................................
   340    340   h1 {font-size: 2.0em;}
   341    341   h2 {font-size: 1.8em;}
   342    342   h3 {font-size: 1.4em;}
   343    343   h4 {font-size: 1.2em;}
   344    344   h5 {font-size: 1.0em;}
   345    345   h6 {font-size: 0.8em;}
   346    346   
   347         -/*********** page layout alignment, width and padding ***********/
   348         -/*body {background-color: #000;}*/
   349         -#container, #header, #page, #content, #statusbar,
   350         -#footer, #wrapper { display:block; line-height: 170%; }
   351         -#wrapper {width: 900px;}
   352         -#container {
   353         -    margin: 0 auto;
   354         -    padding: 0;
   355         -}
   356         -#wrapper {margin: 0 auto;} 
   357         -#wrapper {background-color: #fff; padding: 5px;} 
   358         -#statusbar { margin: 5px 0px 20px 0px;}
   359         -#footer {    
   360         -    margin-top: 30px;    
   361         -    padding: 5px;    
   362         -}
   363         -#statusbar, #footer {    
   364         -    background: #eaeaea; 
   365         -    border-top: 1px #aaa solid;    
   366         -}
   367         -#logo {
   368         -    width: 68px;
   369         -    height: 62px;
   370         -    background: url(../images/logo.png);
   371         -}
   372         -#appname {
   373         -    color: #cccccc;
   374         -}
   375         -
   376         -#right_sidebar { width: 160px; float:right; display: none; }
   377         -#left_sidebar { width: 160px; float:left; display: none; }
   378         -#content { float: left; /*width: 740px;*//*width: 63%;*/ /*width: 640px; float:left;*/ } /* uncomment this if you are going to use sidebars */
   379         - 
   380         -.auth_navbar {
   381         -   top: 0px;
   382         -   float: right;
   383         -   padding: 3px 10px 3px 10px; 
   384         -}
   385         -
   386    347   /*********** web2py specific ***********/
   387    348   div.flash {
   388    349       font-weight: bold;
   389    350       display: none;
   390    351       position: fixed;    
   391    352       padding: 10px;
   392    353       top: 40px;
................................................................................
   551    512     thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */ 
   552    513     tr, img { page-break-inside: avoid; }
   553    514     @page { margin: 0.5cm; }
   554    515     p, h2, h3 { orphans: 3; widows: 3; }
   555    516     h2, h3{ page-break-after: avoid; }
   556    517   }
   557    518   
   558         -#story-list > .read > h2 {
   559         -    color: #607890;
          519  +body {
          520  +    margin: 0 2% 0 2%;
          521  +    background-color: #CC6600;
          522  +}
          523  +
          524  +header {
          525  +    background-color: #cc0000;
          526  +    border-bottom: 1px solid black;
          527  +    color: white;
          528  +}
          529  +
          530  +#story-list {
          531  +}
          532  +
          533  +#story-list > .story > a {
          534  +    text-decoration: none;
          535  +    border-radius: 5px;
          536  +    font-size: 2em;
          537  +    font-weight: bold;
          538  +    background-color: #CC9933;
          539  +    padding: 0 6px 0 6px;
          540  +}
          541  +
          542  +#story-list > .story > .read {
          543  +    color: #CC3333;
          544  +}
          545  +#story-list > .story > .unread {
          546  +    color: #CC0000;
          547  +/*    color: #A8A8EE;*/
   560    548   }
   561         -#story-list > .unread > h2 {
   562         -    color: #306;
          549  +
          550  +#story-list > .story {
          551  +    background-color: white;
          552  +    padding: .25%;
          553  +    border: 1px solid black;
          554  +    border-radius: 5px;
          555  +    margin-top: .33%;
   563    556   }

Modified applications/mobileblur/views/default/index.html from [1ac89d52bc] to [cb0da83eed].

     1         -{{left_sidebar_enabled=right_sidebar_enabled=False}}
     2      1   {{extend 'layout.html'}}
     3      2   
     4      3   {{ for feed in feeds.itervalues(): }}
     5      4       {{ if threshold == -1 and feed["ng"] > 0: }} <span class='ng'>[ {{= feed["ng"] }} ]</span> {{ pass }}
     6      5       {{ if threshold <= 0 and feed["nt"] > 0: }} <span class='nt'>[ {{= feed["nt"] }} ]</span> {{ pass }}
     7      6       {{if feed["ps"] > 0: }}<span class='ps'>[ {{= feed["ps"] }} ]</span> {{ pass }}
     8      7       <a href="{{= URL(c="feeds", f="view", args=[feed["id"]]) }}">{{= feed["feed_title"] }}</a><br />
     9      8   {{ pass }}
    10         -
    11         -{{block left_sidebar}}New Left Sidebar Content{{end}}
    12         -{{block right_sidebar}}New Right Sidebar Content{{end}}

Modified applications/mobileblur/views/feeds/view.html from [f19fa72882] to [a3c96a9b2b].

     1         -{{left_sidebar_enabled=right_sidebar_enabled=False}}
     2      1   {{extend 'layout.html'}}
     3      2   
     4         -<h1>{{= feed["feed_title"] }}</h1>
     5         -<a href="{{= URL("mark_read", args=[feed["id"]]) }}">Mark feed as read</a>
            3  +{{ block header_bonus }}
            4  +    <h2>{{= feed["feed_title"] }}</h2>
            5  +    <a href="{{= URL("mark_read", args=[feed["id"]]) }}" class="button">Mark feed as read</a>
            6  +{{ end }}
     6      7   
     7      8   <section id="story-list">
            9  +{{
           10  +import time 
           11  +s = time.time()
           12  +}}
     8     13       {{ for story in stories: }}
     9         -        <a href="{{= URL(c="stories", f="view", vars=dict(story=story["id"], feed_id=feed["id"])) }}" class="{{= "unread" if story["read_status"] == 1 else "read" }}"><h2>{{= story["story_title"] }}</h2></a>
    10         -        <p>{{= story["story_date"] }}</p>
           14  +        <div class="story">
           15  +            <a href="{{= URL(c="stories", f="view", vars=dict(story=story["id"], feed_id=feed["id"])) }}" class="{{= "unread" if story["read_status"] == 1 else "read" }}">
           16  +                {{= story["story_title"] }}
           17  +            </a>
           18  +            <p>{{= story["story_date"] }}</p>
           19  +        </div>
    11     20       {{ pass }}
           21  +{{ print time.time() - s }}
    12     22   </section>
    13         -
    14         -{{block left_sidebar}}New Left Sidebar Content{{end}}
    15         -{{block right_sidebar}}New Right Sidebar Content{{end}}

Modified applications/mobileblur/views/layout.html from [eb19032d37] to [4a91494d8a].

     6      6       <!-- www.phpied.com/conditional-comments-block-downloads/ -->
     7      7       <!--[if IE]><![endif]-->    
     8      8       <!-- Always force latest IE rendering engine 
     9      9   	 (even in intranet) & Chrome Frame 
    10     10   	 Remove this if you use the .htaccess -->
    11     11       <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    12     12       
    13         -    <title>{{=response.title or request.application}}</title>
           13  +    <title>{{ block title }}{{=response.title or request.application}}{{ end }}</title>
    14     14       
    15     15       <!-- http://dev.w3.org/html5/markup/meta.name.html -->
    16     16       <meta name="application-name" content="{{=request.application}}" />	
    17     17       
    18     18       <!-- Speaking of Google, don't forget to set your site up: 
    19     19   	 http://google.com/webmasters -->
    20     20       <meta name="google-site-verification" content="" />
................................................................................
    21     21       
    22     22       <!--  Mobile Viewport Fix
    23     23   	  j.mp/mobileviewport & davidbcalhoun.com/2010/viewport-metatag 
    24     24   	  device-width: Occupy full width of the screen in its current orientation
    25     25   	  initial-scale = 1.0 retains dimensions instead of zooming out if page height > device height
    26     26   	  maximum-scale = 1.0 retains dimensions instead of zooming in if page width < device width
    27     27         -->
    28         -    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
           28  +    <meta name="viewport" content="width=device-width, initial-scale=2, maximum-scale=5.0">
    29     29       
    30     30       <!-- Place favicon.ico and apple-touch-icon.png in the root of your domain and delete these references -->
    31     31       <link rel="shortcut icon" href="{{=URL('static','favicon.ico')}}" type="image/x-icon">
    32     32       <link rel="apple-touch-icon" href="{{=URL('static','favicon.png')}}">
    33     33   
    34     34       <!-- For the less-enabled mobile browsers like Opera Mini -->
    35     35       <link rel="stylesheet" media="handheld" href="{{=URL('static','css/handheld.css')}}">
................................................................................
    55     55       else: width_content='100%'
    56     56       if left_sidebar_enabled: left_sidebar_style = 'style="display: block;"'
    57     57       else: left_sidebar_style = 'style="display: none;"'
    58     58       if right_sidebar_enabled: right_sidebar_style = 'style="display: block;"'
    59     59       else: right_sidebar_style = 'style="display: none;"'
    60     60       style_content = 'style="width: %s"' % width_content
    61     61       }}
           62  +<!--    <link rel="stylesheet" href="http://twitter.github.com/bootstrap/1.4.0/bootstrap.min.css">-->
    62     63     </head>
    63     64     
    64     65     <!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->	
    65     66     <!--[if lt IE 7 ]> <body class="ie6"> <![endif]-->
    66     67     <!--[if IE 7 ]>    <body class="ie7"> <![endif]-->
    67     68     <!--[if IE 8 ]>    <body class="ie8"> <![endif]-->
    68     69     <!--[if IE 9 ]>    <body class="ie9"> <![endif]-->
    69     70     <!--[if (gt IE 9)|!(IE)]><!--> <body> <!--<![endif]-->
    70     71       
    71     72       <div class="flash">{{=response.flash or ''}}</div> <!-- notification div -->
    72     73       
    73         -    <div id="container">	      		      	
    74         -      
    75         -      <div id="wrapper">		
    76         -	
    77         -	<div id="header"> <!-- header and login nav -->
           74  +	<header>
    78     75   	  {{block header}} <!-- this is default header -->
    79         -	  {{try:}}{{=auth.navbar(action=URL('default','user'))}}{{except:pass}}		          
    80         -	  <h1><span id="appname">{{=request.application.capitalize()}}</span>App</h1>
    81         -	  <div style="clear: both;"></div><!-- Clear the divs -->
    82         -	  {{end}}				  					  
    83         -	</div><!-- header  -->
           76  +          <h1><a href="{{= URL("mobileblur", "default", "index") }}">MobileBlur</a></h1>
           77  +	  {{end}}
           78  +      {{ block header_bonus }}{{end}}
           79  +	</header>
    84     80   	
    85         -	<div id="statusbar"><!-- statusbar is menu zone -->
    86         -	  {{block statusbar}} <!-- this is default statusbar -->
    87         -	  {{#------ superfish menu ------}}
    88         -	  {{=MENU(response.menu,_class='sf-menu')}}
    89         -	  <script type="text/javascript">
    90         -	    jQuery(document).ready(function(){
    91         -	    jQuery('ul.sf-menu').superfish();});
    92         -	  </script>
    93         -	  <div style="clear: both;"></div><!-- Clear the divs -->	
    94         -	  {{end}}				
    95         -	</div><!-- statusbar -->
    96         -	
    97         -	<div id="page"> <!-- Here my central body -->	  
           81  +    <section id="content" {{=XML(style_content)}} >
           82  +        {{include}}	
           83  +    </section>
    98     84   
    99         -	  {{if left_sidebar_enabled:}}
   100         -          <div id="left_sidebar" {{=XML(left_sidebar_style)}} >
   101         -            <div style="padding: 4px;">
   102         -	      {{block left_sidebar}}Content Left Sidebar{{end}}		  
   103         -            </div>
   104         -          </div><!-- left_sidebar -->
   105         -	  {{pass}}
   106         -
   107         -      <a href="{{= URL("default", "logout") }}">Log out</a>
   108         -	  <!-- content -->
   109         -	  <div id="content" {{=XML(style_content)}} >
   110         -	    {{include}}	
   111         -	  </div>
   112         -	  <!-- content -->
   113         -
   114         -	  {{if right_sidebar_enabled:}}
   115         -          <div id="right_sidebar" {{=XML(right_sidebar_style)}} >
   116         -            <div style="padding: 4px;">
   117         -              {{block right_sidebar}}Content Right Sidebar{{end}}
   118         -            </div>
   119         -	  </div><!-- right_sidebar -->
   120         -          {{pass}}
   121         -
   122         -
   123         -	  <div style="clear: both;"></div><!-- Clear the divs -->
   124         -	  
   125         -	</div><!-- page -->							
   126         -	
   127         -	<div id="footer">
   128         -	  {{block footer}} <!-- this is default footer -->
   129         -	  <a href="http://www.web2py.com/" style="float: left; padding-right: 6px;">
   130         -	    <img src="{{=URL('static','images/poweredby.png')}}"/>
   131         -	  </a>
   132         -	  {{=T('Copyright')}} &#169; 2010				
   133         -	  <div style="clear: both;"></div><!-- Clear the divs -->
   134         -	  {{end}}
   135         -
   136         -	</div><!-- footer -->			
   137         -      </div><!-- wrapper -->
   138         -    </div><!-- container -->		
           85  +    <footer>
           86  +        <a href="{{= URL("default", "logout") }}">Log out</a>
           87  +    </footer>
   139     88       
   140     89       <!--[if lt IE 7 ]>
   141     90   	<script src="{{=URL('static','js/dd_belatedpng.js')}}"></script>
   142     91   	<script> DD_belatedPNG.fix('img, .png_bg'); //fix any <img> or .png_bg background-images </script>
   143     92   	<![endif]-->
   144     93       
   145     94       <!-- asynchronous google analytics: mathiasbynens.be/notes/async-analytics-snippet 

Modified applications/mobileblur/views/stories/view.html from [c0c8c655df] to [63977d234b].

     1         -{{left_sidebar_enabled=right_sidebar_enabled=False}}
     2      1   {{extend 'layout.html'}}
     3      2   
     4         -<a href="{{= story["story_permalink"] }}"><h1>{{= story["story_title"] }}</h1></a>
     5         -<a href="{{= URL("mark_read", vars=dict(story_id=story["id"], feed_id=feed_id)) }}">Mark story as read</a>
            3  +<a href="{{= story["story_permalink"] }}">
            4  +    <h2>{{= story["story_title"] }}</h2>
            5  +</a>
            6  +<a href="{{= URL("mark_read", vars=dict(story_id=story["id"], feed_id=feed_id)) }}" class="button">
            7  +    Mark story as read
            8  +</a>
     6      9   
     7     10   {{= XML(story["story_content"]) }}
     8         -
     9         -{{block left_sidebar}}New Left Sidebar Content{{end}}
    10         -{{block right_sidebar}}New Right Sidebar Content{{end}}