[Checkins] SVN: Grokstar/trunk/src/grokstar/entry Make published time more readable

Robert Marianski rmarianski at openplans.org
Sun Feb 17 21:33:20 EST 2008


Log message for revision 84002:
  Make published time more readable

Changed:
  U   Grokstar/trunk/src/grokstar/entry.py
  U   Grokstar/trunk/src/grokstar/entry_templates/item.pt

-=-
Modified: Grokstar/trunk/src/grokstar/entry.py
===================================================================
--- Grokstar/trunk/src/grokstar/entry.py	2008-02-18 01:53:34 UTC (rev 84001)
+++ Grokstar/trunk/src/grokstar/entry.py	2008-02-18 02:33:19 UTC (rev 84002)
@@ -36,7 +36,8 @@
 
 
 class Item(grok.View):
-    pass
+    def format_published(self, published_date):
+        return published_date.strftime('%Y-%m-%d')
 
 
 class Add(grok.AddForm):

Modified: Grokstar/trunk/src/grokstar/entry_templates/item.pt
===================================================================
--- Grokstar/trunk/src/grokstar/entry_templates/item.pt	2008-02-18 01:53:34 UTC (rev 84001)
+++ Grokstar/trunk/src/grokstar/entry_templates/item.pt	2008-02-18 02:33:19 UTC (rev 84002)
@@ -2,7 +2,11 @@
   <div class="title">
     <a tal:attributes="href python:view.url(context)"
        tal:content="context/title" />
-    (<span class="published" tal:content="context/published"/>)
+    <tal:published define="published context/published"
+                   condition="published">
+      (<span class="published"
+             tal:content="python:view.format_published(published)"/>)
+    </tal:published>
   </div>
   <tal:block content="structure context/@@renderedcontent"/>
 </div>



More information about the Checkins mailing list