comparison bitsyblog/templates/blog.html @ 16:2bd6b2b543dc

now have blog entry snippets
author k0s <k0scist@gmail.com>
date Sun, 25 Oct 2009 18:11:25 -0400
parents 36698624435b
children e5cbc53cacf8
comparison
equal deleted inserted replaced
15:36698624435b 16:2bd6b2b543dc
19 19
20 <body> 20 <body>
21 21
22 <xi:include href="navigation.html" /> 22 <xi:include href="navigation.html" />
23 23
24 <div class="navigation" 24 <!-- blog navigation -->
25 py:if="n_links == 0 or not len(blog)" 25 <div class="navigation"
26 py:with="_n_links = (n_links != -1) and n_links or len(blog)"> 26 py:if="n_links == 0 or len(blog) &gt; 1"
27 <ul> 27 py:with="_n_links = (n_links != -1) and n_links or len(blog)">
28 <li py:for="index in range(_n_links)"> 28 <ul>
29 </li> 29 <li py:for="index in range(_n_links)"
30 </ul> 30 py:with="synopsis = blog[index].title()">
31 <a py:if="_n_links != len(blog)" href="TODO?n=all">more</a> 31 <a href="#${blog[index].datestamp()}">${blog[index].date.strftime(date_format)}</a><py:if test="synopsis">: ${escape(synopsis)}</py:if>
32 </li>
33 </ul>
34 <a py:if="_n_links != len(blog)" href="${request.path}?n=all">more</a>
35 </div>
36
37 <!-- blog entries -->
38 <div py:for="entry in blog"
39 id="${entry.datestamp()}" class="blog-entry">
40 <a name="${entry.datestamp()}" />
41
42 <div class="subject">
43 <a href="${user_url(request, request.user.name, entry.datestamp())}">${subject % dict(date=entry.date.strftime(date_format))}</a>
44 <em py:if="entry.privacy == 'secret' and role == 'friend'">
45 secret
46 </em>
32 </div> 47 </div>
48
49 ${entry.cooked_body}
50
51 <div py:if="role == 'author'">
33 52
34 <!-- blog entries --> 53 <!-- privacy settings -->
35 <div py:for="entry in blog" 54 <form action="TODO" method="post">
36 id="${entry.datestamp()}" class="blog-entry"> 55 <span title="viewable to everyone">
37 <a name="${entry.datestamp()}" /> 56 public
38 57 <input type="radio" name="privacy" value="public"
39 <div class="subject"> 58 py:attrs="{'checked': entry.privacy=='public' and True or None}"/>
40 <a href="${user_url(request, request.user.name, entry.datestamp())}">${subject % dict(date=entry.date.strftime(date_format))}</a> 59 </span>
41 <em py:if="entry.privacy == 'secret' and role == 'friend'"> 60 <span title="viewable only to your friends">
42 secret 61 secret
43 </em> 62 <input type="radio" name="privacy" value="secret"
63 py:attrs="{'checked': entry.privacy=='secret' and True or None}"/>
64 </span>
65 <span title="viewable only to you">
66 private
67 <input type="radio" name="privacy" value="private"
68 py:attrs="{'checked': entry.privacy=='private' and True or None}"/>
69 </span>
70 <input type="submit" name="submit" value="Change Privacy" />
71 </form>
72
73 <!-- mangled URL -->
74 <div py:if="entry.privacy != 'public'"
75 py:with="mangled_url = mangledurl(request, entry)">
76 <span title="${'You can give this URL so people may see this %s post without logging in' % entry.privacy}">Mangled URL:</span>
77 <a href="${mangled_url}">${mangled_url}</a>
44 </div> 78 </div>
45 79 </div>
46 ${entry.cooked_body} 80
47 81 </div><!-- blog-entry -->
48 <div py:if="role == 'author'">
49 82
50 <!-- privacy settings -->
51 <form action="TODO" method="post">
52 <span title="viewable to everyone">
53 public
54 <input type="radio" name="privacy" value="public"
55 py:attrs="{'checked': entry.privacy=='public' and True or None}"/>
56 </span>
57 <span title="viewable only to your friends">
58 secret
59 <input type="radio" name="privacy" value="secret"
60 py:attrs="{'checked': entry.privacy=='secret' and True or None}"/>
61 </span>
62 <span title="viewable only to you">
63 private
64 <input type="radio" name="privacy" value="private"
65 py:attrs="{'checked': entry.privacy=='private' and True or None}"/>
66 </span>
67 <input type="submit" name="submit" value="Change Privacy" />
68 </form>
69
70 <!-- mangled URL -->
71 <div py:if="entry.privacy != 'public'"
72 py:with="mangled_url = mangledurl(request, entry)">
73 <span title="${'You can give this URL so people may see this %s post without logging in' % entry.privacy}">Mangled URL:</span>
74 <a href="${mangled_url}">${mangled_url}</a>
75 </div>
76 </div>
77
78 </div>
79 </body> 83 </body>
80 84
81 </html> 85 </html>