Mercurial > genshi > mirror
annotate examples/tutorial/geddit/templates/info.html @ 722:1ec766e4f753 trunk
Fix trailing whitespace.
author | jruigrok |
---|---|
date | Mon, 21 Apr 2008 19:16:43 +0000 |
parents | f779e566884d |
children |
rev | line source |
---|---|
611
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
1 <!DOCTYPE html> |
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
2 <html xmlns="http://www.w3.org/1999/xhtml" |
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
3 xmlns:xi="http://www.w3.org/2001/XInclude" |
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
4 xmlns:py="http://genshi.edgewall.org/"> |
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
5 <xi:include href="layout.html" /> |
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
6 <head> |
619
756e7418e10c
GenshiTutorial: various updates to sync with wiki page.
cmlenz
parents:
618
diff
changeset
|
7 <title>${link.title}</title> |
628
9822dfff0fd5
GenshiTutorial: tweaks to sync with code on wiki page.
cmlenz
parents:
625
diff
changeset
|
8 <link rel="alternate" type="application/atom+xml" title="Geddit: ${link.title}" |
9822dfff0fd5
GenshiTutorial: tweaks to sync with code on wiki page.
cmlenz
parents:
625
diff
changeset
|
9 href="${url('/feed/%s/' % link.id)}" /> |
625 | 10 <script type="text/javascript"> |
11 function loadCommentForm(a) { | |
12 $.get("${url('/comment/%s/' % link.id)}", {}, function(html) { | |
13 var form = a.hide().parent().after(html).next(); | |
14 function closeForm() { | |
15 form.slideUp("fast", function() { a.fadeIn(); form.remove() }); | |
16 return false; | |
17 } | |
18 function initForm() { | |
19 form.find("input[@name='cancel']").click(closeForm); | |
20 form.submit(function() { | |
21 var data = form.find("input[@type='text'], textarea").serialize(); | |
22 $.post("${url('/comment/%s/' % link.id)}", data, function(html) { | |
23 var elem = $(html).get(0); | |
24 if (/form/i.test(elem.tagName)) { | |
25 form.after(elem).remove(); | |
26 form = $(elem); | |
27 initForm(); | |
28 } else { | |
29 if ($("ul.comments").length == 0) { | |
30 a.parent().before('<ul class="comments"></ul>'); | |
31 } | |
628
9822dfff0fd5
GenshiTutorial: tweaks to sync with code on wiki page.
cmlenz
parents:
625
diff
changeset
|
32 $("ul.comments").append($(elem)); |
625 | 33 closeForm(); |
34 } | |
35 }); | |
36 return false; | |
37 }); | |
38 } | |
39 initForm(); | |
40 }); | |
41 } | |
42 $(document).ready(function() { | |
43 $("a.action").click(function() { | |
44 loadCommentForm($(this)); | |
45 return false; | |
46 }); | |
47 }); | |
48 </script> | |
611
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
49 </head> |
633
f779e566884d
GenshiTutorial: add body class to show that the ''@*'' XPath in the match template works.
cmlenz
parents:
628
diff
changeset
|
50 <body class="info"> |
619
756e7418e10c
GenshiTutorial: various updates to sync with wiki page.
cmlenz
parents:
618
diff
changeset
|
51 <h1>${link.title}</h1> |
756e7418e10c
GenshiTutorial: various updates to sync with wiki page.
cmlenz
parents:
618
diff
changeset
|
52 <a href="${link.url}">${link.url}</a><br /> |
621 | 53 posted by ${link.username} at ${link.time.strftime('%x %X')}<br /> |
622 | 54 |
619
756e7418e10c
GenshiTutorial: various updates to sync with wiki page.
cmlenz
parents:
618
diff
changeset
|
55 <ul py:if="link.comments" class="comments"> |
625 | 56 <xi:include href="_comment.html" |
57 py:for="num, comment in enumerate(link.comments)" /> | |
618
b6706f9346ac
Simplify the tutorial project: comments are now flat, not hierarchical.
cmlenz
parents:
615
diff
changeset
|
58 </ul> |
625 | 59 |
628
9822dfff0fd5
GenshiTutorial: tweaks to sync with code on wiki page.
cmlenz
parents:
625
diff
changeset
|
60 <p><a class="action" href="${url('/comment/%s/' % link.id)}">Add comment</a></p> |
611
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
61 </body> |
236c351928a2
Add current code for GenshiTutorial to the `examples` directory.
cmlenz
parents:
diff
changeset
|
62 </html> |