<commit_before>{% extends "turan/base.html" %}
{% load humanize %}
{% load i18n %}
{% load l10n %}
{% load turan_extras %}
{% load turanwaka_tags %}

{% load avatar_tags %}
{% load pagination_tags %}
{% load sorting_tags %}
{% block title %}
{% trans "Segment" %} : {{object}} {% if object.distance %} {{ object.distance|floatformat }} km {% endif %}{% if object.ascent %} {{ object.ascent|floatformat }} asc m {% endif %} {{ object.grade|floatformat }} %
{% endblock %}
{% block searchenginemeta %}
<meta name="description" content="{{object.description|truncatewords:20|escape}}" />
{% endblock %}
{% block content %}

<div class="page-header">
    {% if user.is_authenticated %}
            <a class="btn btn-primary pull-right"href="{% url segment_update object.id %}">{% trans "Modify" %}</a>
    {% endif %}
    <h1>
        {{ object.name }}
        <small>
            {{ object.description }}
        </small>
    </h1>
</div>
        {% include "turan/segment/attributes.html" %}

    {% if slopes %}
    <div class="">
        <h6>{% trans "Best efforts" %}</h6>
            <ol>
            {% for object in slopes|slice:":3" %}
                <li class="floatleft {% ifequal forloop.counter 1 %}first{% endifequal %}{% ifequal forloop.counter 2 %}second{% endifequal %}{% ifequal forloop.counter 3 %}third{% endifequal %}"> 
                        <a href="{{ object.exercise.user.get_absolute_url }}" title="{{ object.exercise.user }}">
                            {% avatar object.exercise.user 32 %}
                        </a>
                    {{ object.duration|durationformatshort}}, {{object.exercise.date}}
                </li>
            {% endfor %}
        </ol>
    </div>
    <br>
    {% endif %}

    <hr class="clear" />
    {% if object.gpx_file %}
    <div ><div style="width:100%; height: 500px" class="well" id="map"></div>
            <a href="{{MEDIA_URL}}turan/{{ object.gpx_file }}" class="detailsShareBoxButton gpxFile">{% trans "GPX File" %}</a>
        </div>
    {% endif %}

    <ul class="photos hlist">
        {% for photo in object.get_photos %}
        <li>
            <a title="{{ photo.title }}" href="{{ photo.get_absolute_url }}">
                <img src="{{ photo.get_thumbnail_url }}" alt="{{ photo.title }}" />
            </a>
        </li>
        {% endfor %}
    </ul>
    <hr class="clearleft" />

    {% include "turan/tags.html" %}

    <hr class="clearleft" />
    {% with slopes as object_list %}
    {% autosort object_list %}
    {% autopaginate object_list %}
    {% if object_list %}
        <div id="gradientzonediv" style="width: 100%; height:200px"></div>
        {% include "turan/exercise/gradient_tab.html" %}
        {% include "turan/altitude_profile.html" %}
        <div id="durationdiv" style="width:100%;height:100px"></div>
        <form id="route_form">

        <table class="fullsize">
            <tr>
                <th>{% trans "CMP" %}</th>
                <th>{% trans "Trip" %}</th>
                <th>{% anchortrans exercise__user Exerciser %}</th>
                <th>{% anchortrans exercise__date "Date" %}</th>
                <th>{% anchortrans duration %}</th>
                <th>{% anchortrans avg_hr "Avg HR" %}</th>
                <th>{% anchortrans avg_speed "Avg Speed" %}</th>
                <th> {% anchortrans ascent "Ascent" %} </th>
            <th>{% anchortrans act_power "Power" %}</th>
            <th>{% anchortrans est_power "Power (est)" %}</th>
            <th>{% anchortrans power_per_kg "Avg power/kg" %}</th>
            <th>{% anchortrans vam "VAM" %}{{ "VeloAscMet"|wiki_help }}</th>
            <th>{% trans "Comment" %}</th>
            </tr>
            {% for object in object_list %}
            <tr class="{% cycle odd,even %} hoverpoint" id="trip_{{object.id}}">
                <td>
                    <input type="checkbox" name="selected_routes" value="{{ object.exercise.id }}-{{object.id}}">
                    <input type="hidden" id="start{{object.exercise.id}}-{{object.id}}" value="{{object.start|unlocalize}}">
                </td>
                <td>
                        {% if object.exercise.user == request.user or request.user.is_superuser %}
                        <a href="{% url segmentdetail_update object.id %}">
                        <img title="{% trans "Modify segment entry"%}" alt ="modify" src="{{ "wrench"|silk_icon}}">
                        </a>
                        <a href="{% url segmentdetail_delete object.id %}">
                        <img title="{% trans "Delete segment entry"%}" alt ="delete" src="{{ "cross"|silk_icon}}">
                        </a>
                        {% endif%}
                    <a href="{{ object.exercise.get_absolute_url }}#graph-zoom-{{object.start|unlocalize}}-{{object.end|unlocalize}}">
                        <img src="/site_media/pinax/img/silk/icons/zoom.png" />
                        {{ object.exercise.route|truncatechars:"15" }}
                    </a>
                </td>
                <td>
                    <a href="{{ object.exercise.user.get_absolute_url }}" title="{{ object.exercise.user }}">
                    {% avatar object.exercise.user 32 %}
                    </a>
                </td>
                <td><a href="{{ object.get_absolute_url }}">{{object.exercise.date|naturalday}}</a></td>
                <td>{{ object.duration|durationformatshort }}</td>
                <td>
                    {% if object.avg_hr and object.exercise.user.get_profile.max_hr %} {{ object.avg_hr|percent:object.exercise.user.get_profile.max_hr }} 
                    {% else%}
                    {% if object.avg_hr %}
                        {{ object.avg_hr }}&nbsp;bpm 
                    {% endif %}
                    {% endif %}
                </td>
                <td>{{ object.speed|floatformat }}&nbsp;{% trans "km/h" %}</td>
                <td>{{ object.ascent }} m</td>
        <td>{% if object.act_power%}{{object.act_power|floatformat}} {% trans "W" %} {% endif %}</td>
        <td>{{object.est_power|floatformat}} {% trans "W" %} </td>
        <td>{{object.power_per_kg|floatformat}}</td>
        <td>{% if object.vam %}{{object.vam}}{% endif %}</td>
        <td>
            {% if object.comment %}
            {{ object.comment|slice:"70" }}
            {% endif %}
        </td>
            </tr>
            {% endfor %}
        </table>
    <div class="form-actions">
        <input class="btn"  type="submit" value="{% trans "Compare"%}">
        </form>
    {% if request.user.username %}
    <a class="btn" href="?username={{request.user.username}}">{% trans "My results" %}</a>
    {% endif %}
    <a class="btn" href="?distinct=user">{% trans "Best individual results" %}</a>
    </div>
{% paginate %}
{% endif %}
{% endwith %}
{% endblock content %}
{% block extra_body %}
{{ block.super }}
{% with object.gpx_file as gpx_file %}
    {% include "turan/maphead.html" %}
{% endwith %}
<script id="source" language="javascript" type="text/javascript">
    $(function () {

        var times = [
            {% for other_user, series in series.items %}
            {% if series %}
                {
                    label: "{{other_user}}",
                    bars: { show: true },
                    data: {{series}},
                    color: {{ forloop.counter }}
                },
            {% endif %}
            {% endfor %}
        ];
        var options = { 
            tooltip: true,
            tooltipOpts: {
                xValText: '{% trans "Exerciser" %}: ',
                yValText: '{% trans "Duration" %}: ',
                series: false,
            },
            yaxis: { 
                min: {{t_offset}},
                tickFormatter: axisformatters.duration <commit_msg>fix well padding error, and js tag clean<commit_after>{% extends "turan/base.html" %}
{% load humanize %}
{% load i18n %}
{% load l10n %}
{% load turan_extras %}
{% load turanwaka_tags %}

{% load avatar_tags %}
{% load pagination_tags %}
{% load sorting_tags %}
{% block title %}
{% trans "Segment" %} : {{object}} {% if object.distance %} {{ object.distance|floatformat }} km {% endif %}{% if object.ascent %} {{ object.ascent|floatformat }} asc m {% endif %} {{ object.grade|floatformat }} %
{% endblock %}
{% block searchenginemeta %}
<meta name="description" content="{{object.description|truncatewords:20|escape}}" />
{% endblock %}
{% block content %}

<div class="page-header">
    {% if user.is_authenticated %}
            <a class="btn btn-primary pull-right"href="{% url segment_update object.id %}">{% trans "Modify" %}</a>
    {% endif %}
    <h1>
        {{ object.name }}
        <small>
            {{ object.description }}
        </small>
    </h1>
</div>
        {% include "turan/segment/attributes.html" %}

    {% if slopes %}
    <div class="">
        <h6>{% trans "Best efforts" %}</h6>
            <ol>
            {% for object in slopes|slice:":3" %}
                <li class="floatleft {% ifequal forloop.counter 1 %}first{% endifequal %}{% ifequal forloop.counter 2 %}second{% endifequal %}{% ifequal forloop.counter 3 %}third{% endifequal %}"> 
                        <a href="{{ object.exercise.user.get_absolute_url }}" title="{{ object.exercise.user }}">
                            {% avatar object.exercise.user 32 %}
                        </a>
                    {{ object.duration|durationformatshort}}, {{object.exercise.date}}
                </li>
            {% endfor %}
        </ol>
    </div>
    <br>
    {% endif %}

    <hr class="clear" />
    {% if object.gpx_file %}
    <div ><div style="width:100%; height: 500px; padding:0" class="well" id="map"></div>
            <a href="{{MEDIA_URL}}turan/{{ object.gpx_file }}" class="detailsShareBoxButton gpxFile">{% trans "GPX File" %}</a>
        </div>
    {% endif %}

    <ul class="photos hlist">
        {% for photo in object.get_photos %}
        <li>
            <a title="{{ photo.title }}" href="{{ photo.get_absolute_url }}">
                <img src="{{ photo.get_thumbnail_url }}" alt="{{ photo.title }}" />
            </a>
        </li>
        {% endfor %}
    </ul>
    <hr class="clearleft" />

    {% include "turan/tags.html" %}

    <hr class="clearleft" />
    {% with slopes as object_list %}
    {% autosort object_list %}
    {% autopaginate object_list %}
    {% if object_list %}
        <div id="gradientzonediv" style="width: 100%; height:200px"></div>
        {% include "turan/exercise/gradient_tab.html" %}
        {% include "turan/altitude_profile.html" %}
        <div id="durationdiv" style="width:100%;height:100px"></div>
        <form id="route_form">

        <table class="fullsize">
            <tr>
                <th>{% trans "CMP" %}</th>
                <th>{% trans "Trip" %}</th>
                <th>{% anchortrans exercise__user Exerciser %}</th>
                <th>{% anchortrans exercise__date "Date" %}</th>
                <th>{% anchortrans duration %}</th>
                <th>{% anchortrans avg_hr "Avg HR" %}</th>
                <th>{% anchortrans avg_speed "Avg Speed" %}</th>
                <th> {% anchortrans ascent "Ascent" %} </th>
            <th>{% anchortrans act_power "Power" %}</th>
            <th>{% anchortrans est_power "Power (est)" %}</th>
            <th>{% anchortrans power_per_kg "Avg power/kg" %}</th>
            <th>{% anchortrans vam "VAM" %}{{ "VeloAscMet"|wiki_help }}</th>
            <th>{% trans "Comment" %}</th>
            </tr>
            {% for object in object_list %}
            <tr class="{% cycle odd,even %} hoverpoint" id="trip_{{object.id}}">
                <td>
                    <input type="checkbox" name="selected_routes" value="{{ object.exercise.id }}-{{object.id}}">
                    <input type="hidden" id="start{{object.exercise.id}}-{{object.id}}" value="{{object.start|unlocalize}}">
                </td>
                <td>
                        {% if object.exercise.user == request.user or request.user.is_superuser %}
                        <a href="{% url segmentdetail_update object.id %}">
                        <img title="{% trans "Modify segment entry"%}" alt ="modify" src="{{ "wrench"|silk_icon}}">
                        </a>
                        <a href="{% url segmentdetail_delete object.id %}">
                        <img title="{% trans "Delete segment entry"%}" alt ="delete" src="{{ "cross"|silk_icon}}">
                        </a>
                        {% endif%}
                    <a href="{{ object.exercise.get_absolute_url }}#graph-zoom-{{object.start|unlocalize}}-{{object.end|unlocalize}}">
                        <img src="/site_media/pinax/img/silk/icons/zoom.png" />
                        {{ object.exercise.route|truncatechars:"15" }}
                    </a>
                </td>
                <td>
                    <a href="{{ object.exercise.user.get_absolute_url }}" title="{{ object.exercise.user }}">
                    {% avatar object.exercise.user 32 %}
                    </a>
                </td>
                <td><a href="{{ object.get_absolute_url }}">{{object.exercise.date|naturalday}}</a></td>
                <td>{{ object.duration|durationformatshort }}</td>
                <td>
                    {% if object.avg_hr and object.exercise.user.get_profile.max_hr %} {{ object.avg_hr|percent:object.exercise.user.get_profile.max_hr }} 
                    {% else%}
                    {% if object.avg_hr %}
                        {{ object.avg_hr }}&nbsp;bpm 
                    {% endif %}
                    {% endif %}
                </td>
                <td>{{ object.speed|floatformat }}&nbsp;{% trans "km/h" %}</td>
                <td>{{ object.ascent }} m</td>
        <td>{% if object.act_power%}{{object.act_power|floatformat}} {% trans "W" %} {% endif %}</td>
        <td>{{object.est_power|floatformat}} {% trans "W" %} </td>
        <td>{{object.power_per_kg|floatformat}}</td>
        <td>{% if object.vam %}{{object.vam}}{% endif %}</td>
        <td>
            {% if object.comment %}
            {{ object.comment|slice:"70" }}
            {% endif %}
        </td>
            </tr>
            {% endfor %}
        </table>
    <div class="form-actions">
        <input class="btn"  type="submit" value="{% trans "Compare"%}">
        </form>
    {% if request.user.username %}
    <a class="btn" href="?username={{request.user.username}}">{% trans "My results" %}</a>
    {% endif %}
    <a class="btn" href="?distinct=user">{% trans "Best individual results" %}</a>
    </div>
{% paginate %}
{% endif %}
{% endwith %}
{% endblock content %}
{% block extra_body %}
{{ block.super }}
{% with object.gpx_file as gpx_file %}
    {% include "turan/maphead.html" %}
{% endwith %}
<script type="text/javascript">
    $(function () {

        var times = [
            {% for other_user, series in series.items %}
            {% if series %}
                {
                    label: "{{other_user}}",
                    bars: { show: true },
                    data: {{series}},
                    color: {{ forloop.counter }}
                },
            {% endif %}
            {% endfor %}
        ];
        var options = { 
            tooltip: true,
            tooltipOpts: {
                xValText: '{% trans "Exerciser" %}: ',
                yValText: '{% trans "Duration" %}: ',
                series: false,
            },
            yaxis: { 
                min: {{t_offset}},
                tickFormatter: axisformatters.duration 
{'fraction_non_alphanumeric': 0.18134548722557453, 'fraction_numerical': 0.00519964051868019, 'mean_word_length': 1.8176885512750949, 'pattern_counts': {'":': 2, '<': 249, '<?xml version=': 0, '>': 249, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1206958', 'n_tokens_mistral': 5180, 'n_tokens_neox': 4513, 'n_words': 976}