diff options
Diffstat (limited to 'theme/admin/comments.tpl')
-rw-r--r-- | theme/admin/comments.tpl | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/theme/admin/comments.tpl b/theme/admin/comments.tpl new file mode 100644 index 0000000..6d9f815 --- /dev/null +++ b/theme/admin/comments.tpl | |||
@@ -0,0 +1,107 @@ | |||
1 | <h2>Moderate Comments</h2> | ||
2 | |||
3 | <div class="clear"></div> | ||
4 | |||
5 | <script type="text/javascript"> | ||
6 | function denyComment(id) | ||
7 | { | ||
8 | if (confirm("Are you sure you would like to deny this comment?")) | ||
9 | { | ||
10 | postwith("/admin/comments.php?pageID=<!--PAGEID-->&action=deny",{id:id}); | ||
11 | } | ||
12 | } | ||
13 | |||
14 | function approveComment(id) | ||
15 | { | ||
16 | postwith("/admin/comments.php?pageID=<!--PAGEID-->&action=approve",{id:id}); | ||
17 | } | ||
18 | |||
19 | // following function taken from http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/ | ||
20 | function postwith (to,p) { | ||
21 | var myForm = document.createElement("form"); | ||
22 | myForm.method="post" ; | ||
23 | myForm.action = to ; | ||
24 | for (var k in p) { | ||
25 | var myInput = document.createElement("input") ; | ||
26 | myInput.setAttribute("name", k) ; | ||
27 | myInput.setAttribute("value", p[k]); | ||
28 | myForm.appendChild(myInput) ; | ||
29 | } | ||
30 | document.body.appendChild(myForm) ; | ||
31 | myForm.submit() ; | ||
32 | document.body.removeChild(myForm) ; | ||
33 | } | ||
34 | |||
35 | function bulkAction() | ||
36 | { | ||
37 | var bulk=new Array(); | ||
38 | $(".the-check:checked").each(function() { | ||
39 | bulk.push($(this).val()); | ||
40 | }); | ||
41 | var ids = bulk.join(",") | ||
42 | |||
43 | if (ids != "") | ||
44 | { | ||
45 | if ($('#manage-bulk select').val() == "deny") | ||
46 | { | ||
47 | if (confirm("Are you sure you would like to deny the selected comments?")) | ||
48 | { | ||
49 | postwith("/admin/comments.php?pageID=<!--PAGEID-->&action=denys",{ids:ids}); | ||
50 | } | ||
51 | } else if ($('#manage-bulk select').val() == "approve") | ||
52 | { | ||
53 | if (confirm("Are you sure you would like to approve the selected comments?")) | ||
54 | { | ||
55 | postwith("/admin/comments.php?pageID=<!--PAGEID-->&action=approves",{ids:ids}); | ||
56 | } | ||
57 | } | ||
58 | } | ||
59 | } | ||
60 | |||
61 | $(document).ready(function() { | ||
62 | $("input#all-check").click(function() { | ||
63 | var what = this.checked; | ||
64 | $("input.the-check").each(function() { | ||
65 | this.checked = what; | ||
66 | }); | ||
67 | }); | ||
68 | }); | ||
69 | </script> | ||
70 | |||
71 | <!--BEGIN AVAIL--> | ||
72 | <div id="manage-options"> | ||
73 | <div id="manage-bulk"> | ||
74 | <select name="bulk-type"> | ||
75 | <option value="approve">Approve</option> | ||
76 | <option value="deny">Deny</option> | ||
77 | </select> | ||
78 | |||
79 | <button id="bulk" type="button" onclick="bulkAction()">Bulk</button> | ||
80 | </div> | ||
81 | </div> | ||
82 | |||
83 | <div class="manage-pagination"><!--PAGINATION--></div> | ||
84 | |||
85 | <table> | ||
86 | <tr class="table-header"> | ||
87 | <td class="table-checkbox"><input type="checkbox" id="all-check" /></td> | ||
88 | <td>Comment</td> | ||
89 | <td>Author</td> | ||
90 | <td colspan="2">Actions</td> | ||
91 | </tr> | ||
92 | <!--BEGIN COMMENT--> | ||
93 | <tr<!--COMMENT.ODD-->> | ||
94 | <td class="table-checkbox"><input class="the-check" type="checkbox" name="bulk" value="<!--COMMENT.ID-->" /></td> | ||
95 | <td style="line-height: 1.5em;"><!--COMMENT.TEXT--></td> | ||
96 | <td class="table-author"><!--COMMENT.AUTHOR--></td> | ||
97 | <td class="table-img"><a href="#" onclick="approveComment(<!--COMMENT.ID-->)"><img src="/theme/images/icons/thumb_up.png" alt="Approve" /></a></td> | ||
98 | <td class="table-img"><a href="#" onclick="denyComment(<!--COMMENT.ID-->)"><img src="/theme/images/icons/thumb_down.png" alt="Delete" /></a></td> | ||
99 | </tr> | ||
100 | <!--END COMMENT--> | ||
101 | </table> | ||
102 | |||
103 | <div class="manage-pagination"><!--PAGINATION--></div> | ||
104 | <!--END AVAIL--> | ||
105 | <!--BEGIN NOTAVAIL--> | ||
106 | <div class="manage-pagination">There are no comments to moderate.</div> | ||
107 | <!--END NOTAVAIL--> | ||