Changeset 14978 for trunk/themes


Ignore:
Timestamp:
May 15, 2012, 12:28:45 AM (12 years ago)
Author:
plg
Message:

bug fixed: move $lang%d rate from admin.lang.php to common.inc.php to display "1 rate" on picture.php when relevant

adapt picture.tpl to display "1 rate" if only 1 rate, instead of "1 rates".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/themes/default/template/picture.tpl

    r14180 r14978  
    218218                <dd>
    219219                {if $rate_summary.count}
    220                         <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>
     220                  {if $rate_summary.count == 1}
     221                    {assign var='rate_text' value='%d rate'|@translate}
     222                  {else}
     223                    {assign var='rate_text' value='%d rates'|@translate}
     224                  {/if}
     225                        <span id="ratingScore">{$rate_summary.score}</span> <span id="ratingCount">({$pwg->sprintf($rate_text, $rate_summary.count)})</span>
    221226                {else}
    222227                        <span id="ratingScore">{'no rate'|@translate}</span> <span id="ratingCount"></span>
     
    252257                                                if (e) e.innerHTML = rating.score;
    253258                                                e = document.getElementById("ratingCount");
    254                                                 if (e) e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
     259                                                if (e) {ldelim}
     260                                                        if (rating.count == 1) {ldelim}
     261                                                                e.innerHTML = "({'%d rate'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
     262                                                        {rdelim}
     263                                                        else {ldelim}
     264                                                                e.innerHTML = "({'%d rates'|@translate|@escape:'javascript'})".replace( "%d", rating.count);
     265                                                        {rdelim}
     266                                                {rdelim}
    255267                                        {rdelim}{rdelim} );
    256268                        {/footer_script}
Note: See TracChangeset for help on using the changeset viewer.