Changeset 97 for veekun/branches
- Timestamp:
- 04/12/07 01:08:42 (3 years ago)
- Location:
- veekun/branches/layout
- Files:
-
- 9 modified
-
lib/Vee/Controller/Dex.pm (modified) (2 diffs)
-
templates/dex/common.tt (modified) (1 diff)
-
templates/dex/list/moves.tt (modified) (1 diff)
-
templates/dex/list/pokemon.tt (modified) (1 diff)
-
templates/dex/list/tms.tt (modified) (2 diffs)
-
templates/dex/page/pokemon.tt (modified) (2 diffs)
-
templates/dex/page/tm.tt (modified) (1 diff)
-
templates/style/dex.tt (modified) (4 diffs)
-
templates/style/global.tt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
veekun/branches/layout/lib/Vee/Controller/Dex.pm
r94 r97 311 311 # 'me' is the table we are selecting from, listing Pokemon related to any from 'pokemon' 312 312 $s->{pokemon_rs} = $c->model('DBIC::Pokemon')->search({ 313 'me.id' => { '<=', $Generations[-1]{maxid} }, 313 314 'pokemon.id' => { 314 315 -between => [ … … 319 320 }, { 320 321 join => { evchain => 'pokemon' }, 322 prefetch => { pokemon_abilities => 'ability' }, 321 323 group_by => 'me.id', 322 324 order_by => [ 'pokemon.id ASC', "FIND_IN_SET('baby', me.flags) DESC", 'me.id ASC' ], -
veekun/branches/layout/templates/dex/common.tt
r95 r97 56 56 57 57 [% pokemon_header = BLOCK %] 58 <th class=" dextbl-size"> Height </th> <th class="dextbl-size"> Weight </th>59 <th c lass="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> 63 63 [% END %] 64 64 65 65 [%# same but for pokemon table; requires a full row though since we don't cache all this %] 66 66 [% 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"> 73 73 [% 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> 75 75 [% '<br/>' UNLESS loop.last %] 76 76 [% END %] 77 </td>78 <td>77 </td> 78 <td class="abilities"> 79 79 [% FOREACH a IN pokemon.pokemon_abilities %] 80 80 <a href="[% c.uri('Dex::Search', 'pokemon_search', { ability => a.ability.id }) %]">[% a.ability.name %]</a> 81 81 [% '<br/>' UNLESS loop.last %] 82 82 [% END %] 83 </td>83 </td> 84 84 [% stat_avg = 0 %] 85 85 [% 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> 88 87 [% stat_avg = stat_avg + pokemon.$column %] 89 88 [% 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> 92 90 [%+ END %] 93 94 91 [% END %] -
veekun/branches/layout/templates/dex/list/moves.tt
r31 r97 19 19 20 20 <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> 24 24 [% move_header %] 25 25 </tr> 26 26 [% color = 1 %] 27 27 [% 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> 29 32 [% color = 3 - color %] 30 33 [% END %] -
veekun/branches/layout/templates/dex/list/pokemon.tt
r31 r97 17 17 18 18 <h1>[% Icons.${ Generations.$gen.abbr } %] Poké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émon </th>19 <p>Dimmed rows are Poké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émon </th> 24 24 [% pokemon_header %] 25 25 </tr> 26 [% poke_indents = [ -1 ]%]26 [% poke_indents = {} %] 27 27 [% last_evid = 0 %] 28 [% color = 1 %] 28 29 [% 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 %] 31 34 [% END %] 32 [% poke_indents.${poke.id} = poke_indents.${poke.evparent} + 1 %]33 35 [% 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> 38 38 [% pokemon_cells(poke) %] 39 39 </tr> 40 40 [% last_evid = poke.evid %] 41 [% color = 3 - color %] 41 42 [% END %] 42 43 </table> -
veekun/branches/layout/templates/dex/list/tms.tt
r31 r97 14 14 15 15 <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> 19 19 [% move_header %] 20 20 </tr> … … 22 22 [% FOREACH tm IN [ 1 .. TMs.$gen.max ] %] 23 23 [% 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 %] 26 29 [% END %] 27 30 </table> -
veekun/branches/layout/templates/dex/page/pokemon.tt
r96 r97 43 43 </div> 44 44 <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> 46 46 <ul> 47 47 [% FOREACH type IN TypeNames %] … … 378 378 <td class="dex-locations-zone">[% location %]</td>[% IF location_columns.section %] <td class="dex-locations-zone">[% section %]</td>[% END %] 379 379 [% 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> 381 381 [% END %] 382 382 [% 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> 384 384 [% END %] 385 385 [% 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> 387 387 [% END %] 388 388 [% FOR m IN ['surfing', 'old-rod', 'good-rod', 'super-rod'] %] -
veekun/branches/layout/templates/dex/page/tm.tt
r1 r97 1 1 [% PROCESS 'dex/common.tt' -%] 2 2 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 %] 7 8 </tr> 8 9 [% color = 1 %] 9 10 [% FOREACH tm IN tms %] 10 11 <tr class="color[% color %]"> 11 <td>[% dex.Icons.${Generations.${tm.generation}.abbr} %]</td>12 <td class="number">[% Icons.${Generations.${tm.generation}.abbr} %]</td> 12 13 [% move_cells(tm.moveid) %] 13 14 </tr> -
veekun/branches/layout/templates/style/dex.tt
r96 r97 21 21 a.dex-pokelist img { border: 1px solid transparent; -moz-border-radius: 0.33em; } 22 22 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; } 23 26 24 27 /* main layout chunks */ … … 74 77 .dex-table { width: 100%; } 75 78 .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; } 76 81 .dex-table .level { text-align: center; } 77 82 .dex-table th.level { width: 2em; } /* colspan does weird things to tds with widths */ … … 81 86 .dex-table .power { width: 6em; text-align: center; } 82 87 .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; } 83 95 .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%; } 85 99 .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; } 86 101 87 102 /* locations table */ 88 103 .dex-locations { width: auto; } 89 104 .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; } 92 108 93 109 … … 95 111 96 112 113 -
veekun/branches/layout/templates/style/global.tt
r96 r97 17 17 img { vertical-align: middle; } 18 18 19 .color1 { /* lol nothing*/ }19 .color1 { background: url(/images/bg-fade.png) #fff5e6 fixed left bottom no-repeat; /* same as #content */ } 20 20 .color2 { background: url(/images/bg-fade.png) #f6e9d6 fixed left bottom no-repeat; } 21 21 tr.color1:hover, 22 22 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; } 23 25 24 26 /* lazy alignment */
