Show
Ignore:
Timestamp:
10/31/11 14:11:42 (19 months ago)
Author:
plg
Message:

compatibility with the new Rating Score instead of Average Rate

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • extensions/luciano/template/picture.tpl

    r11049 r12531  
    4141  </div> 
    4242 
    43   {if $display_info.average_rate and isset($rate_summary) } 
     43  {if $display_info.rating_score and isset($rate_summary) } 
    4444  <div id="imageInfoRight"> 
    4545    <div class="value" id="ratingSummary"> 
    46         {'Average rate'|@translate}: 
    47                         {assign var='rate_text' value='%.2f (rated %d times)'|@translate } 
    48                         {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count) } 
     46        {'Rating score'|@translate}: 
     47    {if $rate_summary.count} 
     48        <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({assign var='rate_text' value='%d rates'|@translate}{$pwg->sprintf($rate_text, $rate_summary.count)})</span> 
     49    {else} 
     50        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span> 
     51    {/if} 
    4952    </div> 
    5053     
     
    5255    <form action="{$rating.F_ACTION}" method="post" id="rateForm"> 
    5356      <div> 
    54       {assign var="ratingExploded" value=$rate_summary.average|@explode:'.'} 
     57      {assign var="ratingExploded" value=$rate_summary.score|@explode:'.'} 
    5558      {foreach from=$rating.marks item=mark name=rate_loop} 
    5659        {if !$smarty.foreach.rate_loop.first} | {/if} 
     
    7477  rootUrl: '{$ROOT_URL|@escape:"javascript"}', 
    7578  image_id: {$current.id}, 
    76   ratingSummaryText: "{'Average rate'|@translate}: {'%.2f (rated %d times)'|@translate|@escape:'javascript'}", 
     79  ratingSummaryText: "{'Rating score'|@translate}: %.2f ({'%d rates'|@translate|@escape:'javascript'})", 
    7780  ratingSummaryElement: document.getElementById("ratingSummary") 
    7881{rdelim});