Skip to content

Commit

Permalink
Marcadores de avance en la parte de arriba de cada paso
Browse files Browse the repository at this point in the history
  • Loading branch information
Felipe Álvarez committed Jun 17, 2016
1 parent 12da88e commit 0ce24f4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions elections/tests/template_tags_tests.py
Expand Up @@ -240,3 +240,10 @@ def test_explanation_template_tag(self):
self.assertIn(freedom2_topic.label, rendered_template)
self.assertIn(benito2_topic.label, rendered_template)
self.assertIn(fiera2_topic.label, rendered_template)

def test_filter_times(self):
template = Template("{% load votainteligente_extras %}{% for i in 3|times %}hola{% endfor %}")
context = Context({})

self.assertEqual(template.render(context), u'holaholahola')

Expand Up @@ -10,7 +10,13 @@
{% block content %}
<div>
<div class="contenedorDestacado text-width">
<p class="text-light">Paso {{ wizard.steps.step1 }} de {{ wizard.steps.count }}</p>


{% for i in wizard.steps.count|times %}
<div class="paso {% if i < wizard.steps.step1 %}paso_completado{% endif %}"> paso {{i|add:"1"}}</div>
{% endfor %}


<form role="form" action="" method="post">
{% csrf_token %}
{{ wizard.management_form }}
Expand Down
4 changes: 4 additions & 0 deletions votai_general_theme/templatetags/votainteligente_extras.py
Expand Up @@ -232,3 +232,7 @@ def long_text_tag(field):
@register.simple_tag
def tab_text_tag(field):
return field.field.widget.attrs.get('tab_text')

@register.filter(name='times')
def times(number):
return range(number)

0 comments on commit 0ce24f4

Please sign in to comment.