Skip to content

Commit

Permalink
update helpers in search pages
Browse files Browse the repository at this point in the history
sed -r -f update-helpers.sed -i templates/pokedex/search/moves.mako templates/pokedex/search/pokemon.mako
  • Loading branch information
magical committed Nov 2, 2018
1 parent bf1a10e commit 2baddc1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
10 changes: 5 additions & 5 deletions splinext/pokedex/templates/pokedex/search/moves.mako
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ ${h.form(url.current(), method='GET')}
% for a_field in c.form.damage_class:
<li> <label>
${a_field() | n}
${h.pokedex.pokedex_img("damage-classes/{0}.png".format(a_field.data), alt=u'')}
${dexlib.pokedex_img("damage-classes/{0}.png".format(a_field.data), alt=u'')}
${a_field.label}
</label> </li>
% endfor
Expand All @@ -131,7 +131,7 @@ ${h.form(url.current(), method='GET')}
% for a_field in c.form.introduced_in:
<li> <label>
${a_field() | n}
${h.pokedex.chrome_img("versions/generation-{0}.png".format(a_field.data), alt=u'')}
${dexlib.chrome_img("versions/generation-{0}.png".format(a_field.data), alt=u'')}
${a_field.label}
</label> </li>
% endfor
Expand Down Expand Up @@ -196,7 +196,7 @@ ${h.form(url.current(), method='GET')}
## always sort ??? last
% for a_field in sorted(c.form.type, key=lambda field: field.label.text):
<li> <label>
${h.pokedex.type_icon(a_field.label.text)}
${dexlib.type_icon(a_field.label.text)}
${a_field() | n}
</label> </li>
% endfor
Expand Down Expand Up @@ -327,11 +327,11 @@ ${h.end_form()}
<%def name="col_type()"><col class="dex-col-type"></%def>
<%def name="th_type()"><th>${_("Type")}</th></%def>
<%def name="td_type(move)"><td>${h.pokedex.type_link(move.type)}</td></%def>
<%def name="td_type(move)"><td>${dexlib.type_link(move.type)}</td></%def>
<%def name="col_class()"><col class="dex-col-type"></%def>
<%def name="th_class()"><th>${_("Class")}</th></%def>
<%def name="td_class(move)"><td>${h.pokedex.damage_class_icon(move.damage_class)}</td></%def>
<%def name="td_class(move)"><td>${dexlib.damage_class_icon(move.damage_class)}</td></%def>
<%def name="col_pp()"><col class="dex-col-stat"></%def>
<%def name="th_pp()"><th>${_("PP")}</th></%def>
Expand Down
22 changes: 11 additions & 11 deletions splinext/pokedex/templates/pokedex/search/pokemon.mako
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ ${getattr(self, 'col_' + column)()}
## Plain bulleted list with a Template.
<ul class="dex-pokemon-search-list classic-list">
% for result in c.results:
<li>${h.pokedex.pokemon_link(result, h.pokedex.apply_pokemon_template(c.display_template, result))}</li>
<li>${dexlib.pokemon_link(result, h.pokedex.apply_pokemon_template(c.display_template, result))}</li>
% endfor
</ul>

Expand All @@ -141,23 +141,23 @@ ${getattr(self, 'col_' + column)()}
## friendly to clipboards.
<div class="dex-pokemon-search-list">
% for result in c.results:
${h.pokedex.pokemon_link(result, h.pokedex.apply_pokemon_template(c.display_template, result))}<br>
${dexlib.pokemon_link(result, h.pokedex.apply_pokemon_template(c.display_template, result))}<br>
% endfor
</div>

% elif c.display_mode == 'icons':
## Grid of icons
<ul class="inline">
% for result in c.results:
<li>${h.pokedex.pokemon_link(result, h.pokedex.pokemon_form_image(result.default_form, prefix=u'icons'), class_='dex-icon-link')}</li>
<li>${dexlib.pokemon_link(result, dexlib.pokemon_form_image(result.default_form, prefix=u'icons'), class_='dex-icon-link')}</li>
% endfor
</ul>

% elif c.display_mode == 'sprites':
## Grid of most recent sprites
<ul class="inline">
% for result in c.results:
<li>${h.pokedex.pokemon_link(result, h.pokedex.pokemon_form_image(result.default_form), class_='dex-icon-link')}</li>
<li>${dexlib.pokemon_link(result, dexlib.pokemon_form_image(result.default_form), class_='dex-icon-link')}</li>
% endfor
</ul>

Expand Down Expand Up @@ -213,7 +213,7 @@ ${h.form(url.current(), method='GET')}
## always sort ??? last
% for a_field in sorted(c.form.type, key=lambda field: field.label.text):
<li> <label>
${h.pokedex.type_icon(a_field.label.text)}
${dexlib.type_icon(a_field.label.text)}
${a_field() | n}
</label> </li>
% endfor
Expand Down Expand Up @@ -391,11 +391,11 @@ ${h.end_form()}
<%def name="col_icon()"><col class="dex-col-icon"></%def>
<%def name="th_icon()"><th></th></%def>
<%def name="td_icon(pokemon)"><td class="icon">${h.pokedex.pokemon_icon(pokemon, alt=False)}</td></%def>
<%def name="td_icon(pokemon)"><td class="icon">${dexlib.pokemon_icon(pokemon, alt=False)}</td></%def>
<%def name="col_name()"><col class="dex-col-name"></%def>
<%def name="th_name()"><th>${_(u"Name")}</th></%def>
<%def name="td_name(pokemon)"><td class="name">${h.pokedex.pokemon_link(pokemon, pokemon.name)}</td></%def>
<%def name="td_name(pokemon)"><td class="name">${dexlib.pokemon_link(pokemon, pokemon.name)}</td></%def>
<%def name="col_growth_rate()"><col class="dex-col-max-exp"></%def>
<%def name="th_growth_rate()"><th>${_(u"EXP to L100")}</th></%def>
Expand All @@ -406,7 +406,7 @@ ${h.end_form()}
<%def name="td_type(pokemon)">\
<td class="type2">
% for type in pokemon.types:
${h.pokedex.type_link(type)}
${dexlib.type_link(type)}
% endfor
</td>\
</%def>
Expand All @@ -433,7 +433,7 @@ ${h.pokedex.type_link(type)}
<%def name="col_gender()"><col class="dex-col-gender"></%def>
<%def name="th_gender()"><th>${_(u"Gender")}</th></%def>
<%def name="td_gender(pokemon)"><td>${h.pokedex.chrome_img('gender-rates/%d.png' % pokemon.species.gender_rate, alt=h.pokedex.gender_rate_label[pokemon.species.gender_rate], title=h.pokedex.gender_rate_label[pokemon.species.gender_rate])}</td></%def>
<%def name="td_gender(pokemon)"><td>${dexlib.chrome_img('gender-rates/%d.png' % pokemon.species.gender_rate, alt=h.pokedex.gender_rate_label[pokemon.species.gender_rate], title=h.pokedex.gender_rate_label[pokemon.species.gender_rate])}</td></%def>
<%def name="col_egg_group()"><col class="dex-col-egg-group"></%def>
<%def name="th_egg_group()"><th>${_(u"Egg Group")}</th></%def>
Expand Down Expand Up @@ -527,7 +527,7 @@ ${pokemon.species.habitat.name}\
<%def name="th_shape()"><th>${_(u"Shape")}</th></%def>
<%def name="td_shape(pokemon)"><td class="icon">
% if pokemon.species.shape:
${h.pokedex.pokedex_img('shapes/%s.png' % pokemon.species.shape.identifier, title=pokemon.species.shape.awesome_name, alt='')}
${dexlib.pokedex_img('shapes/%s.png' % pokemon.species.shape.identifier, title=pokemon.species.shape.awesome_name, alt='')}
% endif
</td></%def>
Expand All @@ -553,4 +553,4 @@ ${h.pokedex.pokedex_img('shapes/%s.png' % pokemon.species.shape.identifier, titl
<%def name="col_link()"><col class="dex-col-link"></%def>
<%def name="th_link()"><th></th></%def>
<%def name="td_link(pokemon)"><td>${h.pokedex.pokemon_link(pokemon, h.literal("""<img src="{0}" alt="-&gt;">""".format(h.static_uri('spline', 'icons/arrow.png'))))}</td></%def>
<%def name="td_link(pokemon)"><td>${dexlib.pokemon_link(pokemon, h.literal("""<img src="{0}" alt="-&gt;">""".format(h.static_uri('spline', 'icons/arrow.png'))))}</td></%def>

0 comments on commit 2baddc1

Please sign in to comment.