Skip to content
Snippets Groups Projects
Commit 10ea67b0 authored by Bryan BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

customize template for SaveInDB:

* remove tab
* add bigger save button to help user see and use it
* steps.count -1 to be consistent with tabs count, and tutorials

Also remove dead code
parent a76f0ab0
No related branches found
No related tags found
1 merge request!16Final review step in contribution
Pipeline #34600 failed
...@@ -48,7 +48,7 @@ $(document).ready(function(){ ...@@ -48,7 +48,7 @@ $(document).ready(function(){
<div class="view-content"> <div class="view-content">
<ul class="nav nav-tabs wizard_step_nav"> <ul class="nav nav-tabs wizard_step_nav">
{%for step in wizard.steps.all %} {%for step in wizard.steps.all %}
{% if True or not step|endswith:"DescriptionFormSet" %} {% if not step|endswith:"SaveInDB" %}
<li class="nav-item"> <li class="nav-item">
<a <a
class="nav-link {% if step == wizard.steps.current %}active{%else%}{% if forloop.counter0 <= wizard.steps.step0 %} class="nav-link {% if step == wizard.steps.current %}active{%else%}{% if forloop.counter0 <= wizard.steps.step0 %}
...@@ -65,15 +65,6 @@ $(document).ready(function(){ ...@@ -65,15 +65,6 @@ $(document).ready(function(){
</li> </li>
{%endif%} {%endif%}
{%endfor%} {%endfor%}
{% if False and wizard.steps.current|endswith:"DescriptionFormSet" %}
<li class="nav-item">
<a class="nav-link active"
href="{% url 'ippidb_step' step=step %}">Tests ({{ "-7"|add:wizard.steps.step1 }}/3)
</a>
</li>
{%else%}
<!--<li class="nav-item"><a class="nav-link ">Tests</a></li>-->
{%endif%}
</ul> </ul>
<div id="Form" class="formset-container"> <div id="Form" class="formset-container">
<div class="step_desc"> <div class="step_desc">
...@@ -82,9 +73,11 @@ $(document).ready(function(){ ...@@ -82,9 +73,11 @@ $(document).ready(function(){
{% trans step_title|linebreaksbr %} {% trans step_title|linebreaksbr %}
{% endwith %} {% endwith %}
</h1> </h1>
{%if wizard.steps.step1 != wizard.steps.count %}
<p class="step_step"> <p class="step_step">
Step {{ wizard.steps.step1 }} on {{wizard.steps.count }} Step {{ wizard.steps.step1 }} on {{wizard.steps.count|add:-1 }}
</p> </p>
{% endif %}
<p class="step_step_desc"> <p class="step_step_desc">
{% block step_desc %} {% block step_desc %}
{% with wizard.steps.current|add:"_desc" as step_desc %} {% with wizard.steps.current|add:"_desc" as step_desc %}
...@@ -136,15 +129,18 @@ $(document).ready(function(){ ...@@ -136,15 +129,18 @@ $(document).ready(function(){
<input type="hidden" name="ippi_wizard-current_step" <input type="hidden" name="ippi_wizard-current_step"
value="{{ wizard.steps.current }}" value="{{ wizard.steps.current }}"
id="id_ippi_wizard-current_step"/> id="id_ippi_wizard-current_step"/>
<button class="submit_button" type="submit">
{%block submit_button_text%} {%block submit_button_text%}
{% if wizard.steps.step1 == wizard.steps.count %} {% if wizard.steps.step1 == wizard.steps.count %}
<button class="submit_button h4 p-2" type="submit">
{% trans 'Save in Database' %} {% trans 'Save in Database' %}
</button>
{%else%} {%else%}
<button class="submit_button" type="submit">
{% trans 'Next step' %} {% trans 'Next step' %}
</button>
{%endif%} {%endif%}
{%endblock%} {%endblock%}
</button>
</div> </div>
</form> </form>
<div class="empty_form" style="display:none">{% block emptyform %}{% endblock emptyform%}</div> <div class="empty_form" style="display:none">{% block emptyform %}{% endblock emptyform%}</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment