From 06e765e6860f2cb48f68b2fe964b5243844dd6b5 Mon Sep 17 00:00:00 2001 From: Bryan Brancotte <bryan.brancotte@pasteur.fr> Date: Tue, 13 Aug 2019 11:42:05 +0200 Subject: [PATCH] Grouping tests by their ending as the do not start anymore with "Test" --- ippisite/ippidb/templates/add.html | 4 ++-- ippisite/ippidb/templatetags/customtags.py | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ippisite/ippidb/templates/add.html b/ippisite/ippidb/templates/add.html index baddb157..4ef0fccc 100644 --- a/ippisite/ippidb/templates/add.html +++ b/ippisite/ippidb/templates/add.html @@ -57,7 +57,7 @@ $(document).ready(function(){ <div class="view-content"> <ul class="nav nav-tabs wizard_step_nav"> {%for step in wizard.steps.all %} - {% if not step|startswith:"Test" %} + {% if not step|endswith:"DescriptionFormSet" %} <li class="nav-item"> <a class="nav-link {% if step == wizard.steps.current %}active{%else%}{% if forloop.counter0 <= wizard.steps.step0 %} @@ -74,7 +74,7 @@ $(document).ready(function(){ </li> {%endif%} {%endfor%} - {% if wizard.steps.current|startswith:"Test" %} + {% if 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) diff --git a/ippisite/ippidb/templatetags/customtags.py b/ippisite/ippidb/templatetags/customtags.py index bcf5f4f1..69ccd237 100644 --- a/ippisite/ippidb/templatetags/customtags.py +++ b/ippisite/ippidb/templatetags/customtags.py @@ -145,6 +145,10 @@ def bootstrap_core(object): def startswith(text, starts): return text.startswith(starts) +@register.filter('endswith') +def endswith(text, starts): + return text.endswith(starts) + @register.filter def verbose_name(obj, field_name=None): -- GitLab