Parent: [69d679] (diff)

Download this file

thread.html    90 lines (85 with data), 3.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://genshi.edgewall.org/"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="${g.pyforge_templates}/master.html"/>
<xi:include href="${c.app.templates}/lib.html" />
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title>ForgeForum Index Page</title>
<py:def function="display_post_thread(post_threads)">
<div py:for="pi in post_threads">
<a href="#post-${pi.post.slug}">$pi.post.subject</a>
by <a href="${pi.post.author().url()}">${pi.post.author().display_name}</a>
${h.ago(pi.post.timestamp)}
<br/>
<div py:if="pi.children"
style="border-left:1px solid black; margin-left: 5px; padding-left: 5px">
${display_post_thread(pi.children)}
</div>
</div>
</py:def>
<?python
from pyforge.lib.security import has_artifact_access
?>
</head>
<body>
<div class="breadcrumbs" >
<ul>${crumbs(forum.breadcrumbs())}</ul>
</div>
<h1>$thread.subject</h1>
<p>Thread Shortlink: <input readonly="true" value="[${thread.shorthand_id()}]"/></p>
${page_nav(offset, total, pagesize)}
<div class="title-pane closed" py:if="has_artifact_access('moderate', thread)()">
<span class="title">Moderate thread</span>
<div class="content">
<form method="POST" action="moderate">
${select_field('forum', 'New Forum', [ (f.name, f.shortname) for f in c.app.forums])}
${submit_button('Move thread to new forum')}
${submit_button('Delete thread', 'delete')}
</form>
</div>
</div>
<div class="title-pane closed">
<span class="title" py:if="thread.tags">
Tags:
<py:for each="i,t in enumerate(thread.tags)"><py:if test="i">, </py:if>$t</py:for>
</span>
<span class="title" py:if="not thread.tags">
No tags
</span>
<div class="content">
<py:for each="t in thread.tags">
<a href="${thread.forum.url()}tag/$t/">$t</a>
</py:for><br/>
<form py:if="has_artifact_access('moderate', thread.first_post)()"
method="POST" action="update_tags">
${text_field('new_tag.name', 'New Tag(s) - separate by space')}
<fieldset><legend>Remove Tags</legend>
<py:for each="i, t in enumerate(thread.tags)">
<input type="hidden" name="tag-${i}.name" value="$t"/>
${checkbox('tag-%d.delete' % i, t, False)}
</py:for>
</fieldset>
${submit_button('Update Tags')}
</form>
</div>
</div>
<div py:if="style=='threaded'">
<div style="width:220px; float:left">
${display_post_thread(post_threads)}
</div>
<div style="margin-left: 225px">
<py:for each="post in posts">
${display_post(post)}
</py:for>
</div>
</div>
<div py:if="style!='threaded'">
<py:for each="post in posts">
${display_post(post)}
</py:for>
</div>
</body>
</html>