aboutsummaryrefslogtreecommitdiffstats
path: root/template/yoga/picture.tpl
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-07-15 01:29:23 +0000
committerrvelices <rv-github@modusoptimus.com>2008-07-15 01:29:23 +0000
commit9c96b905ff3327ad5264b794048b6c71bbc5e4ee (patch)
treea0565907ca8d5546ffcd963c952e331e37109c9a /template/yoga/picture.tpl
parentdf29ffbde72e88635f454d5d6d84c5a7209460f3 (diff)
- image rating on picture page done through ajax (tested safari/ie 6&7/ff)
git-svn-id: http://piwigo.org/svn/trunk@2435 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--template/yoga/picture.tpl10
1 files changed, 7 insertions, 3 deletions
diff --git a/template/yoga/picture.tpl b/template/yoga/picture.tpl
index af22ade18..aec446bd6 100644
--- a/template/yoga/picture.tpl
+++ b/template/yoga/picture.tpl
@@ -162,7 +162,6 @@ y.callService(
{
selectElement.disabled = true;
var y = new PwgWS(rootUrl);
-
y.callService(
"pwg.images.setPrivacyLevel", {image_id: id, level:level} ,
{
@@ -182,7 +181,7 @@ y.callService(
{if isset($rate_summary) }
<tr>
<td class="label">{'Average rate'|@translate}</td>
- <td class="value">
+ <td class="value" id="ratingSummary">
{if $rate_summary.count}
{assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate }
{$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) }
@@ -213,7 +212,7 @@ y.callService(
{if isset($rating)}
<form action="{$rating.F_ACTION}" method="post" id="rateForm">
<div>
-{if isset($rating.USER_RATE)}{'update_rate'|@translate}{else}{'new_rate'|@translate}{/if}
+<span id="updateRate">{if isset($rating.USER_RATE)}{'update_rate'|@translate}{else}{'new_rate'|@translate}{/if}</span>
:
{foreach from=$rating.marks item=mark name=rate_loop}
{if !$smarty.foreach.rate_loop.first} | {/if}
@@ -224,6 +223,11 @@ y.callService(
{/if}
{/foreach}
<script type="text/javascript" src="{$ROOT_URL}{$themeconf.template_dir}/rating.js"></script>
+<script type="text/javascript">
+makeNiceRatingForm( {ldelim}rootUrl: '{$ROOT_URL|@escape:"javascript"}', image_id: {$current.id},
+updateRateText: "{'update_rate'|@translate|@escape:'javascript'}", updateRateElement: document.getElementById("updateRate"),
+ratingSummaryText: "{'%.2f (rated %d times, standard deviation = %.2f)'|@translate|@escape:'javascript'}", ratingSummaryElement: document.getElementById("ratingSummary") {rdelim} );
+</script>
</div>
</form>
{/if}