Commit 0efcac49 authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

Dedicated submit text for the last step in the wizard, done step is TODO

parent a3a432e8
Pipeline #9306 passed with stage
in 9 minutes and 41 seconds
......@@ -122,9 +122,15 @@ window.onload = function() {
<input type="hidden" name="ippi_wizard-current_step"
value="{{ wizard.steps.current }}"
id="id_ippi_wizard-current_step"/>
<input class="submit_button" type="submit"
value="{%block submit_button_text%}{% trans 'Next step' %}{%endblock%}"
/>
<button class="submit_button" type="submit">
{%block submit_button_text%}
{% if wizard.steps.step1 == wizard.steps.count %}
{% trans 'Save in Database' %}
{%else%}
{% trans 'Next step' %}
{%endif%}
{%endblock%}
</button>
</div>
</form>
<div class="empty_form" style="display:none">{% block emptyform %}{% endblock emptyform%}</div>
......
......@@ -30,6 +30,10 @@ def bootstrap(object):
wrapping_classes = "form-check"
label_classes = "form-check-label"
css_classes.add("form-check-input")
# elif isinstance(field.field.widget, widgets.RadioSelect):
# wrapping_classes = "form-check"
# label_classes = "form-check-label"
# css_classes.add("form-check-input")
else:
wrapping_classes = "input_field form-group"
label_classes = "form-control-placeholder"
......
......@@ -69,6 +69,7 @@ TEMPLATES = {"IdForm": "IdForm.html",
class IppiWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
def get_context_data(self, **kwargs):
# @formatter:off
context = super(IppiWizard, self).get_context_data(**kwargs)
if self.steps.current == 'BibliographyForm':
context['id_source'] = self.storage.get_step_data('IdForm').get('IdForm-id_source')
......@@ -82,6 +83,7 @@ class IppiWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
context['complex_choice'] = self.storage.get_step_data('ProteinDomainComplexTypeForm').get('ProteinDomainComplexTypeForm-complexChoice')
context['complex_type'] = self.storage.get_step_data('ProteinDomainComplexTypeForm').get('ProteinDomainComplexTypeForm-complexType')
context['pdb_id'] = self.storage.get_step_data('PDBForm').get('PDBForm-pdb_id')
# @formatter:on
return context
def get_form_kwargs(self, step=None):
......@@ -145,7 +147,8 @@ class IppiWizard(LoginRequiredMixin, NamedUrlSessionWizardView):
def get_template_names(self):
return [TEMPLATES[self.steps.current]]
def done(self, form_list, **kwargs):
def done(self, form_list, form_dict=None, **kwargs):
super().done(form_list=form_list, **kwargs)
return render(self.request, 'done.html', {
'form_data': [form.cleaned_data for form in form_list],
})
})
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment