Parent: [743608] (diff)

Child: [3abb2e] (diff)

Download this file

index.html    93 lines (89 with data), 3.5 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
90
91
92
<!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" />
<?python from pyforge.lib.security import has_artifact_access?>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type" py:replace="''"/>
<title>$c.project.name / $c.app.config.options.mount_label / Forums</title>
</head>
<body>
<h1 class="title">$c.app.config.options.mount_label</h1>
<div class="content">
<div class="row">
<div class="column grid_12">
<py:if test="announcements">
<h3>Announcements</h3>
${c.announcements_table.display(value=announcements)}
</py:if>
<div py:for="forum in forums"
py:if="not forum.deleted or has_artifact_access('configure', app=c.app)()">
<h2>$forum.name</h2>
<div py:if="forum.deleted" class="notice">This forum has been deleted and is not visible to non-admin users</div>
${c.subscription_form.display(value=forum, threads=threads[forum._id], action=forum.url() + 'subscribe')}
&nbsp;
<div class="clear"/>
</div>
<form method="POST" enctype="multipart/form-data" id="new_forum_form"
action="${c.project.url()}admin/${c.app.config.options.mount_point}/update_forums"
py:if="has_artifact_access('configure', app=c.app)()">
<input type="button" id="add_forum" value="Add another forum"
/>
<div id="add_forum_form" style="display:none">
<ol>
<li>
<label>Name:</label>
<input type="text" name="new_forum.name"/>
</li>
<li>
<label>Short Name:</label>
<input type="text" name="new_forum.shortname"/>
</li>
<li>
<label>Parent Forum:</label>
<select name="new_forum.parent">
<option value="">None</option>
<option py:for="f in forums" value="$f._id">$f.name</option>
</select>
</li>
<li>
<label>Description:</label>
<textarea name="new_forum.description" style="height:50px;"/>
</li>
<li>
<label>Icon:</label>
${file_field('new_forum.icon', '')}
</li>
<li>
<label>&nbsp;</label>
<input type="submit" id="new_forum.create" name="new_forum.create" value="Create Forum"
/>
<input type="button" id="add_forum_cancel" value="Cancel"
/>
</li>
</ol>
</div>
<div class="clear"/>
</form>
</div>
</div>
</div>
</body>
<script type="text/javascript" py:if="has_artifact_access('configure', app=c.app)()">
$(function() {
$("#add_forum").click(function(){
$("#add_forum_form").show();
$(this).hide();
return false;
});
$("#add_forum_cancel").click(function(){
$("#add_forum_form").hide();
$("#add_forum").show();
return false;
});
});
</script>
</html>