1 | {footer_script}{literal} |
---|
2 | jQuery(document).ready(function(){ |
---|
3 | function highlighComments() { |
---|
4 | jQuery(".checkComment").each(function() { |
---|
5 | var parent = jQuery(this).parent('tr'); |
---|
6 | if (jQuery(this).children("input[type=checkbox]").is(':checked')) { |
---|
7 | jQuery(parent).addClass('selectedComment'); |
---|
8 | } |
---|
9 | else { |
---|
10 | jQuery(parent).removeClass('selectedComment'); |
---|
11 | } |
---|
12 | }); |
---|
13 | } |
---|
14 | |
---|
15 | jQuery(".checkComment").click(function(event) { |
---|
16 | var checkbox = jQuery(this).children("input[type=checkbox]"); |
---|
17 | if (event.target.type !== 'checkbox') { |
---|
18 | jQuery(checkbox).prop('checked', !jQuery(checkbox).prop('checked')); |
---|
19 | } |
---|
20 | highlighComments(); |
---|
21 | }); |
---|
22 | |
---|
23 | jQuery("#commentSelectAll").click(function () { |
---|
24 | jQuery(".checkComment input[type=checkbox]").prop('checked', true); |
---|
25 | highlighComments(); |
---|
26 | return false; |
---|
27 | }); |
---|
28 | |
---|
29 | jQuery("#commentSelectNone").click(function () { |
---|
30 | jQuery(".checkComment input[type=checkbox]").prop('checked', false); |
---|
31 | highlighComments(); |
---|
32 | return false; |
---|
33 | }); |
---|
34 | |
---|
35 | jQuery("#commentSelectInvert").click(function () { |
---|
36 | jQuery(".checkComment input[type=checkbox]").each(function() { |
---|
37 | jQuery(this).prop('checked', !$(this).prop('checked')); |
---|
38 | }); |
---|
39 | highlighComments(); |
---|
40 | return false; |
---|
41 | }); |
---|
42 | |
---|
43 | }); |
---|
44 | {/literal}{/footer_script} |
---|
45 | |
---|
46 | <h2>{'User comments'|@translate} {$TABSHEET_TITLE}</h2> |
---|
47 | |
---|
48 | <p style="text-align:left;margin-left:1em;"> |
---|
49 | <a href="{$F_ACTION}&filter=all" class="{if $filter == 'all'}commentFilterSelected{/if}">{'All'|@translate}</a> ({$nb_total}) |
---|
50 | | <a href="{$F_ACTION}&filter=pending" class="{if $filter == 'pending'}commentFilterSelected{/if}">{'Waiting'|@translate}</a> ({$nb_pending}) |
---|
51 | </p> |
---|
52 | |
---|
53 | {if !empty($comments) } |
---|
54 | <form method="post" action="{$F_ACTION}" id="pendingComments"> |
---|
55 | |
---|
56 | <table> |
---|
57 | {foreach from=$comments item=comment name=comment} |
---|
58 | <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}"> |
---|
59 | <td style="width:50px;" class="checkComment"> |
---|
60 | <input type="checkbox" name="comments[]" value="{$comment.ID}"> |
---|
61 | </td> |
---|
62 | <td> |
---|
63 | <div class="comment"> |
---|
64 | <a class="illustration" href="{$comment.U_PICTURE}"><img src="{$comment.TN_SRC}"></a> |
---|
65 | <p class="commentHeader">{if $comment.IS_PENDING}<span class="pendingFlag">{'Waiting'|@translate}</span> - {/if}<strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p> |
---|
66 | <blockquote>{$comment.CONTENT}</blockquote> |
---|
67 | </div> |
---|
68 | </td> |
---|
69 | </tr> |
---|
70 | {/foreach} |
---|
71 | </table> |
---|
72 | |
---|
73 | <p class="checkActions"> |
---|
74 | {'Select:'|@translate} |
---|
75 | <a href="#" id="commentSelectAll">{'All'|@translate}</a>, |
---|
76 | <a href="#" id="commentSelectNone">{'None'|@translate}</a>, |
---|
77 | <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a> |
---|
78 | </p> |
---|
79 | |
---|
80 | <p class="bottomButtons"> |
---|
81 | <input type="submit" name="validate" value="{'Validate'|@translate}"> |
---|
82 | <input type="submit" name="reject" value="{'Reject'|@translate}"> |
---|
83 | </p> |
---|
84 | |
---|
85 | </form> |
---|
86 | {/if} |
---|