[26838] | 1 | {combine_script id='jquery.dataTables' load='footer' path='themes/default/js/plugins/jquery.dataTables.js'} |
---|
| 2 | {html_style} |
---|
| 3 | .sorting { background: url({$ROOT_URL}themes/default/js/plugins/datatables/images/sort_both.png) no-repeat center right; cursor:pointer; } |
---|
| 4 | .sorting_asc { background: url({$ROOT_URL}themes/default/js/plugins/datatables/images/sort_asc.png) no-repeat center right; } |
---|
| 5 | .sorting_desc { background: url({$ROOT_URL}themes/default/js/plugins/datatables/images/sort_desc.png) no-repeat center right; } |
---|
| 6 | |
---|
| 7 | .sorting, .sorting_asc, .sorting_desc { |
---|
| 8 | padding: 3px 18px 3px 10px; |
---|
| 9 | } |
---|
| 10 | .sorting_asc_disabled { background: url({$ROOT_URL}themes/default/js/plugins/datatables/images/sort_asc_disabled.png) no-repeat center right; } |
---|
| 11 | .sorting_desc_disabled { background: url({$ROOT_URL}themes/default/js/plugins/datatables/images/sort_desc_disabled.png) no-repeat center right; } |
---|
| 12 | |
---|
| 13 | .dtBar { |
---|
| 14 | text-align:left; |
---|
| 15 | padding-left: 20px; |
---|
| 16 | } |
---|
| 17 | {/html_style} |
---|
| 18 | |
---|
[12650] | 19 | <h2>{$ratings|@count} {'Users'|@translate}</h2> |
---|
| 20 | |
---|
[12624] | 21 | <form action="{$F_ACTION}" method="GET"> |
---|
| 22 | <fieldset> |
---|
[26838] | 23 | <noscript> |
---|
[12624] | 24 | <label>{'Sort by'|@translate} |
---|
| 25 | <select name="order_by"> |
---|
| 26 | {html_options options=$order_by_options selected=$order_by_options_selected} |
---|
| 27 | </select> |
---|
| 28 | </label> |
---|
[26838] | 29 | </noscript> |
---|
[12624] | 30 | <label>{'Number of rates'|@translate}> |
---|
| 31 | <input type="text" size="5" name="f_min_rates" value="{$F_MIN_RATES}"> |
---|
| 32 | </label> |
---|
[26901] | 33 | <label>{'Consensus deviation'|@translate} |
---|
| 34 | <input type="text" size="5" name="consensus_top_number" value="{$CONSENSUS_TOP_NUMBER}"> |
---|
| 35 | {'Best rated'|@translate} |
---|
| 36 | </label> |
---|
| 37 | |
---|
[12624] | 38 | <input type="submit" value="{'Submit'|@translate}"> |
---|
| 39 | </label> |
---|
| 40 | <input type="hidden" name="page" value="rating_user"> |
---|
| 41 | </fieldset> |
---|
| 42 | </form> |
---|
| 43 | |
---|
| 44 | {combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} |
---|
[26838] | 45 | {footer_script} |
---|
| 46 | var oTable = jQuery('#rateTable').dataTable({ |
---|
| 47 | sDom : '<"dtBar"f>rt', |
---|
| 48 | bPaginate: false, |
---|
| 49 | aaSorting: [[4,'desc']], |
---|
| 50 | aoColumnDefs: [ |
---|
[26901] | 51 | /*{ |
---|
| 52 | aTargets: ["dtc_user"] |
---|
| 53 | },*/ |
---|
[26838] | 54 | { |
---|
[26901] | 55 | aTargets: ["dtc_date"], |
---|
| 56 | asSorting: ["desc","asc"] |
---|
[26838] | 57 | }, |
---|
| 58 | { |
---|
| 59 | aTargets: ["dtc_stat"], |
---|
| 60 | asSorting: ["desc","asc"], |
---|
| 61 | bSearchable: false |
---|
| 62 | }, |
---|
| 63 | { |
---|
| 64 | aTargets: ["dtc_rate"], |
---|
| 65 | asSorting: ["desc","asc"], |
---|
| 66 | bSearchable: false |
---|
| 67 | }, |
---|
| 68 | { |
---|
| 69 | aTargets: ["dtc_del"], |
---|
| 70 | bSortable: false, |
---|
| 71 | bSearchable: false |
---|
| 72 | } |
---|
| 73 | ] |
---|
| 74 | }); |
---|
| 75 | |
---|
| 76 | function del(elt,uid,aid){ |
---|
| 77 | if (!confirm('{'Are you sure?'|@translate|@escape:'javascript'}')) |
---|
[12624] | 78 | return false; |
---|
| 79 | var tr = elt; |
---|
| 80 | while ( tr.nodeName != "TR") tr = tr.parentNode; |
---|
| 81 | tr = jQuery(tr).fadeTo(1000, 0.4); |
---|
[26838] | 82 | |
---|
| 83 | (new PwgWS('{$ROOT_URL|@escape:javascript}')).callService( |
---|
| 84 | 'pwg.rates.delete', { user_id:uid, anonymous_id:aid}, |
---|
[12624] | 85 | { |
---|
| 86 | method: 'POST', |
---|
| 87 | onFailure: function(num, text) { tr.stop(); tr.fadeTo(0,1); alert(num + " " + text); }, |
---|
[26838] | 88 | onSuccess: function(result){ |
---|
| 89 | if (result) |
---|
| 90 | oTable.fnDeleteRow(tr[0]); |
---|
| 91 | else |
---|
| 92 | alert(result); |
---|
| 93 | } |
---|
[12624] | 94 | } |
---|
| 95 | ); |
---|
[26838] | 96 | |
---|
[12624] | 97 | return false; |
---|
| 98 | } |
---|
[26838] | 99 | {/footer_script} |
---|
| 100 | <table id="rateTable"> |
---|
| 101 | <thead> |
---|
[12624] | 102 | <tr class="throw"> |
---|
[26838] | 103 | <td class="dtc_user">{'Username'|@translate}</td> |
---|
[26901] | 104 | <td class="dtc_date">{'Last'|@translate}</td> |
---|
[26838] | 105 | <td class="dtc_stat">{'Number of rates'|@translate}</td> |
---|
| 106 | <td class="dtc_stat">{'Average rate'|@translate}</td> |
---|
| 107 | <td class="dtc_stat">{'Variation'|@translate}</td> |
---|
| 108 | <td class="dtc_stat">{'Consensus deviation'|@translate|@replace:' ':'<br>'}</td> |
---|
[26901] | 109 | <td class="dtc_stat">{'Consensus deviation'|@translate|@replace:' ':'<br>'} {$CONSENSUS_TOP_NUMBER}</td> |
---|
[12624] | 110 | {foreach from=$available_rates item=rate} |
---|
[26838] | 111 | <td class="dtc_rate">{$rate}</td> |
---|
[12624] | 112 | {/foreach} |
---|
[26838] | 113 | <td class="dtc_del"></td> |
---|
[12624] | 114 | </tr> |
---|
[26838] | 115 | </thead> |
---|
[12624] | 116 | {foreach from=$ratings item=rating key=user} |
---|
| 117 | <tr> |
---|
| 118 | <td>{$user}</td> |
---|
[26901] | 119 | <td>{$rating.last_date}</td> |
---|
[12624] | 120 | <td>{$rating.count}</td> |
---|
| 121 | <td>{$rating.avg|@number_format:2}</td> |
---|
| 122 | <td>{$rating.cv|@number_format:3}</td> |
---|
[12650] | 123 | <td>{$rating.cd|@number_format:3}</td> |
---|
[26901] | 124 | <td>{if !empty($rating.cdtop)}{$rating.cdtop|@number_format:3}{/if}</td> |
---|
[12624] | 125 | {foreach from=$rating.rates item=rates key=rate} |
---|
| 126 | <td>{if !empty($rates)} |
---|
| 127 | {capture assign=rate_over}{foreach from=$rates item=rate_arr}<img src="{$image_urls[$rate_arr.id].tn}" alt="thumb-{$rate_arr.id}" title="{$rate_arr.date}"></img> |
---|
| 128 | {/foreach}{/capture} |
---|
[12796] | 129 | <a class="cluetip" title="|{$rate_over|@htmlspecialchars}">{$rates|@count}</a> |
---|
[12624] | 130 | {/if}</td> |
---|
| 131 | {/foreach} |
---|
[26838] | 132 | <td><a onclick="return del(this,{$rating.uid},'{$rating.aid}');" class="icon-trash"></a></td> |
---|
[12624] | 133 | </tr> |
---|
| 134 | {/foreach} |
---|
| 135 | </table> |
---|
| 136 | |
---|
| 137 | {combine_script id='jquery.cluetip' load='footer' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'} |
---|
| 138 | {footer_script require='jquery.cluetip'} |
---|
[12650] | 139 | jQuery(document).ready(function(){ldelim} |
---|
| 140 | jQuery('.cluetip').cluetip({ldelim} |
---|
[12796] | 141 | width: {$TN_WIDTH}, showTitle:false, splitTitle: '|' |
---|
[12624] | 142 | }); |
---|
[12650] | 143 | }) |
---|
[12624] | 144 | {/footer_script} |
---|