Changeset 39

Show
Ignore:
Timestamp:
03/07/07 22:52:55 (3 years ago)
Author:
eevee
Message:

Fixed up type pages; counts were broken, moves were broken, and Pokemon styling was ugly.
Grouped breeding parents by evolution chain.

Location:
veekun/trunk
Files:
5 modified

Legend:

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

    r22 r39  
    696696     
    697697    $s->{this}       = $row; 
    698     $s->{moves}      = $c->model('DBIC::Moves')->search({ type => $row->name }, { order_by => 'name ASC', columns => ['id'] }); 
    699     $s->{pokemon_rs} = $c->model('DBIC::Pokemon')->search( 
    700         [ type1 => $row->name, type2 => $row->name ], 
    701         { order_by => 'name ASC', columns => [qw/id name type1 type2/] } 
    702     ); 
     698    $s->{moves_rs}   = $c->model('DBIC::Moves')->search({ type => $row->name }, { order_by => 'name ASC', columns => ['id'] }); 
     699    $s->{pokemon_rs} = $c->model('DBIC::Pokemon')->search( { 
     700        id => { '<=', $Generations[-1]{maxid} }, 
     701        -or => [ type1 => $row->name, type2 => $row->name ], 
     702    }, { 
     703        order_by => 'name ASC', 
     704        columns => [qw/ id name type1 type2 /], 
     705    } ); 
    703706 
    704707    $s->{template} = 'dex/page/type.tt'; 
  • veekun/trunk/lib/Vee/Controller/Dex/Utils.pm

    r37 r39  
    175175    }, { 
    176176        prefetch => 'pokemon', 
     177        order_by => 'pokeid ASC', 
     178        group_by => 'pokemon.evid', 
    177179    }); 
    178180 
  • veekun/trunk/root/style/dex.css

    r1 r39  
    5454table.dex-stats tr td.dex-stats-data { width: 56px; text-align: center; } 
    5555 
     56a.dex-pokelist img { margin: 0.2em 0; } 
    5657a.dex-pokelist:hover img { background-color: #385a7c !important; background-image: none !important; -moz-border-radius: 4px; } 
    5758 
  • veekun/trunk/root/style/dex.types.css

    r1 r39  
    3737.type-steel, .type-fire,   .type-water,    .type-grass,  .type-electric, .type-psychic, .type-ice,  .type-dragon, .type-dark, 
    3838.type-cool,  .type-beauty, .type-cute,     .type-smart,  .type-tough 
    39     { font-size: 10px; xtext-transform: uppercase; border-style: outset; border-width: 1px; letter-spacing: 0.5px; color: black !important; vertical-align: middle; padding: 2px; } 
     39    { font-size: 10px; letter-spacing: 0.5px; color: black !important; vertical-align: middle; } 
    4040.type-none a,  .type-normal a, .type-fighting a, .type-flying a, .type-poison a,   .type-ground a,  .type-rock a, .type-bug a,    .type-ghost a, 
    4141.type-steel a, .type-fire a,   .type-water a,    .type-grass a,  .type-electric a, .type-psychic a, .type-ice a,  .type-dragon a, .type-dark a, 
  • veekun/trunk/templates/dex/page/type.tt

    r22 r39  
    5858<h1>Pok&eacute;mon</h1> 
    5959<p><a href="[% c.uri('Dex::Search', 'pokemon_search', { view => 'icons', type_mode => 'any', type => this.name }) %]">This type in the Pok&eacute;mon search</a></p> 
     60[% pokemon_ct = 0 %] 
    6061[% WHILE (poke = pokemon_rs.next) %] 
    61 <a href="[% dex_uri('pokemon', poke.name) %]" class="[% IF poke.type2; 'type-'; IF poke.type1 == this.name; poke.type2; ELSE; poke.type1; END; ' '; END %]dex-pokelist"><img src="/dex-images/icons/[% poke.id.pad(3) %].png" alt="[% poke.name %]" title="[% poke.name %]: [% poke.type1 %][% '/' _ poke.type2 IF poke.type2 %]"/></a> 
     62<a href="[% dex_uri('pokemon', poke.name) %]" class="dex-pokelist"><img src="/dex-images/icons/[% poke.id.pad(3) %].png" alt="[% poke.name %]" title="[% poke.name %]: [% poke.type1 %][% '/' _ poke.type2 IF poke.type2 %]" class="[% IF poke.type2; 'type-'; IF poke.type1 == this.name; poke.type2; ELSE; poke.type1; END; END %]"/></a> 
     63[% pokemon_ct = pokemon_ct + 1 %] 
    6264[% END %] 
    63 <div class="total">[% pokemon.size %] Pok&eacute;mon total</div> 
     65<div class="total">[% pokemon_ct %] Pok&eacute;mon total</div> 
    6466 
    6567<!-- ####################################################################### --> 
    6668 
    6769<h1>Moves</h1> 
    68 [% UNLESS moves %]<p>No moves of this type..  wtf?!</p>[% RETURN %][% END %] 
     70[% IF moves_rs.is_empty %]<p>No moves of this type..  wtf?!</p>[% END %] 
    6971 
    7072[% color = 1 %] 
     
    7476</tr> 
    7577 
    76 [% FOREACH move IN moves %] 
     78[% moves_ct = 0 %] 
     79[% WHILE (move = moves_rs.next) %] 
    7780<tr class="color[% color %]"> 
    7881[%     move_cells(move.id) %] 
    7982</tr> 
     83[%     moves_ct = moves_ct + 1 %] 
    8084[%     color = 3 - color %] 
    8185[% END %] 
    8286</table> 
    83 <div class="total">[% moves.size %] moves total</div> 
     87<div class="total">[% moves_ct %] moves total</div> 
    8488 
    8589<!-- ####################################################################### -->