[9586] | 1 | {footer_script}{literal} |
---|
| 2 | jQuery(document).ready(function(){ |
---|
[13078] | 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 | |
---|
[9586] | 15 | jQuery(".checkComment").click(function(event) { |
---|
[18064] | 16 | var checkbox = jQuery(this).children("input[type=checkbox]"); |
---|
[5569] | 17 | if (event.target.type !== 'checkbox') { |
---|
[22812] | 18 | jQuery(checkbox).prop('checked', !jQuery(checkbox).prop('checked')); |
---|
[5569] | 19 | } |
---|
[18064] | 20 | highlighComments(); |
---|
[5381] | 21 | }); |
---|
| 22 | |
---|
[9586] | 23 | jQuery("#commentSelectAll").click(function () { |
---|
[22812] | 24 | jQuery(".checkComment input[type=checkbox]").prop('checked', true); |
---|
[13078] | 25 | highlighComments(); |
---|
[5381] | 26 | return false; |
---|
| 27 | }); |
---|
| 28 | |
---|
[9586] | 29 | jQuery("#commentSelectNone").click(function () { |
---|
[22812] | 30 | jQuery(".checkComment input[type=checkbox]").prop('checked', false); |
---|
[13078] | 31 | highlighComments(); |
---|
[5381] | 32 | return false; |
---|
| 33 | }); |
---|
| 34 | |
---|
[9586] | 35 | jQuery("#commentSelectInvert").click(function () { |
---|
| 36 | jQuery(".checkComment input[type=checkbox]").each(function() { |
---|
[22812] | 37 | jQuery(this).prop('checked', !$(this).prop('checked')); |
---|
[5381] | 38 | }); |
---|
[13078] | 39 | highlighComments(); |
---|
[5381] | 40 | return false; |
---|
| 41 | }); |
---|
| 42 | |
---|
| 43 | }); |
---|
[9586] | 44 | {/literal}{/footer_script} |
---|
[5381] | 45 | |
---|
[25084] | 46 | <h2>{'User comments'|@translate} {$TABSHEET_TITLE}</h2> |
---|
[2531] | 47 | |
---|
[25744] | 48 | <div class="commentFilter"> |
---|
[25084] | 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}) |
---|
[25744] | 51 | {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} |
---|
| 52 | </div> |
---|
[25084] | 53 | |
---|
[25744] | 54 | |
---|
| 55 | |
---|
[2531] | 56 | {if !empty($comments) } |
---|
[13079] | 57 | <form method="post" action="{$F_ACTION}" id="pendingComments"> |
---|
[2531] | 58 | |
---|
[13079] | 59 | <table> |
---|
[5381] | 60 | {foreach from=$comments item=comment name=comment} |
---|
| 61 | <tr valign="top" class="{if $smarty.foreach.comment.index is odd}row2{else}row1{/if}"> |
---|
| 62 | <td style="width:50px;" class="checkComment"> |
---|
| 63 | <input type="checkbox" name="comments[]" value="{$comment.ID}"> |
---|
| 64 | </td> |
---|
| 65 | <td> |
---|
[2531] | 66 | <div class="comment"> |
---|
[3185] | 67 | <a class="illustration" href="{$comment.U_PICTURE}"><img src="{$comment.TN_SRC}"></a> |
---|
[25084] | 68 | <p class="commentHeader">{if $comment.IS_PENDING}<span class="pendingFlag">{'Waiting'|@translate}</span> - {/if}<strong>{$comment.AUTHOR}</strong> - <em>{$comment.DATE}</em></p> |
---|
[2531] | 69 | <blockquote>{$comment.CONTENT}</blockquote> |
---|
[2944] | 70 | </div> |
---|
[5381] | 71 | </td> |
---|
| 72 | </tr> |
---|
[2531] | 73 | {/foreach} |
---|
[5381] | 74 | </table> |
---|
[2531] | 75 | |
---|
[5381] | 76 | <p class="checkActions"> |
---|
| 77 | {'Select:'|@translate} |
---|
| 78 | <a href="#" id="commentSelectAll">{'All'|@translate}</a>, |
---|
| 79 | <a href="#" id="commentSelectNone">{'None'|@translate}</a>, |
---|
| 80 | <a href="#" id="commentSelectInvert">{'Invert'|@translate}</a> |
---|
| 81 | </p> |
---|
| 82 | |
---|
[2531] | 83 | <p class="bottomButtons"> |
---|
[22812] | 84 | <input type="submit" name="validate" value="{'Validate'|@translate}"> |
---|
| 85 | <input type="submit" name="reject" value="{'Reject'|@translate}"> |
---|
[2531] | 86 | </p> |
---|
| 87 | |
---|
| 88 | </form> |
---|
[3185] | 89 | {/if} |
---|