Changeset 12531 for extensions/luciano
- Timestamp:
- Oct 31, 2011, 2:11:42 PM (13 years ago)
- Location:
- extensions/luciano
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/luciano/js/script.js
r5921 r12531 143 143 } 144 144 145 function setNewRate(average, count, stdev, newRating) 146 { 147 ratingSplitted = average.split('.'); 145 function setNewRate(score, count, stdev, newRating) 146 { 147 var score = score+""; 148 ratingSplitted = score.split('.'); 148 149 starFull = ratingSplitted[0]; 149 150 starHalf = (ratingSplitted[1] > 49) ? true : false; … … 190 191 gUserRating = rateButton.initialRateValue; 191 192 for (var i=0; i<gRatingButtons.length; i++) gRatingButtons[i].disabled=false; 192 setNewRate(result. average, result.count, result.stdev, rateButton.initialRateValue);193 setNewRate(result.score, result.count, result.stdev, rateButton.initialRateValue); 193 194 if (gRatingOptions.ratingSummaryElement) 194 195 { -
extensions/luciano/template/picture.tpl
r11049 r12531 41 41 </div> 42 42 43 {if $display_info. average_rate and isset($rate_summary) }43 {if $display_info.rating_score and isset($rate_summary) } 44 44 <div id="imageInfoRight"> 45 45 <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} 49 52 </div> 50 53 … … 52 55 <form action="{$rating.F_ACTION}" method="post" id="rateForm"> 53 56 <div> 54 {assign var="ratingExploded" value=$rate_summary. average|@explode:'.'}57 {assign var="ratingExploded" value=$rate_summary.score|@explode:'.'} 55 58 {foreach from=$rating.marks item=mark name=rate_loop} 56 59 {if !$smarty.foreach.rate_loop.first} | {/if} … … 74 77 rootUrl: '{$ROOT_URL|@escape:"javascript"}', 75 78 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'})", 77 80 ratingSummaryElement: document.getElementById("ratingSummary") 78 81 {rdelim});
Note: See TracChangeset
for help on using the changeset viewer.