diff --git a/ippisite/ippidb/templates/add.html b/ippisite/ippidb/templates/add.html index b3f1f9c7224bba4c0d49f9635dfbcc576e90d2b7..fd85b7d4f1fd21f6adedd8aca603c54226bb267d 100644 --- a/ippisite/ippidb/templates/add.html +++ b/ippisite/ippidb/templates/add.html @@ -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> diff --git a/ippisite/ippidb/templatetags/customtags.py b/ippisite/ippidb/templatetags/customtags.py index 46ea7702d3b2197be4d18509c3e7df35dd8530fd..7e4cec696520160f55bd65b5f0efd62c7fdc4352 100644 --- a/ippisite/ippidb/templatetags/customtags.py +++ b/ippisite/ippidb/templatetags/customtags.py @@ -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" diff --git a/ippisite/ippidb/views/contribute.py b/ippisite/ippidb/views/contribute.py index ad9d1ca246e0a20c13965cbdb239d7aa6257d8e8..d27aaead6d3be2736f54563cfe45a5d1eb1a00b3 100644 --- a/ippisite/ippidb/views/contribute.py +++ b/ippisite/ippidb/views/contribute.py @@ -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], - }) + })