source: trunk/admin/themes/default/template/comments.tpl @ 13078

Revision 13078, 2.5 KB checked in by plg, 8 years ago (diff)

feature 2565 added: pending comments screen, highlight selected comments

  • Property svn:eol-style set to LF
Line 
1{footer_script}{literal}
2jQuery(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    if (event.target.type !== 'checkbox') {
17      var checkbox = jQuery(this).children("input[type=checkbox]");
18      jQuery(checkbox).attr('checked', !jQuery(checkbox).is(':checked'));
19      highlighComments();
20    }
21  });
22
23  jQuery("#commentSelectAll").click(function () {
24    jQuery(".checkComment input[type=checkbox]").attr('checked', true);
25    highlighComments();
26    return false;
27  });
28
29  jQuery("#commentSelectNone").click(function () {
30    jQuery(".checkComment input[type=checkbox]").attr('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).attr('checked', !$(this).is(':checked'));
38    });
39    highlighComments();
40    return false;
41  });
42
43});
44{/literal}{/footer_script}
45
46<div class="titrePage">
47  <h2>{'Waiting'|@translate} {$TABSHEET_TITLE}</h2>
48</div>
49
50<h3>{'User comments validation'|@translate}</h3>
51
52{if !empty($comments) }
53<form method="post" action="{$F_ACTION}">
54 
55<table width="99%">
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.U_PICTURE}"><img src="{$comment.TN_SRC}"></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" value="{'Validate'|@translate}">
81    <input class="submit" type="submit" name="reject" value="{'Reject'|@translate}">
82  </p>
83
84</form>
85{/if}
Note: See TracBrowser for help on using the repository browser.