summary refs log tree commit diff stats
path: root/theme/admin/comments.tpl
diff options
context:
space:
mode:
authorStarla Insigna <hatkirby@fourisland.com>2009-08-13 17:46:09 -0400
committerStarla Insigna <hatkirby@fourisland.com>2009-08-13 17:46:09 -0400
commitb5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a (patch)
tree0449277e94a42aa155995a90fd8a89cb3309e7ab /theme/admin/comments.tpl
parent6a1d5b60e6ec541a36727b84b71168f62221f7d7 (diff)
downloadfourisland-b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a.tar.gz
fourisland-b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a.tar.bz2
fourisland-b5736e3ad3830fa732dcbd1a518ec3dd6ea7b98a.zip
Rewrote Admin panel
The following database changes must be made:

* A TEXT column called "text" must be added to the end of "polloftheweek"
* The transferPollRss.php script must be run
* The "pollrss" table must be dropped

Closes #113
Diffstat (limited to 'theme/admin/comments.tpl')
-rw-r--r--theme/admin/comments.tpl107
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">
6function denyComment(id)
7{
8 if (confirm("Are you sure you would like to deny this comment?"))
9 {
10 postwith("/admin/comments.php?pageID=<!--PAGEID-->&amp;action=deny",{id:id});
11 }
12}
13
14function approveComment(id)
15{
16 postwith("/admin/comments.php?pageID=<!--PAGEID-->&amp;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/
20function 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
35function 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-->&amp;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-->&amp;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-->