Commit ec06b3db authored by Nicolas Joyard's avatar Nicolas Joyard
Browse files

Fix navbar collapse behaviour

parent d14f776c
...@@ -11,17 +11,21 @@ ...@@ -11,17 +11,21 @@
</div> </div>
</form> </form>
<button class="btn btn-default" type="button" data-toggle="collapse" data-target="#search-options" aria-expanded="false" aria-controls="search-options"> <button class="btn btn-default" type="button" data-toggle="collapse" data-target="#search-options"
aria-expanded="{% if filter.data %}true{% else %}false{% endif %}" aria-controls="search-options">
{% trans "More search options" %} {% trans "More search options" %}
</button> </button>
<div {% if filter.data %}{% else %}class="collapse"{% endif %} id="search-options"> <div class="collapse{% if filter.data %} in{% endif %}" id="search-options"
aria-expanded="{% if filter.data %}true{% else %}false{% endif %}">
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-rep" aria-expanded="false" aria-controls="form-rep"> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-rep"
aria-expanded="{% if view == 'representative_list' and filter.data %}true{% else %}false{% endif %}" aria-controls="form-rep">
{% trans "Find a representative" %} {% trans "Find a representative" %}
</button> </button>
<div {% if view != 'representative_list' %}class="collapse"{% endif %} id="form-rep"> <div class="collapse{% if view == 'representative_list' and filter.data %} in{% endif %}"
aria-expanded="{% if view == 'representative_list' and filter.data %}true{% else %}false{% endif %}" id="form-rep">
<form id="rep-search-form" class="form-horizontal" method="GET" action="{% url "representative-list" %}"> <form id="rep-search-form" class="form-horizontal" method="GET" action="{% url "representative-list" %}">
<div class="form-group"> <div class="form-group">
...@@ -119,11 +123,13 @@ ...@@ -119,11 +123,13 @@
</form> </form>
</div> </div>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-dossier" aria-expanded="false" aria-controls="form-dossier"> <button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#form-dossier"
aria-expanded="{% if view == 'dossier_list' and filter.data %}true{% else %}false{% endif %}" aria-controls="form-dossier">
{% trans "Find a dossier" %} {% trans "Find a dossier" %}
</button> </button>
<div {% if view != 'dossier_list' %}class="collapse"{% endif %} id="form-dossier"> <div class="collapse{% if view == 'dossier_list' and filter.data %} in{% endif %}"
aria-expanded="{% if view == 'dossier_list' and filter.data %}true{% else %}false{% endif %}" id="form-dossier">
<form id="dossier-search-form" class="form-horizontal" method="GET" action="{% url "dossier-list" %}"> <form id="dossier-search-form" class="form-horizontal" method="GET" action="{% url "dossier-list" %}">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3" for="search-dossier">{% trans "Name" %}</label> <label class="col-sm-3" for="search-dossier">{% trans "Name" %}</label>
......
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