Changeset 2594 for trunk/template/yoga
- Timestamp:
- Sep 26, 2008, 3:40:05 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/template/yoga/picture.tpl
r2512 r2594 154 154 <td class="value">{$INFO_VISITS}</td> 155 155 </tr> 156 {if isset($available_permission_levels) } 157 <tr> 158 <td class="label">{'Privacy level'|@translate}:</td> 159 <td class="value"> 160 <script type="text/javascript"> 161 {literal}function setPrivacyLevel(selectElement, rootUrl, id, level) 162 { 163 selectElement.disabled = true; 164 var y = new PwgWS(rootUrl); 165 y.callService( 166 "pwg.images.setPrivacyLevel", {image_id: id, level:level} , 167 { 168 onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); }, 169 onSuccess: function(result) { selectElement.disabled = false; } 170 } 171 ); 172 }{/literal} 173 </script> 174 <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)"> 175 {foreach from=$available_permission_levels item=level} 176 <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option> 177 {/foreach} 178 </select> 179 </td></tr> 180 {/if} 181 182 {if isset($rate_summary) } 183 <tr> 184 <td class="label">{'Average rate'|@translate}</td> 185 <td class="value" id="ratingSummary"> 186 {if $rate_summary.count} 187 {assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate } 188 {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) } 189 {else} 190 {'no_rate'|@translate} 191 {/if} 192 </td> 193 </tr> 194 {/if} 156 157 {if isset($rate_summary) } 158 <tr> 159 <td class="label">{'Average rate'|@translate}</td> 160 <td class="value" id="ratingSummary"> 161 {if $rate_summary.count} 162 {assign var='rate_text' value='%.2f (rated %d times, standard deviation = %.2f)'|@translate } 163 {$pwg->sprintf($rate_text, $rate_summary.average, $rate_summary.count, $rate_summary.std) } 164 {else} 165 {'no_rate'|@translate} 166 {/if} 167 </td> 168 </tr> 169 {/if} 195 170 196 171 {if isset($rating)} … … 205 180 {if !$smarty.foreach.rate_loop.first} | {/if} 206 181 {if isset($rating.USER_RATE) && $mark==$rating.USER_RATE} 207 <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" />182 <input type="button" name="rate" value="{$mark}" class="rateButtonSelected" title="{$mark}" /> 208 183 {else} 209 <input type="submit" name="rate" value="{$mark}" class="rateButton" />184 <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}" /> 210 185 {/if} 211 186 {/foreach} … … 220 195 </td> 221 196 </tr> 197 {/if} 198 199 {if isset($available_permission_levels) } 200 <tr> 201 <td class="label">{'Privacy level'|@translate}:</td> 202 <td class="value"> 203 <script type="text/javascript"> 204 {literal}function setPrivacyLevel(selectElement, rootUrl, id, level) 205 { 206 selectElement.disabled = true; 207 var y = new PwgWS(rootUrl); 208 y.callService( 209 "pwg.images.setPrivacyLevel", {image_id: id, level:level} , 210 { 211 onFailure: function(num, text) { selectElement.disabled = false; alert(num + " " + text); }, 212 onSuccess: function(result) { selectElement.disabled = false; } 213 } 214 ); 215 }{/literal} 216 </script> 217 <select onchange="setPrivacyLevel(this, '{$ROOT_URL|@escape:'javascript'}', {$current.id}, this.options[selectedIndex].value)"> 218 {foreach from=$available_permission_levels item=level} 219 <option value="{$level}"{if $current.level==$level} selected="selected"{/if}>{$pwg->l10n($pwg->sprintf('Level %d',$level))}</option> 220 {/foreach} 221 </select> 222 </td></tr> 222 223 {/if} 223 224
Note: See TracChangeset
for help on using the changeset viewer.