Changeset 400

Show
Ignore:
Timestamp:
01/23/08 03:15:15 (11 months ago)
Author:
eevee
Message:

Ability pages were showing duplicates of Pokemon that have the same ability twice. (#245)
Also sorted the Pokemon by name.

Location:
veekun/trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • veekun/trunk/lib/Vee/Controller/Dex.pm

    r394 r400  
    319319    $s->{this}       = $row; 
    320320    $s->{generation} = $row->id <= 76 ? 2 : 3;  # TODO: better 
     321 
     322    $s->{pokemon}    = [ 
     323        $row->pokemon(undef, { distinct => 1, order_by => 'name' }) 
     324    ]; 
    321325} 
    322326 
  • veekun/trunk/templates/dex/page/ability.tt

    r320 r400  
    3737</tr> 
    3838[% pokemon_ct = 0 %] 
    39 [% FOR poke IN this.pokemon %] 
     39[% FOR poke IN pokemon %] 
    4040<tr class="color[% pokemon_ct % 2 + 1 %]"><td class="nametree"><a href="[% dex_uri('pokemon', poke.name) %]" class="dex-pokelist"><img src="/dex-images/icons/[% poke.id.pad(3) %].png" alt=""/> [% poke.name %]</a></td>[% pokemon_cells(poke) %]</tr> 
    4141[% pokemon_ct = pokemon_ct + 1 %]