source: extensions/Comments_on_Albums/template/admin_comments.tpl @ 15995

Revision 15995, 2.8 KB checked in by mistic100, 7 years ago (diff)

improve anti-spam system (Piwigo 2.5 feature)

Line 
1{* this is a copy of admin/theme/defaults/template/comments.tpl a bit modified *}
2 
3{footer_script}{literal}
4jQuery(document).ready(function(){
5  function highlighComments() {
6    jQuery(".checkComment").each(function() {
7      var parent = jQuery(this).parent('tr');
8      if (jQuery(this).children("input[type=checkbox]").is(':checked')) {
9        jQuery(parent).addClass('selectedComment');
10      }
11      else {
12        jQuery(parent).removeClass('selectedComment');
13      }
14    });
15  }
16
17  jQuery(".checkComment").click(function(event) {
18    var checkbox = jQuery(this).children("input[type=checkbox]");
19    if (event.target.type !== 'checkbox') {
20      jQuery(checkbox).attr('checked', !jQuery(checkbox).is(':checked'));
21    }
22    highlighComments();
23  });
24
25  jQuery("#commentSelectAll").click(function () {
26    jQuery(".checkComment input[type=checkbox]").attr('checked', true);
27    highlighComments();
28    return false;
29  });
30
31  jQuery("#commentSelectNone").click(function () {
32    jQuery(".checkComment input[type=checkbox]").attr('checked', false);
33    highlighComments();
34    return false;
35  });
36
37  jQuery("#commentSelectInvert").click(function () {
38    jQuery(".checkComment input[type=checkbox]").each(function() {
39      jQuery(this).attr('checked', !$(this).is(':checked'));
40    });
41    highlighComments();
42    return false;
43  });
44
45});
46{/literal}{/footer_script}
47
48<div class="titrePage">
49  <h2>{'Pending Comments'|@translate} [{'Albums'|@translate}]</h2>
50</div>
51
52{if !empty($comments) }
53<form method="post" action="{$F_ACTION}" id="pendingComments">
54
55<table>
56  {foreach from=$comments item=comment name=comment}
57    <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}">
58      <td style="width:50px;" class="checkComment">
59        <input type="checkbox" name="comments[]" value="{$comment.ID}">
60      </td>
61      <td>
62        <div class="comment">
63          <a class="illustration" href="{$comment.CAT_URL}"><img src="{$comment.TN_SRC}"><br/>{$comment.CAT_NAME}</a>
64          <p class="commentHeader"><strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p>
65          <blockquote>{$comment.CONTENT}</blockquote>
66        </div>
67      </td>
68    </tr>
69  {/foreach}
70</table>
71
72  <p class="checkActions">
73    {'Select:'|@translate}
74    <a href="#" id="commentSelectAll">{'All'|@translate}</a>,
75    <a href="#" id="commentSelectNone">{'None'|@translate}</a>,
76    <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a>
77  </p>
78
79  <p class="bottomButtons">
80    <input class="submit" type="submit" name="validate_albums" value="{'Validate'|@translate}">
81    <input class="submit" type="submit" name="reject_albums" value="{'Reject'|@translate}">
82  </p>
83
84</form>
85{else}
86{'No pending comment'|@translate}
87{/if}
Note: See TracBrowser for help on using the repository browser.