Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
Disabling isochrone features should not disable distance filters.
Browse files Browse the repository at this point in the history
  • Loading branch information
celine-m-s committed Sep 9, 2019
1 parent 6673be3 commit 28c6bb6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 32 deletions.
2 changes: 1 addition & 1 deletion labonneboite/web/templates/includes/office/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h4>Cette entreprise recrute aussi dans votre région.</h4>
{% elif company.distance %}
<p class="travel-distance-duration">
<img class="img-icon-large" alt="" src="{{ url_for('static', filename='images/icons/travel/km.svg') }}"> {{ company.distance }} km de votre lieu de recherche
<span class="travel-duration" data-siret="{{ company.siret }}" data-latitude="{{ company.latitude }}" data-longitude="{{ company.longitude }}"></span>
<span class="travel-duration {% if not enable_isochrones %}hidden{% endif %}" data-siret="{{ company.siret }}" data-latitude="{{ company.latitude }}" data-longitude="{{ company.longitude }}"></span>
</p>
{% endif %}
</div>
Expand Down
65 changes: 34 additions & 31 deletions labonneboite/web/templates/search/results_content.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,43 +50,46 @@ <h3>Affinez votre recherche</h3>
{{ form.h }}
</div>
<div id="distance-duration-switch"
class="{{ "hidden" if not enable_isochrones else "" }}"
data-switch-value-selected="{{ "duration" if duration_filter_enabled else "distance"}}">
<div class="lbb-sidebar-item">
<p>Rayon de recherche</p>

</div>
<div class="form-switch">
<div class="switch-element" data-switch-value="distance">km</div><!--
--><div class="switch-element" data-switch-value="duration">min</div>
</div>
{% if enable_isochrones %}
<div class="lbb-sidebar-item">
<p>Rayon de recherche</p>
</div>
<div class="form-switch">
<div class="switch-element" data-switch-value="distance">km</div><!-- This comment should not be removed unless you want to break the switch element.
--><div class="switch-element" data-switch-value="duration">min</div>
</div>
<div class="lbb-sidebar-item" data-switch-display-on="duration">
<p>{{ form.tr.label.text }}</p>
<div class="travelmode-choices">
{% for mode in travel_modes %}
<div class="travelmode-choice">
<a href="#" class="{{ 'visible' if (form.tr.data or form.tr.default) == mode else 'hidden' }}"
data-travelmode='{{ mode }}'>
<img class="img-icon" src="{{ url_for('static', filename='images/icons/travel/' + mode + '-selected.svg') }}" alt="Moyen de transport : {{ travel_modes_french[mode] }}" title="{{ travel_modes_french[mode] }}">
</a>
<a href="#" class="{{ 'hidden' if (form.tr.data or form.tr.default) == mode else 'visible' }}" data-travelmode='{{ mode }}' alt="Sélectionner le mode de transport : {{ travel_modes_french[mode] }}">
<img class="img-icon" src="{{ url_for('static', filename='images/icons/travel/' + mode + '-unselected.svg') }}" alt="Moyen de transport : {{ travel_modes_french[mode] }}" title="{{ travel_modes_french[mode] }}">
</a>
<p>{{ travel_modes_french[mode] }}</p>
</div>
{% endfor %}
</div>
{{ form.tr }}
</div>
<div class="lbb-sidebar-item" data-switch-display-on="duration" id="isochrone-durations">
<p>{{ form.dur.label.text }}</p>
{{ form.dur }}
</div>
{% endif %} {# endif enable_isochrones #}

<div class="lbb-sidebar-item" data-switch-display-on="distance">
<p>{{ form.d.label.text }}</p>
{{ form.d }}
</div>
<div class="lbb-sidebar-item {{ "hidden" if not enable_isochrones else "" }}" data-switch-display-on="duration">
<p>{{ form.tr.label.text }}</p>
<div class="travelmode-choices">
{% for mode in travel_modes %}
<div class="travelmode-choice">
<a href="#" class="{{ 'visible' if (form.tr.data or form.tr.default) == mode else 'hidden' }}"
data-travelmode='{{ mode }}'>
<img class="img-icon" src="{{ url_for('static', filename='images/icons/travel/' + mode + '-selected.svg') }}" alt="Moyen de transport : {{ travel_modes_french[mode] }}" title="{{ travel_modes_french[mode] }}">
</a>
<a href="#" class="{{ 'hidden' if (form.tr.data or form.tr.default) == mode else 'visible' }}" data-travelmode='{{ mode }}' alt="Sélectionner le mode de transport : {{ travel_modes_french[mode] }}">
<img class="img-icon" src="{{ url_for('static', filename='images/icons/travel/' + mode + '-unselected.svg') }}" alt="Moyen de transport : {{ travel_modes_french[mode] }}" title="{{ travel_modes_french[mode] }}">
</a>
<p>{{ travel_modes_french[mode] }}</p>
</div>
{% endfor %}
</div>
{{ form.tr }}
</div>
<div class="lbb-sidebar-item {{ "hidden" if not enable_isochrones else "" }}" data-switch-display-on="duration" id="isochrone-durations">
<p>{{ form.dur.label.text }}</p>
{{ form.dur }}
</div>
</div>
<!-- END DISTANCE DURATION SWITCH -->
{% if pro_version_enabled %}
<div class="lbb-sidebar-item">
<p>
Expand Down Expand Up @@ -164,7 +167,7 @@ <h3>Elargir aux alentours :</h3>

{% for company in companies %}
<div id="company-{{ company.siret }}" class="lbb-bright-container lbb-result">
{% with show_more_info=1 %}
{% with show_more_info=1, enable_isochrones=enable_isochrones %}
{% include "includes/office/header.html" %}
{% include "includes/office/content.html" %}
{% endwith %}
Expand Down

0 comments on commit 28c6bb6

Please sign in to comment.