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

Revision 12796, 2.6 KB checked in by rvelices, 8 years ago (diff)

feature 2541 multisize

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