Changeset 97 for veekun/branches

Show
Ignore:
Timestamp:
04/12/07 01:08:42 (3 years ago)
Author:
eevee
Message:

Restyled move list, Pokemon list, TM list, and TM pages.

Location:
veekun/branches/layout
Files:
9 modified

Legend:

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

    r94 r97  
    311311    #   'me' is the table we are selecting from, listing Pokemon related to any from 'pokemon' 
    312312    $s->{pokemon_rs} = $c->model('DBIC::Pokemon')->search({ 
     313        'me.id'      => { '<=', $Generations[-1]{maxid} }, 
    313314        'pokemon.id' => { 
    314315            -between => [ 
     
    319320    }, { 
    320321        join     => { evchain => 'pokemon' }, 
     322        prefetch => { pokemon_abilities => 'ability' }, 
    321323        group_by => 'me.id', 
    322324        order_by => [ 'pokemon.id ASC', "FIND_IN_SET('baby', me.flags) DESC", 'me.id ASC' ], 
  • veekun/branches/layout/templates/dex/common.tt

    r95 r97  
    5656 
    5757[% pokemon_header = BLOCK %] 
    58  <th class="dextbl-size"> Height </th> <th class="dextbl-size"> Weight </th> 
    59  <th class="dextbl-dualtype" colspan="2"> Type </th> <th class="dextbl-gender"> <img src="/dex-images/gender/x.png" alt="Gender" title="Gender"/> </th> 
    60  <th class="dextbl-breeds"> Egg groups </th> <th class="dextbl-abilities"> Abilities </th> 
    61  <th class="dextbl-stat"> Atk </th> <th class="dextbl-stat"> Def </th> <th class="dextbl-stat"> Sp Atk </th> 
    62  <th class="dextbl-stat"> Sp Def </th> <th class="dextbl-stat"> Speed </th> <th class="dextbl-stat"> HP </th> <th class="dextbl-stat"> Avg </th> 
     58 <th class="size"> Height </th> <th class="size"> Weight </th> 
     59 <th colspan="2"> Type </th> <th class="gender"> <img src="/dex-images/gender/x.png" alt="Gender" title="Gender"/> </th> 
     60 <th class="breeds"> Egg groups </th> <th class="abilities"> Abilities </th> 
     61 <th class="stat"> Atk </th> <th class="stat"> Def </th> <th class="stat"> Sp Atk </th> 
     62 <th class="stat"> Sp Def </th> <th class="stat"> Speed </th> <th class="stat"> HP </th> <th class="stat"> Avg </th> 
    6363[% END %] 
    6464 
    6565[%# same but for pokemon table; requires a full row though since we don't cache all this %] 
    6666[% MACRO pokemon_cells(pokemon) BLOCK %] 
    67  <td title="[% height_metric(pokemon.height) %]"> [% height_imperial(pokemon.height) %] </td> <td title="[% weight_metric(pokemon.weight) %]"> [% weight_imperial(pokemon.weight) %] </td> 
    68  <td class="left"> <a href="[% dex_uri('types', pokemon.type1) %]"><img src="/dex-images/typeicons/[% pokemon.type1 %].png" alt="" class="middle"/> [%+ pokemon.type1 %]</a> </td> 
    69  <td class="left"> [% IF pokemon.type2 %] <a href="[% dex_uri('types', pokemon.type2) %]"><img src="/dex-images/typeicons/[% pokemon.type2 %].png" alt="" class="middle"/> [%+ pokemon.type2 %]</a> [% END %] </td> 
    70  </td> 
    71  <td>[% gender_text(pokemon.gender, 1) %]</td> 
    72  <td> 
     67    <td title="[% height_metric(pokemon.height) %]"> [% height_imperial(pokemon.height) %] </td> <td title="[% weight_metric(pokemon.weight) %]"> [% weight_imperial(pokemon.weight) %] </td> 
     68    <td class="type"> [% type_name(pokemon.type1) %] </td> 
     69    <td class="type"> [% type_name(pokemon.type2) IF pokemon.type2 %] </td> 
     70    </td> 
     71    <td class="gender">[% gender_text(pokemon.gender, 1) %]</td> 
     72    <td class="breeds"> 
    7373[%     FOREACH b IN pokemon.breeds %] 
    74   <a href="[% c.uri('Dex::Search', 'pokemon_search', { breed => b.breed }) %]">[% BreedingGroups.${b.breed} %]</a> 
     74        <a href="[% c.uri('Dex::Search', 'pokemon_search', { breed => b.breed }) %]">[% BreedingGroups.${b.breed} %]</a> 
    7575[%         '<br/>' UNLESS loop.last %] 
    7676[%     END %] 
    77  </td> 
    78  <td> 
     77    </td> 
     78    <td class="abilities"> 
    7979[%     FOREACH a IN pokemon.pokemon_abilities %] 
    8080  <a href="[% c.uri('Dex::Search', 'pokemon_search', { ability => a.ability.id }) %]">[% a.ability.name %]</a> 
    8181[%         '<br/>' UNLESS loop.last %] 
    8282[%     END %] 
    83  </td> 
     83    </td> 
    8484[%     stat_avg = 0 %] 
    8585[%     FOREACH column IN StatColumns %] 
    86 <!-- <td>[% pokemon.$column %]</td> --> 
    87  <td><div class="dex-ministatbar"><div class="dex-ministatbar-bar" style="width: [% pokemon.$column / 255 * 100 %]%; background-color: #[% StatColors.$column %];"></div></div><small>[% pokemon.$column %]</small></td> 
     86    <td class="stat">[% pokemon.$column %]</td> 
    8887[%         stat_avg = stat_avg + pokemon.$column %] 
    8988[%     END %] 
    90 [%     stat_avg = stat_avg / 6; stat_avg = round(stat_avg, 1) %] 
    91  <td><div class="dex-ministatbar"><div class="dex-ministatbar-bar" style="width: [% stat_avg / 255 * 100 %]%; background-color: #[% StatColors.stat_avg %];"></div></div><small>[% stat_avg %]</small></td> 
     89    <td class="stat">[% stat_avg / 6 | format('%.01f') %]</td> 
    9290[%+ END %] 
    93  
    9491[% END %] 
  • veekun/branches/layout/templates/dex/list/moves.tt

    r31 r97  
    1919 
    2020<h1>[% Icons.${ Generations.$gen.abbr } %] Moves: [% Generations.$gen.games %]</h1> 
    21 <table class="dex" cellspacing="0"> 
    22 <tr> 
    23   <th>ID</th> 
     21<table class="dex-table" cellspacing="0"> 
     22<tr class="heading"> 
     23    <th class="number">ID</th> 
    2424[% move_header %] 
    2525</tr> 
    2626[% color = 1 %] 
    2727[% FOREACH moveid IN [ min .. Generations.$gen.maxmoveid ] %] 
    28 <tr class="color[% color %]"><td>[% moveid %]</td>[% move_cells(moveid) %]</tr> 
     28<tr class="color[% color %]"> 
     29    <td class="number">[% moveid %]</td> 
     30[%         move_cells(moveid) %] 
     31</tr> 
    2932[%     color = 3 - color %] 
    3033[% END %] 
  • veekun/branches/layout/templates/dex/list/pokemon.tt

    r31 r97  
    1717 
    1818<h1>[% Icons.${ Generations.$gen.abbr } %] Pok&eacute;mon: [% Generations.$gen.games %]</h1> 
    19 <table class="dex" cellspacing="0"> 
    20 <tr> 
    21   <th style="width: 15px;"><!-- pokeballs --></th> 
    22   <th style="width: 24px;"><!-- eggs --></th> 
    23   <th style="width: 192px;"> Pok&eacute;mon </th> 
     19<p>Dimmed rows are Pok&eacute;mon that were not introduced in this generation. 
     20   They are included to keep families complete even when new evolutions are added in later games.</p> 
     21<table class="dex-table dex-pokemon" cellspacing="0"> 
     22<tr class="heading"> 
     23    <th class="nametree"> Pok&eacute;mon </th> 
    2424[% pokemon_header %] 
    2525</tr> 
    26 [% poke_indents = [ -1 ] %] 
     26[% poke_indents = {} %] 
    2727[% last_evid = 0 %] 
     28[% color = 1 %] 
    2829[% WHILE (poke = pokemon_rs.next) %] 
    29 [%     IF last_evid AND poke.evid != last_evid %] 
    30 <tr><th colspan="20" class="dextbl-line"></th></tr> 
     30[%     IF poke_indents.exists(poke.evparent) %] 
     31[%         poke_indents.${poke.id} = poke_indents.${poke.evparent} + 1 %] 
     32[%     ELSE %] 
     33[%         poke_indents.${poke.id} = poke.flags.match('baby') ? 0 : 1 %] 
    3134[%     END %] 
    32 [%     poke_indents.${poke.id} = poke_indents.${poke.evparent} + 1 %] 
    3335[%     FOREACH poke_gen IN [ 0 .. Generations.max ]; IF Generations.$poke_gen.maxid >= poke.id; LAST; END; END %] 
    34 <tr class="color[% 2 %]"> 
    35   <td>[% IF gen != poke_gen; Icons.${Generations.$poke_gen.abbr}; END %]</td> 
    36   <td>[% IF poke.flags.matches('baby') %]<img src="/dex-images/icons/egg.png" alt="Baby"/>[% END %]</td> 
    37   <td style="text-align: left; padding-left: [% poke_indents.${poke.id} * 16 %]px;"><a href="[% dex_uri('pokemon', poke.name) %]">[% IF gen == poke_gen %]<img src="/dex-images/icons/[% poke.id.pad(3) %].png" alt=""/> [%+ END %][% poke.name %]</a></td> 
     36<tr class="color[% color %][% ' rowgroup' IF last_evid AND poke.evid != last_evid %][% ' dimmed' IF gen != poke_gen %]"> 
     37    <td class="nametree" style="padding-left: [% poke_indents.${poke.id} %]em;"><a href="[% dex_uri('pokemon', poke.name) %]"><img src="/dex-images/icons/[% poke.id.pad(3) %].png" alt=""/> [%+ poke.name %]</a></td> 
    3838[%     pokemon_cells(poke) %] 
    3939</tr> 
    4040[%     last_evid = poke.evid %] 
     41[%     color = 3 - color %] 
    4142[% END %] 
    4243</table> 
  • veekun/branches/layout/templates/dex/list/tms.tt

    r31 r97  
    1414 
    1515<h1><img src="/dex-images/balls/[% Generations.$gen.abbr %].png" alt="" style="vertical-align: baseline"/> TMs: [% Generations.$gen.games %]</h1> 
    16 <table class="dex" cellspacing="0"> 
    17 <tr> 
    18   <th>TM</th> 
     16<table class="dex-table" cellspacing="0"> 
     17<tr class="heading"> 
     18    <th class="tm">TM</th> 
    1919[% move_header %] 
    2020</tr> 
     
    2222[% FOREACH tm IN [ 1 .. TMs.$gen.max ] %] 
    2323[%     NEXT UNLESS TMs.$gen.$tm %] 
    24 <tr class="color[% color %]"><td><img src="/dex-images/tms/[% tm > 100 ? 'hm' : 'tm' %]-[% MoveData.${TMs.$gen.$tm}.type %].png" alt=""/> [% tm_name(tm) %]</td>[% move_cells(TMs.$gen.$tm) %]</tr> 
    25 [% color = 3 - color %] 
     24<tr class="color[% color %]"> 
     25    <td class="tm"><img src="/dex-images/tms/[% tm > 100 ? 'hm' : 'tm' %]-[% MoveData.${TMs.$gen.$tm}.type %].png" alt=""/> [% tm_name(tm) %]</td> 
     26[%     move_cells(TMs.$gen.$tm) %] 
     27</tr> 
     28[%     color = 3 - color %] 
    2629[% END %] 
    2730</table> 
  • veekun/branches/layout/templates/dex/page/pokemon.tt

    r96 r97  
    4343</div> 
    4444<div class="dex-long-box"> 
    45     <h2>Damage Taken By [% type_name(this.type1) %][% IF this.type2; ' '; type_name(this.type2); END %]</h2> 
     45    <h2>Damage Taken</h2> 
    4646    <ul> 
    4747    [% FOREACH type IN TypeNames %] 
     
    378378    <td class="dex-locations-zone">[% location %]</td>[% IF location_columns.section %] <td class="dex-locations-zone">[% section %]</td>[% END %] 
    379379[% IF location_columns.grass %] 
    380     <td>[% methods.grass.level %][% IF methods.grass.rarity %]<div class="rarity-container" title="[% methods.grass.rarity %]%"><div class="rarity-bar" style="width: [% methods.grass.rarity %]%;"></div></div>[% END %]</td> 
     380    <td>[% methods.grass.level %][% IF methods.grass.rarity %]<div class="minibar" title="[% methods.grass.rarity %]%"><div class="minibar-bar" style="width: [% methods.grass.rarity %]%;"></div></div>[% END %]</td> 
    381381[% END %] 
    382382[% IF location_columns.daytime %] 
    383     <td>[% IF methods.daytime %][% methods.daytime.level %][% IF methods.daytime.rarity %]<div class="rarity-container" title="[% methods.daytime.rarity %]%"><div class="rarity-bar" style="width: [% methods.daytime.rarity %]%;"></div></div>[% END %][% END %]</td> 
     383    <td>[% IF methods.daytime %][% methods.daytime.level %][% IF methods.daytime.rarity %]<div class="minibar" title="[% methods.daytime.rarity %]%"><div class="minibar-bar" style="width: [% methods.daytime.rarity %]%;"></div></div>[% END %][% END %]</td> 
    384384[% END %] 
    385385[% IF location_columns.night %] 
    386     <td>[% IF methods.night %][% methods.night.level %][% IF methods.night.rarity %]<div class="rarity-container" title="[% methods.night.rarity %]%"><div class="rarity-bar" style="width: [% methods.night.rarity %]%;"></div></div>[% END %][% END %]</td> 
     386    <td>[% IF methods.night %][% methods.night.level %][% IF methods.night.rarity %]<div class="minibar" title="[% methods.night.rarity %]%"><div class="minibar-bar" style="width: [% methods.night.rarity %]%;"></div></div>[% END %][% END %]</td> 
    387387[% END %] 
    388388[%         FOR m IN ['surfing', 'old-rod', 'good-rod', 'super-rod'] %] 
  • veekun/branches/layout/templates/dex/page/tm.tt

    r1 r97  
    11[% PROCESS 'dex/common.tt' -%] 
    22 
    3 <table class="dex" cellspacing="0"> 
    4 <tr> 
    5   <th><!-- generation --></th> 
    6   [% move_header %] 
     3<h1>Moves Corresponding to [% tm_name(tm_id) %]</h1> 
     4<table class="dex-table" cellspacing="0"> 
     5<tr class="heading"> 
     6    <th class="number">Gen</th> 
     7    [% move_header %] 
    78</tr> 
    89[% color = 1 %] 
    910[% FOREACH tm IN tms %] 
    1011<tr class="color[% color %]"> 
    11   <td>[% dex.Icons.${Generations.${tm.generation}.abbr} %]</td> 
     12    <td class="number">[% Icons.${Generations.${tm.generation}.abbr} %]</td> 
    1213[%     move_cells(tm.moveid) %] 
    1314</tr> 
  • veekun/branches/layout/templates/style/dex.tt

    r96 r97  
    2121a.dex-pokelist img { border: 1px solid transparent; -moz-border-radius: 0.33em; } 
    2222  a.dex-pokelist img:hover { border-color: #802020; background: #d89090; } 
     23 
     24.minibar { border: 1px solid #806640; } 
     25  .minibar .fill { background-color: #c0a680; height: 4px; } 
    2326 
    2427/* main layout chunks */ 
     
    7477.dex-table { width: 100%; } 
    7578  .dex-table td, .dex-table th { padding: 0.25em; } 
     79  .dex-table .number { width: 2em; text-align: center; } 
     80  .dex-table .tm { width: 6em; text-align: center; } 
    7681  .dex-table .level { text-align: center; } 
    7782  .dex-table th.level { width: 2em; }  /* colspan does weird things to tds with widths */ 
     
    8186  .dex-table .power { width: 6em; text-align: center; } 
    8287  .dex-table .acc   { width: 3em; } 
     88  .dex-table .size  { width: 4em; text-align: center; } 
     89  .dex-table .stat  { width: 4em; text-align: center; } 
     90  .dex-table .gender { width: 16px; } 
     91  .dex-table .breeds { width: 6em; text-align: center; } 
     92  .dex-table .abilities { width: 7em; text-align: center; } 
     93  .dex-table .nametree { width: 10em; } 
     94  .dex-table td.nametree { text-align: left; } 
    8395  .dex-table td.acc { text-align: right; } 
    84   .dex-table td.blurb { font-size: 85%; } 
     96  .dex-table td.blurb, 
     97  .dex-table td.breeds, 
     98  .dex-table td.abilities { font-size: 85%; } 
    8599  .dex-table tr.heading th { background: #e6d3b8; color: #806640; border: 1px solid #c0a680; border-left: none; border-right: none; } 
     100  .dex-table tr.rowgroup td { border-top: 2px solid #c0a680; } 
    86101 
    87102/* locations table */ 
    88103.dex-locations { width: auto; } 
    89104  .dex-locations td { padding-left: 1em; padding-right: 1em; text-align: center; } 
    90   .dex-locations .rarity-container { border: 1px solid #806640; } 
    91   .dex-locations .rarity-bar { background-color: #c0a680; height: 4px; } 
     105 
     106/* pokemon table */ 
     107.dex-pokemon { width: auto; } 
    92108 
    93109 
     
    95111 
    96112 
     113 
  • veekun/branches/layout/templates/style/global.tt

    r96 r97  
    1717img { vertical-align: middle; } 
    1818 
    19 .color1 { /* lol nothing */ } 
     19.color1 { background: url(/images/bg-fade.png) #fff5e6 fixed left bottom no-repeat; /* same as #content */ } 
    2020.color2 { background: url(/images/bg-fade.png) #f6e9d6 fixed left bottom no-repeat; } 
    2121  tr.color1:hover, 
    2222  tr.color2:hover { background: url(/images/bg-fade.png) #f2d3c9 fixed left bottom no-repeat; } 
     23.color1.dimmed { background-color: #f6f6f6; } 
     24.color2.dimmed { background-color: #eaeaea; } 
    2325 
    2426/* lazy alignment */