Implemented an ugly (but complete!) GTS listing.
[zzz-spline-gts.git] / splinext / gts / templates / gts / list.mako
1 <%inherit file="/base.mako" />
2
3 <%def name="title()">Stored Pokémon</%def>
4
5 % for savefile in c.savefiles:
6 <div class="gts-pokemon">
7     % if savefile.structure.ivs.is_egg:
8     ${h.pokedex.pokedex_img("heartgold-soulsilver/egg.png", class_='icon')}
9     % else:
10     ${h.pokedex.pokedex_img("heartgold-soulsilver/{0}{1}.png".format(
11             'shiny/' if savefile.is_shiny else '',
12             savefile.structure.national_id),
13         class_='icon')}
14     % endif
15     <div class="header">
16         <div class="name">
17             % if savefile.structure.ivs.is_nicknamed:
18             “${savefile.structure.nickname}”
19             % else:
20             ## XXX pokemon name
21             ${savefile.structure.nickname}
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             % if savefile.structure.alternate_form:
33             ~ ${savefile.structure.alternate_form}
34             % endif
35         </div>
36         <div class="personality">
37             ${savefile.structure.personality}<br>
38             ${u"0x{0:08x}".format(savefile.structure.personality)}
39         </div>
40     </div>
41
42     <p>
43         Original trainer:
44         ${savefile.structure.original_trainer_name}
45         ${u'♂' if savefile.structure.original_trainer_gender == 'male' else u'♀'}
46         <img src="${h.static_uri('spline', "flags/{0}.png".format(savefile.structure.original_country))}" alt="${savefile.structure.original_country}">,
47         ID ${savefile.structure.original_trainer_id}
48         <span class="secret-id">/ ${savefile.structure.original_trainer_secret_id}</span>
49     </p>
50     <p>
51         % if savefile.structure.date_egg_received == savefile.structure.date_met:
52         Born and hatched on ${savefile.structure.date_egg_received}
53         % elif savefile.structure.date_egg_received:
54         Born on ${savefile.structure.date_egg_received};
55         hatched on ${savefile.structure.date_met})
56         % else:
57         [${savefile.structure.dppt_pokeball} ${savefile.structure.hgss_pokeball}]
58         Caught on ${savefile.structure.date_met}
59         at level ${savefile.structure.met_at_level}
60         % endif
61
62         at place number ${savefile.structure.dp_met_location_id}
63         or maybe ${savefile.structure.dp_egg_location_id}
64         orrrr ${savefile.structure.pt_met_location_id}
65         or???? ${savefile.structure.pt_egg_location_id}
66         ${h.pokedex.pokedex_img("versions/{0}.png".format(savefile.structure.original_version))}
67
68         ps was a ${savefile.structure.encounter_type}
69         % if savefile.structure.fateful_encounter:
70         also fateful
71         % endif
72     </p>
73
74     <h2>Stats</h2>
75     <dl>
76         <dt>Experience</dt>
77         <dd>${savefile.structure.exp}</dd>
78         <dt>Happiness</dt>
79         <dd>${savefile.structure.happiness}</dd>
80         <dt>Held item</dt>
81         <dd>${savefile.structure.held_item_id}</dd>
82         <dt>Ability</dt>
83         <dd>${savefile.structure.ability_id}</dd>
84         <dt>Pokérus</dt>
85         <dd>${savefile.structure.pokerus}</dd>
86         <dt>Markings</dt>
87         <dd>
88             <ul class="gts-pokemon-markings">
89                 % if savefile.structure.markings.heart:
90                 <li>&#x2665;</li>
91                 % else:
92                 <li>&#x2661;</li>
93                 % endif
94                 % if savefile.structure.markings.diamond:
95                 <li>&#x25c6;</li>
96                 % else:
97                 <li>&#x25c7;</li>
98                 % endif
99                 % if savefile.structure.markings.triangle:
100                 <li>&#x25b2;</li>
101                 % else:
102                 <li>&#x25b3;</li>
103                 % endif
104                 % if savefile.structure.markings.square:
105                 <li>&#x25a0;</li>
106                 % else:
107                 <li>&#x25a1;</li>
108                 % endif
109                 % if savefile.structure.markings.star:
110                 <li>&#x2605;</li>
111                 % else:
112                 <li>&#x2606;</li>
113                 % endif
114                 % if savefile.structure.markings.circle:
115                 <li>&#x25cf;</li>
116                 % else:
117                 <li>&#x25cb;</li>
118                 % endif
119             </ul>
120         </dd>
121         <dt>Shiny leaves</dt>
122         <dd>
123             % if savefile.structure.shining_leaves.crown:
124             ${h.pokedex.pokedex_img('chrome/leaf-crown.png', alt='Leaf Crown', title='Leaf Crown')}
125             % else:
126             <ul class="gts-pokemon-leaves">
127                 % for leaf_n in range(1, 6):
128                 <li>
129                     % if savefile.structure.shining_leaves['leaf' + str(leaf_n)]:
130                     ${h.pokedex.pokedex_img('chrome/shiny-leaf.png', alt='Shiny Leaf', title='Shiny Leaf')}
131                     % endif
132                 </li>
133                 % endfor
134             </ul>
135             % endif
136         </dd>
137         <dt>Ribbons</dt>
138         <dd>
139             <ul class="gts-pokemon-ribbons">
140             % for region, ribbon_container in ('hoenn',  savefile.structure.hoenn_ribbons), \
141                                               ('sinnoh', savefile.structure.sinnoh_ribbons), \
142                                               ('sinnoh', savefile.structure.sinnoh_contest_ribbons):
143                 % for ribbon in reversed(ribbon_container.__attrs__):
144                 % if ribbon_container[ribbon]:
145                 <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>
146                 % endif
147                 % endfor
148             % endfor
149             </ul>
150         </dd>
151     </dl>
152
153     <div class="dex-column-container gts-pokemon-columns">
154     <div class="dex-column">
155         <table>
156         <thead>
157             <tr class="header-row">
158                 <th>Stat</th>
159                 <th>Gene</th>
160                 <th>Exp</th>
161             </tr>
162         </thead>
163         <tbody>
164             <tr>
165                 <th>HP</th>
166                 <td>${savefile.structure.ivs.iv_hp}</td>
167                 <td>${savefile.structure.effort_hp}</td>
168             </tr>
169             <tr>
170                 <th>Attack</th>
171                 <td>${savefile.structure.ivs.iv_attack}</td>
172                 <td>${savefile.structure.effort_attack}</td>
173             </tr>
174             <tr>
175                 <th>Defense</th>
176                 <td>${savefile.structure.ivs.iv_defense}</td>
177                 <td>${savefile.structure.effort_defense}</td>
178             </tr>
179             <tr>
180                 <th>Special Attack</th>
181                 <td>${savefile.structure.ivs.iv_special_attack}</td>
182                 <td>${savefile.structure.effort_special_attack}</td>
183             </tr>
184             <tr>
185                 <th>Special Defense</th>
186                 <td>${savefile.structure.ivs.iv_special_defense}</td>
187                 <td>${savefile.structure.effort_special_defense}</td>
188             </tr>
189             <tr>
190                 <th>Speed</th>
191                 <td>${savefile.structure.ivs.iv_speed}</td>
192                 <td>${savefile.structure.effort_speed}</td>
193             </tr>
194         </tbody>
195         </table>
196     </div>
197     <div class="dex-column">
198         <table>
199         <thead>
200             <tr class="header-row">
201                 <th>move_id</th>
202                 <th>pp</th>
203                 <th>pp_ups</th>
204             </tr>
205         </thead>
206         <tbody>
207             % for i in range(1, 5):
208             <tr>
209                 <td>${savefile.structure['move' + str(i) + '_id']}</td>
210                 <td>${savefile.structure['move' + str(i) + '_pp']}</td>
211                 <td>${savefile.structure['move' + str(i) + '_pp_ups']}</td>
212             </tr>
213             % endfor
214         </tbody>
215         </table>
216     </div>
217     <div class="dex-column">
218         <table>
219         <thead>
220             <tr class="header-row">
221                 <th></th>
222                 <th></th>
223             </tr>
224         </thead>
225         <tbody>
226             % for contest_stat in ('beauty', 'cool', 'cute', 'smart', 'tough'):
227             <tr>
228                 <th>${contest_stat}</th>
229                 <td>${savefile.structure['contest_' + contest_stat]}</td>
230             </tr>
231             % endfor
232         </tbody>
233         </table>
234     </div>
235     </div>
236 </div>
237 % endfor