Changeset 33

Show
Ignore:
Timestamp:
03/01/07 22:09:05 (3 years ago)
Author:
eevee
Message:

Changed several templates to use is_empty() rather than first/reset.
Fixed Pokemon breeding partner counting.

Location:
veekun/trunk/templates
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/templates/dex/page/pokemon.tt

    r22 r33  
    265265<p>Also remember that any gendered Pok&eacute;mon can breed with <a href="[% dex_uri('pokemon', 'ditto') %]">Ditto</a>.</p> 
    266266<p>[ <a href="[% tmp = this.breed2 ? [ this.breed1, this.breed2 ] : this.breed1; c.uri('Dex::Search', 'pokemon_search', { breed_mode => 'or', breed => tmp, baseform => 'on' }) %]">baseform Pok&eacute;mon that can breed with [% this.name %]</a> (equivalent to this list); <a href="[% c.uri('Dex::Search', 'pokemon_search', { breed_mode => 'or', breed => tmp }) %]">all Pok&eacute;mon that can breed with [% this.name %]</a> ]</p> 
     267[%     breedables_ct = 0 %] 
    267268[%     WHILE (pokemon = breedables_rs.next) %] 
    268269<a href="[% dex_uri('pokemon', PokemonNames.${pokemon.id}) %]" class="dex-pokelist[% pokemon.gender == 255 ? ' genderless' : '' %]"><img src="/dex-images/icons/[% pokemon.id.pad(3) %].png" alt="[% PokemonNames.${pokemon.id} %]" title="[% PokemonNames.${pokemon.id} %]"/></a> 
    269 [%     END %] 
    270 <div class="total">[% breedables.size %] families total</div> 
     270[%         breedables_ct = breedables_ct + 1 %] 
     271[%     END %] 
     272<div class="total">[% breedables_ct %] families total</div> 
    271273[% END %] 
    272274 
  • veekun/trunk/templates/forum/common.tt

    r24 r33  
    6060 
    6161[% BLOCK show_announcements %][%# announcements_rs %] 
    62 [% RETURN UNLESS announcements_rs.first %] 
    63 [% CALL announcements_rs.reset %] 
     62[% RETURN IF announcements_rs.is_empty %] 
    6463<h2>Announcements</h2> 
    6564[% INCLUDE threads_start -%] 
  • veekun/trunk/templates/forum/index.tt

    r29 r33  
    1010[% forum_flags %] 
    1111[% INCLUDE forums_start %] 
    12 [% IF NOT forums_rs.first %] 
     12[% IF forums_rs.is_empty %] 
    1313[%     INCLUDE forums_message message='Either no forums exist, or all existing forums are blocked from your view.' %] 
    1414[% ELSE %] 
    15 [%     CALL forums_rs.reset %] 
    1615[%     WHILE (f = forums_rs.next) %] 
    1716[%         NEXT IF f.accessibility == 'hidden' AND NOT c.can_i('override_forum_hidden', f.id) %] 
  • veekun/trunk/templates/forum/view.tt

    r24 r33  
    1313[% forum_flags %] 
    1414[% INCLUDE threads_start %] 
    15 [% IF NOT threads_rs.first %] 
     15[% IF threads_rs.is_empty %] 
    1616[%     INCLUDE threads_message message='Either no threads exist, or all existing threads are blocked from your view.' %] 
    1717[% ELSE %] 
    18 [%     CALL threads_rs.reset %] 
    1918[%     WHILE (t = threads_rs.next) %] 
    2019[%         INCLUDE threads_each thread=t %] 
  • veekun/trunk/templates/index.tt

    r24 r33  
    4141   </div> 
    4242[% END %] 
    43 [% IF !recent_news.size %] 
    44    No newsposts found. 
     43[% IF recent_news.is_empty %] 
     44   <p> No newsposts found. </p> 
    4545[% END %] 
    4646  </div> 
     
    5656[%     last_user = u %] 
    5757[% END %] 
    58 [% IF !recent_users.size %] 
    59     Nobody has been on in a while. 
     58[% IF recent_users.is_empty %] 
     59    <p> Nobody has been on in a while. </p> 
    6060[% END -%] 
    6161    </p> 
     
    8484   </div> 
    8585[% END %] 
    86 [% IF !recent_shouts.size %] 
    87    Shoutbox is empty. 
     86[% IF recent_shouts.is_empty %] 
     87   <p> Shoutbox is empty. </p> 
    8888[% END %] 
    8989[%# TODO: permissions here would be nice I suppose~ %] 
     
    122122    </div> 
    123123[% END %] 
    124 [% IF !recent_art.size %] 
    125     Nothing in the gallery. 
     124[% IF recent_art.is_empty %] 
     125    <p> Nothing in the gallery. </p> 
    126126[% END %] 
    127127   </div> 
  • veekun/trunk/templates/shoutbox.tt

    r22 r33  
    11[% PROCESS common.tt %] 
    22 
    3 [% IF !shouts.size %] 
     3[% IF shouts_rs.is_empty %] 
    44<p>There are no shoutbox entries.</p> 
    55[%     RETURN %]