4f8878ac09c7d52ebce99d2a1025118c866a6d07
[zzz-spline-gts.git] / splinext / gts / templates / gts / list.mako
1 <%inherit file="/base.mako" />
2 <%namespace name="dexlib" file="/pokedex/lib.mako"/>
3
4 <%def name="title()">Stored Pokémon</%def>
5
6 % for savefile in c.savefiles:
7 <div class="gts-pokemon">
8     % if savefile.structure.ivs.is_egg:
9     ${h.pokedex.pokedex_img("heartgold-soulsilver/egg.png", class_='icon')}
10     % else:
11     ${h.pokedex.pokemon_sprite(savefile.species,
12         form=savefile.structure.alternate_form,
13         prefix='heartgold-soulsilver/' + ('shiny/' if savefile.is_shiny else ''),
14         class_='icon')}
15     % endif
16     <div class="header">
17         <div class="name">
18             % if savefile.structure.ivs.is_nicknamed:
19             “${savefile.structure.nickname}”
20             % else:
21             ${savefile.species.full_name}
22             % endif
23             <span class="gender ${savefile.structure.gender}">
24                 % if savefile.structure.gender == 'male':
25                 ♂
26                 % elif savefile.structure.gender == 'female':
27                 ♀
28                 % else:
29                 &empty;
30                 % endif
31             </span>
32         </div>
33         <div class="personality">
34             ${savefile.structure.personality}<br>
35             ${u"0x{0:08x}".format(savefile.structure.personality)}
36         </div>
37     </div>
38
39     ## Met stuff
40     <p>
41         Original trainer:
42         ${savefile.structure.original_trainer_name}
43         ${u'♂' if savefile.structure.original_trainer_gender == 'male' else u'♀'}
44         <img src="${h.static_uri('spline', "flags/{0}.png".format(savefile.structure.original_country))}" alt="${savefile.structure.original_country}">,
45         ID ${"%05d" % savefile.structure.original_trainer_id}
46         <span class="secret-id">/ ${"%05d" % savefile.structure.original_trainer_secret_id}</span>
47     </p>
48     <p>
49         ${h.pokedex.pokedex_img("items/%s.png" % h.pokedex.filename_from_name(savefile.pokeball.name),
50                    alt=savefile.pokeball.name, title=savefile.pokeball.name)}
51         % if savefile.structure.date_egg_received:
52         Egg received on ${savefile.structure.date_egg_received} around ${savefile.egg_location.name}.
53         Hatched on ${savefile.structure.date_met} around ${savefile.met_location.name} at level 1.
54         % else:
55         Encountered via ${savefile.structure.encounter_type}
56         and caught on ${savefile.structure.date_met}
57         around 
58         ${h.pokedex.pokedex_img("versions/{0}.png".format(savefile.structure.original_version))} 
59         ${savefile.met_location.name}
60         at level ${savefile.structure.met_at_level}.
61         % endif
62     </p>
63
64     ## Ribbons
65     <ul class="gts-pokemon-ribbons">
66     % for region, ribbon_container in ('hoenn',  savefile.structure.hoenn_ribbons), \
67                                       ('sinnoh', savefile.structure.sinnoh_ribbons), \
68                                       ('sinnoh', savefile.structure.sinnoh_contest_ribbons):
69         % for ribbon in reversed(ribbon_container.__attrs__):
70         % if ribbon_container[ribbon]:
71         <li>${h.pokedex.pokedex_img("ribbons/{0}/{1}.png".format(region, ribbon.replace(u'_', u'-')), alt=ribbon.replace(u'_', u' ').title(), title=ribbon.replace(u'_', u' ').title())}</li>
72         % endif
73         % endfor
74     % endfor
75     </ul>
76
77     ## Shiny leaves
78     % if savefile.structure.shining_leaves.crown:
79     <p>${h.pokedex.pokedex_img('chrome/leaf-crown.png', alt='Leaf Crown', title='Leaf Crown')}</p>
80     % elif any(savefile.shiny_leaves):
81     <ul class="gts-pokemon-leaves">
82         % for leaf in savefile.shiny_leaves:
83         <li>
84             % if leaf:
85             ${h.pokedex.pokedex_img('chrome/shiny-leaf.png', alt='Shiny Leaf', title='Shiny Leaf')}
86             % endif
87         </li>
88         % endfor
89     </ul>
90     % endif
91
92     <%! from pokedex import formulae %>\
93     <div class="dex-column-container gts-pokemon-columns">
94     <div class="dex-column">
95         <ul class="classic-list">
96             <li>Level ${savefile.level}: ${savefile.structure.exp} EXP</li>
97             % if savefile.exp_to_next:
98             <li>
99                 <div class="gts-bar-container">
100                     <div class="gts-bar" style="width: ${savefile.progress_to_next * 100}%;">&nbsp;${savefile.exp_to_next} to level ${savefile.level + 1}</div>
101                 </div>
102             </li>
103             % endif
104             <li>Has <a href="${url(controller='dex', action='abilities', name=savefile.ability.name.lower())}">${savefile.ability.name}</a></li>
105             <li>
106                 % if savefile.held_item:
107                 Holding ${h.pokedex.item_link(savefile.held_item)}
108                 % else:
109                 Holding nothing
110                 % endif
111             </li>
112             <li>
113                 <div class="gts-bar-container">
114                     <div class="gts-bar" style="width: ${savefile.structure.happiness / 255.0 * 100}%;">&nbsp;${savefile.structure.happiness} happiness</div>
115                 </div>
116             </li>
117
118             % if savefile.structure.fateful_encounter:
119             <li class="fateful-encounter">fateful encounter</li>
120             % endif
121             % if savefile.structure.pokerus:
122             <li>PokéRUS!  ${savefile.structure.pokerus}</li>
123             % endif
124
125             <li>
126                 <ul class="gts-pokemon-markings">
127                     % if savefile.structure.markings.heart:
128                     <li>&#x2665;</li>
129                     % else:
130                     <li>&#x2661;</li>
131                     % endif
132                     % if savefile.structure.markings.diamond:
133                     <li>&#x25c6;</li>
134                     % else:
135                     <li>&#x25c7;</li>
136                     % endif
137                     % if savefile.structure.markings.triangle:
138                     <li>&#x25b2;</li>
139                     % else:
140                     <li>&#x25b3;</li>
141                     % endif
142                     % if savefile.structure.markings.square:
143                     <li>&#x25a0;</li>
144                     % else:
145                     <li>&#x25a1;</li>
146                     % endif
147                     % if savefile.structure.markings.star:
148                     <li>&#x2605;</li>
149                     % else:
150                     <li>&#x2606;</li>
151                     % endif
152                     % if savefile.structure.markings.circle:
153                     <li>&#x25cf;</li>
154                     % else:
155                     <li>&#x25cb;</li>
156                     % endif
157                 </ul>
158             </li>
159         </ul>
160     </div>
161     <div class="dex-column">
162         <table>
163         <thead>
164             <tr class="header-row">
165                 <th></th>
166                 <th>Base</th>
167                 <th>Gene</th>
168                 <th>Exp</th>
169                 <th>Calc</th>
170             </tr>
171         </thead>
172         <tbody>
173             % for stat_info in savefile.stats:
174             <tr>
175                 <th>${stat_info.stat.name}</th>
176                 <td>${stat_info.base}</td>
177                 <td>
178                     <div class="gts-bar-container">
179                         <div class="gts-bar" style="width: ${stat_info.gene / 31.0 * 100}%;">&nbsp;${stat_info.gene}</div>
180                     </div>
181                 </td>
182                 <td>
183                     <div class="gts-bar-container">
184                         <div class="gts-bar" style="width: ${stat_info.exp / 255.0 * 100}%;">&nbsp;${stat_info.exp}</div>
185                     </div>
186                 </td>
187                 <td>${stat_info.calc}</td>
188             </tr>
189             % endfor
190         </tbody>
191         </table>
192     </div>
193     <div class="dex-column">
194         <table>
195         <thead>
196             <tr class="header-row">
197                 <th colspan="2">Contest stats</th>
198             </tr>
199         </thead>
200         <tbody>
201             % for contest_stat in ('beauty', 'cool', 'cute', 'smart', 'tough'):
202             <tr>
203                 <th>${h.pokedex.pokedex_img("chrome/contest/{0}.png".format(contest_stat))}</th>
204                 <td>
205                     <div class="gts-bar-container">
206                         <div class="gts-bar" style="width: ${savefile.structure['contest_' + contest_stat] / 255.0 * 100}%;">&nbsp;${savefile.structure['contest_' + contest_stat]}</div>
207                     </div>
208                 </td>
209             </tr>
210             % endfor
211             <tr>
212                 <th>Sheen</th>
213                 <td>
214                     <div class="gts-bar-container">
215                         <div class="gts-bar" style="width: ${savefile.structure.contest_sheen / 255.0 * 100}%;">&nbsp;${savefile.structure.contest_sheen}</div>
216                     </div>
217                 </td>
218             </tr>
219         </tbody>
220         </table>
221     </div>
222     </div>
223
224     ## Moves
225     <table class="dex-pokemon-moves striped-rows">
226         ${dexlib.move_table_columns()}
227         <thead>
228             <tr class="header-row">
229                 ${dexlib.move_table_header()}
230             </tr>
231         </thead>
232         <tbody>
233             % for move, pp in zip(savefile.moves, savefile.move_pp):
234             <tr>
235                 % if move:
236                 ${dexlib.move_table_row(move, pp_override=pp)}
237                 % else:
238                 ${dexlib.move_table_blank_row()}
239                 % endif
240             </tr>
241             % endfor
242         </tbody>
243     </table>
244 </div>
245 % endfor