Ignore:
Timestamp:
01/17/14 23:20:56 (6 years ago)
Author:
rvelices
Message:

merge -r26837 from trunk to branch 2.6
admin rating improvements

  • use web service for deletion
  • use datatables for rating by user
  • use fontello icons
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.6/admin/themes/default/template/rating.tpl

    r12528 r26838  
    4141  <td>{'Average rate'|@translate}</td> 
    4242  <td>{'Sum of rates'|@translate}</td> 
    43   <td>{'Rate'|@translate}</td> 
    44   <td>{'Username'|@translate}</td> 
    45   <td>{'Rate date'|@translate}</td> 
     43  <td>{'Rate'|@translate}/{'Username'|@translate}/{'Rate date'|@translate}</td> 
    4644  <td></td> 
    4745</tr> 
    4846{foreach from=$images item=image name=image} 
    4947<tr valign="top" class="{if $smarty.foreach.image.index is odd}row1{else}row2{/if}"> 
    50         <td rowspan="{$image.NB_RATES_TOTAL+1}"><a href="{$image.U_URL}"><img src="{$image.U_THUMB}" alt="{$image.FILE}" title="{$image.FILE}"></a></td> 
    51         <td rowspan="{$image.NB_RATES_TOTAL+1}"><strong>{$image.NB_RATES}/{$image.NB_RATES_TOTAL}</strong></td> 
    52         <td rowspan="{$image.NB_RATES_TOTAL+1}"><strong>{$image.SCORE_RATE}</strong></td> 
    53         <td rowspan="{$image.NB_RATES_TOTAL+1}"><strong>{$image.AVG_RATE}</strong></td> 
    54         <td rowspan="{$image.NB_RATES_TOTAL+1}" style="border-right: 1px solid;" ><strong>{$image.SUM_RATE}</strong></td> 
     48        <td><a href="{$image.U_URL}"><img src="{$image.U_THUMB}" alt="{$image.FILE}" title="{$image.FILE}"></a></td> 
     49        <td><strong>{$image.NB_RATES}/{$image.NB_RATES_TOTAL}</strong></td> 
     50        <td><strong>{$image.SCORE_RATE}</strong></td> 
     51        <td><strong>{$image.AVG_RATE}</strong></td> 
     52        <td style="border-right:1px solid" ><strong>{$image.SUM_RATE}</strong></td> 
     53        <td> 
     54                <table style="width:100%"> 
     55{foreach from=$image.rates item=rate name=rate} 
     56<tr> 
     57        <td>{$rate.rate}</td> 
     58        <td><b>{$rate.USER}</b></td> 
     59        <td>{$rate.date}</td> 
     60        <td><a onclick="return del(this,{$image.id},{$rate.user_id}{if !empty({$rate.anonymous_id})},'{$rate.anonymous_id}'{/if})" class="icon-trash"> </a></td> 
    5561</tr> 
    56 {foreach from=$image.rates item=rate name=rate} 
    57 <tr class="{if ($smarty.foreach.image.index+$smarty.foreach.rate.index) is odd}row1{else}row2{/if}"> 
    58         <td>{$rate.RATE}</td> 
    59         <td><b>{$rate.USER}</b></td> 
    60         <td>{$rate.DATE}</td> 
    61         <td><a href="{$rate.U_DELETE}"><img src="{$themeconf.admin_icon_dir}/delete.png" alt="[{'Delete'|@translate}]"></a></td> 
     62{/foreach}{*rates*} 
     63                </table> 
     64        </td> 
    6265</tr> 
    63 {/foreach} {*rates*} 
    64 {/foreach} {*images*} 
     66{/foreach}{*images*} 
    6567</table> 
     68{combine_script id='core.scripts' load='async' path='themes/default/js/scripts.js'} 
     69{footer_script} 
     70function del(node,id,uid,aid){ 
     71        var tr = jQuery(node).parents("tr").first().fadeTo(1000, 0.4), 
     72                data = { 
     73                        image_id: id, 
     74                        user_id: uid 
     75                }; 
     76        if (aid) 
     77                data.anonymous_id = aid; 
    6678 
    67 {if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} 
     79        (new PwgWS('{$ROOT_URL|@escape:javascript}')).callService( 
     80                'pwg.rates.delete', data, 
     81                { 
     82                        method: 'POST', 
     83                        onFailure: function(num, text) { tr.stop(); tr.fadeTo(0,1); alert(num + " " + text); }, 
     84                        onSuccess: function(result){ 
     85                                if (result) 
     86                                        tr.remove(); 
     87                                else  
     88                                        alert(result);  
     89                        } 
     90                } 
     91        ); 
     92        return false; 
     93} 
     94{/footer_script} 
     95 
     96{if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} 
Note: See TracChangeset for help on using the changeset viewer.