Mercurial > hg > bitsyblog
annotate 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 |
rev | line source |
---|---|
10 | 1 <!DOCTYPE html |
2 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" | |
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
4 <html xmlns="http://www.w3.org/1999/xhtml" | |
11 | 5 xmlns:py="http://genshi.edgewall.org/" |
6 xmlns:xi="http://www.w3.org/2001/XInclude"> | |
8
67c2ccaef869
adding templates for future use with genshi
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
7 |
10 | 8 <head> |
9 <title>${user} - ${site_name}</title> | |
10 | |
15 | 11 <py:for each="index, sheet in enumerate(stylesheets)"> |
12 <link href="${link(request, ('css', sheet))}" | |
13 | 13 type="text/css" |
14 rel="${index and 'alternate stylesheet' or 'stylesheet'}" | |
15 title="sheet.rsplit('.', 1)[0]"/> | |
10 | 16 </py:for> |
17 | |
18 </head> | |
19 | |
20 <body> | |
13 | 21 |
15 | 22 <xi:include href="navigation.html" /> |
10 | 23 |
16 | 24 <!-- blog navigation --> |
25 <div class="navigation" | |
26 py:if="n_links == 0 or len(blog) > 1" | |
27 py:with="_n_links = (n_links != -1) and n_links or len(blog)"> | |
28 <ul> | |
29 <li py:for="index in range(_n_links)" | |
30 py:with="synopsis = blog[index].title()"> | |
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> | |
13 | 36 |
16 | 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> | |
47 </div> | |
10 | 48 |
16 | 49 ${entry.cooked_body} |
50 | |
51 <div py:if="role == 'author'"> | |
11 | 52 |
16 | 53 <!-- privacy settings --> |
54 <form action="TODO" method="post"> | |
55 <span title="viewable to everyone"> | |
56 public | |
57 <input type="radio" name="privacy" value="public" | |
58 py:attrs="{'checked': entry.privacy=='public' and True or None}"/> | |
59 </span> | |
60 <span title="viewable only to your friends"> | |
61 secret | |
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> | |
11 | 72 |
16 | 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> | |
10 | 78 </div> |
16 | 79 </div> |
80 | |
81 </div><!-- blog-entry --> | |
10 | 82 |
83 </body> | |
84 | |
85 </html> |