Mercurial > hg > bitsyblog
annotate bitsyblog/templates/blog.html @ 132:bda88f101ba9
py3
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Mon, 28 Dec 2020 20:49:32 +0000 |
parents | 7e7fbdc64cc1 |
children |
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 | |
35
7e7fbdc64cc1
enable atom support, this brings us to 2.0
k0s <k0scist@gmail.com>
parents:
33
diff
changeset
|
11 <!-- stylesheets --> |
17 | 12 <py:for each="index, (href, sheet) in enumerate(stylesheets)"> |
13 <link href="${href}" | |
13 | 14 type="text/css" |
15 rel="${index and 'alternate stylesheet' or 'stylesheet'}" | |
17 | 16 title="${sheet}"/> |
10 | 17 </py:for> |
18 | |
35
7e7fbdc64cc1
enable atom support, this brings us to 2.0
k0s <k0scist@gmail.com>
parents:
33
diff
changeset
|
19 <!-- feeds --> |
7e7fbdc64cc1
enable atom support, this brings us to 2.0
k0s <k0scist@gmail.com>
parents:
33
diff
changeset
|
20 <link rel="alternate" type="application/rss+xml" title="blog - ${user} - RSS" href="${user_url(request, user, 'rss')}"/> |
7e7fbdc64cc1
enable atom support, this brings us to 2.0
k0s <k0scist@gmail.com>
parents:
33
diff
changeset
|
21 <link rel="alternate" type="application/atom+xml" title="blog - ${user} - Atom" href="${user_url(request, user, 'atom')}"/> |
10 | 22 </head> |
23 | |
24 <body> | |
13 | 25 |
15 | 26 <xi:include href="navigation.html" /> |
10 | 27 |
16 | 28 <!-- blog navigation --> |
29 <div class="navigation" | |
24 | 30 py:if="n_links and len(blog) > 1" |
31
4ac11f7992c6
index page now works and so does rss
k0s <k0scist@gmail.com>
parents:
25
diff
changeset
|
31 py:with="_n_links = (n_links != -1) and min(n_links,len(blog)) or len(blog)"> |
16 | 32 <ul> |
33 <li py:for="index in range(_n_links)" | |
34 py:with="synopsis = blog[index].title()"> | |
17 | 35 <a href="#${blog[index].datestamp()}">${blog[index].date.strftime(date_format)}</a><py:if test="synopsis">: ${synopsis}</py:if> |
16 | 36 </li> |
37 </ul> | |
38 <a py:if="_n_links != len(blog)" href="${request.path}?n=all">more</a> | |
39 </div> | |
13 | 40 |
16 | 41 <!-- blog entries --> |
42 <div py:for="entry in blog" | |
25
62c961bb91e6
* allow changing of privacy on blog entries
k0s <k0scist@gmail.com>
parents:
24
diff
changeset
|
43 py:with="datestamp=entry.datestamp(); url=user_url(request, request.user.name, datestamp)" |
62c961bb91e6
* allow changing of privacy on blog entries
k0s <k0scist@gmail.com>
parents:
24
diff
changeset
|
44 id="${entry.datestamp()}" |
62c961bb91e6
* allow changing of privacy on blog entries
k0s <k0scist@gmail.com>
parents:
24
diff
changeset
|
45 class="blog-entry"> |
16 | 46 <a name="${entry.datestamp()}" /> |
47 | |
48 <div class="subject"> | |
25
62c961bb91e6
* allow changing of privacy on blog entries
k0s <k0scist@gmail.com>
parents:
24
diff
changeset
|
49 <a href="${url}">${subject % dict(date=entry.date.strftime(date_format))}</a> |
16 | 50 <em py:if="entry.privacy == 'secret' and role == 'friend'"> |
51 secret | |
52 </em> | |
53 </div> | |
10 | 54 |
16 | 55 ${entry.cooked_body} |
56 | |
57 <div py:if="role == 'author'"> | |
11 | 58 |
16 | 59 <!-- privacy settings --> |
25
62c961bb91e6
* allow changing of privacy on blog entries
k0s <k0scist@gmail.com>
parents:
24
diff
changeset
|
60 <form action="${url}" method="post"> |
16 | 61 <span title="viewable to everyone"> |
62 public | |
63 <input type="radio" name="privacy" value="public" | |
64 py:attrs="{'checked': entry.privacy=='public' and True or None}"/> | |
65 </span> | |
66 <span title="viewable only to your friends"> | |
67 secret | |
68 <input type="radio" name="privacy" value="secret" | |
69 py:attrs="{'checked': entry.privacy=='secret' and True or None}"/> | |
70 </span> | |
71 <span title="viewable only to you"> | |
72 private | |
73 <input type="radio" name="privacy" value="private" | |
74 py:attrs="{'checked': entry.privacy=='private' and True or None}"/> | |
75 </span> | |
76 <input type="submit" name="submit" value="Change Privacy" /> | |
77 </form> | |
11 | 78 |
16 | 79 <!-- mangled URL --> |
80 <div py:if="entry.privacy != 'public'" | |
81 py:with="mangled_url = mangledurl(request, entry)"> | |
82 <span title="${'You can give this URL so people may see this %s post without logging in' % entry.privacy}">Mangled URL:</span> | |
83 <a href="${mangled_url}">${mangled_url}</a> | |
10 | 84 </div> |
16 | 85 </div> |
86 | |
87 </div><!-- blog-entry --> | |
10 | 88 |
89 </body> | |
90 | |
91 </html> |