{% load static trekking_tags %}

<script type="text/javascript" src="{% static 'trekking/layers.js' %}"></script>
{% if modelname == "trek" %}
    <script type="text/javascript" src="{% static 'trekking/main.js' %}"></script>
    <script type="application/json" id="practices">
        {% trek_practices as practices %}
        {{ practices|safe }}
    </script>
    <script type="application/json" id="all-ratings-scales">
        {% all_ratings_scales as scales %}
        {{ scales|safe }}
    </script>
{% endif %}

{% load static trekking_tags %}

<script type="text/javascript" src="{% static 'trekking/layers.js' %}"></script>
{% if modelname == "trek" %}
    <script type="text/javascript" src="{% static 'trekking/main.js' %}"></script>
    <script type="application/json" id="practices">
        {% trek_practices as practices %}
        {{ practices|safe }}
    </script>
    <script type="application/json" id="all-ratings-scales">
        {% all_ratings_scales as scales %}
        {{ scales|safe }}
    </script>
{% endif %}
<script type="text/javascript" src="{% static 'trekking/layers.js' %}"></script>

Fix missing js in trekking fragment
Fix missing js in trekking fragment
