Skip to content

Commit

Permalink
Update code in dexlib to call the new url and icon helpers
Browse files Browse the repository at this point in the history
Updates #117
  • Loading branch information
magical committed Jul 19, 2019
1 parent f7df522 commit 875b79e
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions splinext/pokedex/templates/pokedex/lib.mako
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,15 @@
<div id="dex-header">
<a href="${url.current(name=c.prev_species.name.lower(), form=None)}" id="dex-header-prev" class="dex-box-link">
<img src="${h.static_uri('spline', 'icons/control-180.png')}" alt="«">
${h.pokedex.pokemon_icon(c.prev_species.default_pokemon, alt="")}
${pokemon_icon(c.prev_species.default_pokemon, alt="")}
${c.prev_species.id}: ${c.prev_species.name}
</a>
<a href="${url.current(name=c.next_species.name.lower(), form=None)}" id="dex-header-next" class="dex-box-link">
${c.next_species.id}: ${c.next_species.name}
${h.pokedex.pokemon_icon(c.next_species.default_pokemon, alt="")}
${pokemon_icon(c.next_species.default_pokemon, alt="")}
<img src="${h.static_uri('spline', 'icons/control.png')}" alt="»">
</a>
${h.pokedex.pokemon_form_image(icon_form or c.pokemon.default_form, prefix='icons')}
${pokemon_form_image(icon_form or c.pokemon.default_form, prefix='icons')}
<br>${c.pokemon.species.id}: ${c.pokemon.species.name}
% if subpages:
<ul class="inline-menu">
Expand Down Expand Up @@ -295,7 +295,7 @@
% if len(column) == len(column[0].generation.version_groups):
## If the entire gen has been collapsed into a single column, just show
## the gen icon instead of the messy stack of version icons
${h.pokedex.generation_icon(column[0].generation)}
${generation_icon(column[0].generation)}
% else:
<%
if move_method:
Expand All @@ -312,7 +312,7 @@
% if i != 0:
<br>
% endif
${h.pokedex.version_group_icon(version_group)}
${version_group_icon(version_group)}
% endfor
% endif
</th>
Expand All @@ -330,9 +330,9 @@
## rather than ignoring all but the first
% for version_group in column:
% if version_group in version_group_data:
${h.pokedex.version_group_icon(version_group)}
${version_group_icon(version_group)}
% elif version_group in c.move_tutor_version_groups:
<span class="no-tutor">${h.pokedex.version_group_icon(version_group)}</span>
<span class="no-tutor">${version_group_icon(version_group)}</span>
% endif
% endfor
</td>
Expand Down Expand Up @@ -365,7 +365,7 @@
% endif
</td>
% elif method.identifier == u'egg':
<td class="dex-moves-egg">${h.pokedex.chrome_img('egg-cropped.png',
<td class="dex-moves-egg">${chrome_img('egg-cropped.png',
alt=h.literal(u"&bull;"))}</td>
% else:
<td>&bull;</td>
Expand Down Expand Up @@ -418,11 +418,11 @@
</%def>

<%def name="pokemon_table_row(pokemon)">
<td class="icon">${h.pokedex.pokemon_icon(pokemon)}</td>
<td>${h.pokedex.pokemon_link(pokemon)}</td>
<td class="icon">${pokemon_icon(pokemon)}</td>
<td>${pokemon_link(pokemon)}</td>
<td class="type2">
% for type in pokemon.types:
${h.pokedex.type_link(type)}
${type_link(type)}
% endfor
</td>
<td class="ability">
Expand All @@ -437,7 +437,7 @@
<em>${_pokemon_ability_link(pokemon.hidden_ability)}</em>
% endif
</td>
<td>${h.pokedex.chrome_img('gender-rates/%d.png' % pokemon.species.gender_rate, alt=h.pokedex.gender_rate_label[pokemon.species.gender_rate])}</td>
<td>${chrome_img('gender-rates/%d.png' % pokemon.species.gender_rate, alt=h.pokedex.gender_rate_label[pokemon.species.gender_rate])}</td>
<td class="egg-group">
% for i, egg_group in enumerate(pokemon.species.egg_groups):
% if i > 0:
Expand Down Expand Up @@ -487,11 +487,11 @@
<td><a href="${url(controller='dex', action='moves', name=move.name.lower())}">${move.name}</a></td>
% if gen_instead_of_type:
## Done on type pages; we already know the type, so show the generation instead
<td class="type">${h.pokedex.generation_icon(move.generation)}</td>
<td class="type">${generation_icon(move.generation)}</td>
% else:
<td class="type">${h.pokedex.type_link(move.type)}</td>
<td class="type">${type_link(move.type)}</td>
% endif
<td class="class">${h.pokedex.damage_class_icon(move.damage_class)}</td>
<td class="class">${damage_class_icon(move.damage_class)}</td>
<td>
% if pp_override and pp_override != move.pp:
<s>${move.pp}</s> <br> ${pp_override}
Expand Down Expand Up @@ -541,11 +541,11 @@ collapse_key = h.pokedex.collapse_flavor_text_key(literal=obdurate)
%>
<dl class="dex-flavor-text${' ' if classes else ''}${classes}">
% for generation, group in h.pokedex.group_by_generation(flavor_text):
<dt class="dex-flavor-generation">${h.pokedex.generation_icon(generation)}</dt>
<dt class="dex-flavor-generation">${generation_icon(generation)}</dt>
<dd>
<dl>
% for versions, text in h.pokedex.collapse_versions(group, key=collapse_key):
<dt>${h.pokedex.version_icons(*versions)}</dt>
<dt>${version_icons(*versions)}</dt>
<dd><p${' class="dex-obdurate"' if obdurate else '' |n}>${text}</p></dd>
% endfor
</dl>
Expand Down Expand Up @@ -613,7 +613,7 @@ cry_url = url(controller='dex', action='media',
elif evolution.trigger.identifier == u'use-item':
chunks.append(h.literal(_(u"Use {article} {item}")).format(
article=h.pokedex.article(evolution.trigger_item.name, _=_),
item=h.pokedex.item_link(evolution.trigger_item, include_icon=False)))
item=item_link(evolution.trigger_item, include_icon=False)))
elif evolution.trigger.identifier == u'shed':
chunks.append(
_(u"Evolve {from_pokemon} ({to_pokemon} will consume "
Expand All @@ -639,7 +639,7 @@ cry_url = url(controller='dex', action='media',
if evolution.held_item_id:
chunks.append(h.literal(_(u"while holding {article} {item}")).format(
article=h.pokedex.article(evolution.held_item.name),
item=h.pokedex.item_link(evolution.held_item, include_icon=False)))
item=item_link(evolution.held_item, include_icon=False)))
if evolution.known_move_id:
chunks.append(h.literal(_(u"knowing {0}")).format(
h.HTML.a(evolution.known_move.name,
Expand Down Expand Up @@ -669,15 +669,15 @@ cry_url = url(controller='dex', action='media',
chunks.append(_(u"when Attack {0} Defense").format(op))
if evolution.party_species_id:
chunks.append(h.literal(_(u"with {0} in the party")).format(
h.pokedex.pokemon_link(evolution.party_species.default_pokemon, include_icon=False)))
pokemon_link(evolution.party_species.default_pokemon, include_icon=False)))
if evolution.party_type_id:
chunks.append(h.literal(_(u"with a {0}-type Pokémon in the party")).format(
h.HTML.a(evolution.party_type.name,
href=url(controller='dex', action='types',
name=evolution.party_type.name.lower()))))
if evolution.trade_species_id:
chunks.append(h.literal(_(u"in exchange for {0}")).format(
h.pokedex.pokemon_link(evolution.trade_species.default_pokemon, include_icon=False)))
pokemon_link(evolution.trade_species.default_pokemon, include_icon=False)))
if evolution.needs_overworld_rain:
chunks.append(_(u'while it is raining outside of battle'))
if evolution.turn_upside_down:
Expand Down

0 comments on commit 875b79e

Please sign in to comment.