aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2011-07-25 18:04:50 +0000
committerrvelices <rv-github@modusoptimus.com>2011-07-25 18:04:50 +0000
commit4e4dc79e5162a7d1315b12e94153443552530b9e (patch)
treefeec6972f3ff9eb108ce87fe672414b98da69a85 /themes/default
parent86bc4d1143474dcb5b9a65c1affd62d7e1b14c0c (diff)
feature 2384: improve average rating calculation (still need to update language files)
git-svn-id: http://piwigo.org/svn/trunk@11827 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default')
-rw-r--r--themes/default/js/rating.js2
-rw-r--r--themes/default/template/picture.tpl4
2 files changed, 3 insertions, 3 deletions
diff --git a/themes/default/js/rating.js b/themes/default/js/rating.js
index 668aed930..d69bd5987 100644
--- a/themes/default/js/rating.js
+++ b/themes/default/js/rating.js
@@ -72,7 +72,7 @@ function updateRating(e)
if (gRatingOptions.ratingSummaryElement)
{
var t = gRatingOptions.ratingSummaryText;
- var args =[result.average, result.count], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ );
+ var args =[result.score, result.count, result.average], idx = 0, rexp = new RegExp( /%\.?\d*[sdf]/ );
while (idx<args.length) t=t.replace(rexp, args[idx++]);
gRatingOptions.ratingSummaryElement.innerHTML = t;
}
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl
index 79c5075af..6ffaa7261 100644
--- a/themes/default/template/picture.tpl
+++ b/themes/default/template/picture.tpl
@@ -196,11 +196,11 @@ y.callService(
{if $display_info.average_rate and isset($rate_summary)}
<tr id="Average">
- <td class="label">{'Average rate'|@translate}</td>
+ <td class="label">{'Rating'|@translate}</td>
<td class="value" id="ratingSummary">
{if $rate_summary.count}
{assign var='rate_text' value='%.2f (rated %d times)'|@translate}
- {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count)}
+ {$pwg->sprintf($rate_text, $rate_summary.score, $rate_summary.count, $rate_summary.average)}
{else}
{'no rate'|@translate}
{/if}