Changeset 2594


Ignore:
Timestamp:
Sep 26, 2008, 3:40:05 AM (16 years ago)
Author:
rvelices
Message:
  • put the privacy level change select last in the table, added title attribute for the rating stars
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/template/yoga/picture.tpl

    r2512 r2594  
    154154    <td class="value">{$INFO_VISITS}</td>
    155155  </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}
    195170 
    196171{if isset($rating)}
     
    205180                        {if !$smarty.foreach.rate_loop.first} | {/if}
    206181                        {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}" />
    208183                        {else}
    209                           <input type="submit" name="rate" value="{$mark}" class="rateButton" />
     184                          <input type="submit" name="rate" value="{$mark}" class="rateButton" title="{$mark}" />
    210185                        {/if}
    211186                        {/foreach}
     
    220195                </td>
    221196        </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{
     206selectElement.disabled = true;
     207var y = new PwgWS(rootUrl);
     208y.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>
    222223{/if}
    223224
Note: See TracChangeset for help on using the changeset viewer.