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

Last change on this file since 12625 was 12625, checked in by rvelices, 12 years ago

feature 2486: Add an admin view for rates by user - add eol:style lf on previous commit

  • Property svn:eol-style set to LF
File size: 2.4 KB
Line 
1<form action="{$F_ACTION}" method="GET">
2<fieldset>
3        <label>{'Sort by'|@translate}
4                <select name="order_by">
5                        {html_options options=$order_by_options selected=$order_by_options_selected}
6                </select>
7        </label>
8        <label>{'Number of rates'|@translate}&gt;
9        <input type="text" size="5" name="f_min_rates" value="{$F_MIN_RATES}">
10        </label>
11        <input type="submit" value="{'Submit'|@translate}">
12        </label>
13        <input type="hidden" name="page" value="rating_user">
14</fieldset>
15</form>
16
17{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'}
18{footer_script}{literal}
19function del(elt,uid,aid)
20{
21        if (!confirm('{'Are you sure?'|@translate|@escape:'javascript'}'))
22                return false;
23        var tr = elt;
24        while ( tr.nodeName != "TR") tr = tr.parentNode;
25        tr = jQuery(tr).fadeTo(1000, 0.4);
26        var ws = new PwgWS({/literal}'{$ROOT_URL|@escape:javascript}'{literal});
27        ws.callService(
28                'pwg.rates.delete', {user_id:uid, anonymous_id:aid},
29                {
30                        method: 'POST',
31                        onFailure: function(num, text) { tr.stop(); tr.fadeTo(0,1); alert(num + " " + text); },
32                        onSuccess: function(result) { if (result) {tr.remove();} else alert(result); }
33                }
34        );
35        return false;
36}
37{/literal}{/footer_script}
38<table>
39<tr class="throw">
40        <td>{'Username'|@translate}</td>
41        <td>{'Number of rates'|@translate}</td>
42        <td>{'Average rate'|@translate}</td>
43        <td>StDev</td>
44        <td>CV</td>
45{foreach from=$available_rates item=rate}
46        <td>{$rate}</td>
47{/foreach}
48        <td></td>
49</tr>
50{foreach from=$ratings item=rating key=user}
51<tr>
52        <td>{$user}</td>
53        <td>{$rating.count}</td>
54        <td>{$rating.avg|@number_format:2}</td>
55        <td>{$rating.std|@number_format:3}</td>
56        <td>{$rating.cv|@number_format:3}</td>
57        {foreach from=$rating.rates item=rates key=rate}
58        <td>{if !empty($rates)}
59                {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>
60                {/foreach}{/capture}
61                <a class="cluetip" title="{$rate_over|@htmlspecialchars}">{$rates|@count}</a>
62                {/if}</td>
63        {/foreach}
64        <td><a onclick="return del(this,{$rating.uid},'{$rating.aid}');"><img src="{$themeconf.admin_icon_dir}/delete.png" alt="[{'Delete'|@translate}]"></a></td>
65</tr>
66{/foreach}
67</table>
68
69{combine_script id='jquery.cluetip' load='footer' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
70{footer_script require='jquery.cluetip'}
71{literal}
72        jQuery('.cluetip').cluetip({
73                width: 350,     splitTitle: '|'
74        });
75{/literal}
76{/footer_script}
Note: See TracBrowser for help on using the repository browser.