source: trunk/admin/themes/default/template/rating_user.tpl @ 26900

Last change on this file since 26900 was 26900, checked in by rvelices, 10 years ago

admin rating user improvements

  • add last rate date for user
  • add consensus deviation but only based on the best rated photos (e.g. how much this user tries to change the best rated photos)
  • Property svn:eol-style set to LF
File size: 4.5 KB
Line 
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
19<h2>{$ratings|@count} {'Users'|@translate}</h2>
20
21<form action="{$F_ACTION}" method="GET">
22<fieldset>
23<noscript>
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>
29</noscript>
30        <label>{'Number of rates'|@translate}&gt;
31        <input type="text" size="5" name="f_min_rates" value="{$F_MIN_RATES}">
32        </label>
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
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'}
45{footer_script}
46var oTable = jQuery('#rateTable').dataTable({
47        sDom : '<"dtBar"f>rt',
48        bPaginate: false,
49        aaSorting: [[4,'desc']],
50        aoColumnDefs: [
51                /*{
52                        aTargets: ["dtc_user"]
53                },*/
54                {
55                        aTargets: ["dtc_date"],
56                        asSorting: ["desc","asc"]
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
76function del(elt,uid,aid){
77        if (!confirm('{'Are you sure?'|@translate|@escape:'javascript'}'))
78                return false;
79        var tr = elt;
80        while ( tr.nodeName != "TR") tr = tr.parentNode;
81        tr = jQuery(tr).fadeTo(1000, 0.4);
82
83        (new PwgWS('{$ROOT_URL|@escape:javascript}')).callService(
84                'pwg.rates.delete', { user_id:uid, anonymous_id:aid},
85                {
86                        method: 'POST',
87                        onFailure: function(num, text) { tr.stop(); tr.fadeTo(0,1); alert(num + " " + text); },
88                        onSuccess: function(result){
89                                if (result)
90                                        oTable.fnDeleteRow(tr[0]);
91                                else
92                                        alert(result);
93                        }
94                }
95        );
96       
97        return false;
98}
99{/footer_script}
100<table id="rateTable">
101<thead>
102<tr class="throw">
103        <td class="dtc_user">{'Username'|@translate}</td>
104        <td class="dtc_date">{'Last'|@translate}</td>
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>
109        <td class="dtc_stat">{'Consensus deviation'|@translate|@replace:' ':'<br>'} {$CONSENSUS_TOP_NUMBER}</td>
110{foreach from=$available_rates item=rate}
111        <td class="dtc_rate">{$rate}</td>
112{/foreach}
113        <td class="dtc_del"></td>
114</tr>
115</thead>
116{foreach from=$ratings item=rating key=user}
117<tr>
118        <td>{$user}</td>
119        <td>{$rating.last_date}</td>
120        <td>{$rating.count}</td>
121        <td>{$rating.avg|@number_format:2}</td>
122        <td>{$rating.cv|@number_format:3}</td>
123        <td>{$rating.cd|@number_format:3}</td>
124        <td>{if !empty($rating.cdtop)}{$rating.cdtop|@number_format:3}{/if}</td>
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}
129                <a class="cluetip" title="|{$rate_over|@htmlspecialchars}">{$rates|@count}</a>
130                {/if}</td>
131        {/foreach}
132        <td><a onclick="return del(this,{$rating.uid},'{$rating.aid}');" class="icon-trash"></a></td>
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'}
139jQuery(document).ready(function(){ldelim}
140        jQuery('.cluetip').cluetip({ldelim}
141                width: {$TN_WIDTH}, showTitle:false, splitTitle: '|'
142        });
143})
144{/footer_script}
Note: See TracBrowser for help on using the repository browser.