From 47ace3e2dd16d08b60a777791ada314f756e7edd Mon Sep 17 00:00:00 2001 From: Mario Sergio Date: Tue, 23 Jul 2024 17:37:59 -0300 Subject: [PATCH] feat(votepeloclima): continue button with the next step title --- .../candidature/bandeiras_da_sua_candidatura.html | 5 +++-- .../candidature/templates/candidature/done.html | 2 +- .../candidature/templates/candidature/wizard_form.html | 5 +++-- app/org_eleicoes/votepeloclima/candidature/views.py | 9 +++++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/org_eleicoes/votepeloclima/candidature/templates/candidature/bandeiras_da_sua_candidatura.html b/app/org_eleicoes/votepeloclima/candidature/templates/candidature/bandeiras_da_sua_candidatura.html index 751b7f19..f5b70c75 100644 --- a/app/org_eleicoes/votepeloclima/candidature/templates/candidature/bandeiras_da_sua_candidatura.html +++ b/app/org_eleicoes/votepeloclima/candidature/templates/candidature/bandeiras_da_sua_candidatura.html @@ -27,10 +27,11 @@

Propostas selecionadas

{% if wizard.steps.prev %} - {% endif %} - + {% if wizard.steps.next %} + + {% endif %} {% endblock %} diff --git a/app/org_eleicoes/votepeloclima/candidature/templates/candidature/done.html b/app/org_eleicoes/votepeloclima/candidature/templates/candidature/done.html index a9e6a1be..50698617 100644 --- a/app/org_eleicoes/votepeloclima/candidature/templates/candidature/done.html +++ b/app/org_eleicoes/votepeloclima/candidature/templates/candidature/done.html @@ -16,7 +16,7 @@ {% else %} {{ wizard.form.as_p }} {% endif %} - + {% else %}
diff --git a/app/org_eleicoes/votepeloclima/candidature/templates/candidature/wizard_form.html b/app/org_eleicoes/votepeloclima/candidature/templates/candidature/wizard_form.html index 7ab1e955..4b2ae37c 100644 --- a/app/org_eleicoes/votepeloclima/candidature/templates/candidature/wizard_form.html +++ b/app/org_eleicoes/votepeloclima/candidature/templates/candidature/wizard_form.html @@ -16,9 +16,10 @@ {% endif %} {% if wizard.steps.prev %} - {% endif %} - + {% if wizard.steps.next %} + + {% endif %} {% endblock %} \ No newline at end of file diff --git a/app/org_eleicoes/votepeloclima/candidature/views.py b/app/org_eleicoes/votepeloclima/candidature/views.py index 23d52a30..61deeb16 100644 --- a/app/org_eleicoes/votepeloclima/candidature/views.py +++ b/app/org_eleicoes/votepeloclima/candidature/views.py @@ -97,6 +97,14 @@ def get_template_names(self): return "candidature/bandeiras_da_sua_candidatura.html" return super().get_template_names() + def get_next_step_title(self): + if self.steps.next: + next_step = self.steps.next + form_class = self.get_form_list().get(next_step) + if form_class: + return form_class().Meta.title + return "" + def get_context_data(self, form, **kwargs): context = super().get_context_data(form, **kwargs) checkout_steps = [] @@ -115,6 +123,7 @@ def get_context_data(self, form, **kwargs): context.update({"checkout_steps": checkout_steps}) + context.update({"next_step_title": self.get_next_step_title()}) return context def done(self, form_list, form_dict, **kwargs):