<commit_before>{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}

{% block title %} {% trans "Dashboard" %}{% endblock %}

{% block header %}
{% endblock %}



{% block content %}
{% if current_workout %}
<div class="modal fade" id="calendar-day-select-popup">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">{% trans 'Add log to day' %}</h4>
            </div>
            <div class="modal-body">
                {% if current_workout %}
                <p>{% blocktrans %}Click to add weight logs to a training
day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</strong></p>

                {% for day in current_workout.day_set.all %}
                    <a href="{% url 'day-log' day.pk %}" class="btn btn-block btn-default">{{day.description}}</a>
                {% endfor %}

                {% else %}
                <p><em>{% trans "No workouts found." %}</em></p>
                <p>
                <a href="{% url 'workout-add' %}" class="btn btn-block btn-default">
                   <img src="{% static 'images/icons/add.svg' %}"
                        width="22"
                        height="22"
                        alt="">
                    {% trans "Add one now." %}
                </a>
                </p>
                {% endif %}
            </div>
        </div>
    </div>
</div>


<div class="row">
    <div class="col-md-6">
        <h3>{% trans "Workout"%}</h3>



        <p>
        <a href="{% url 'workout-view' current_workout.id %}">
            {% if current_workout.comment %}
                {{ current_workout.comment }}
            {% else %}
                {% trans "Workout" %}
            {% endif %}
        </a>
        </p>
         – {{ current_workout.creation_date }}

        <ul>
            {% for day, exercise, is_workout in weekdays %}
            <li>
                {% if not is_workout %}<span class="text-muted">{% endif%}
                {{ day }}:

                {{ exercise }}
                {% if not is_workout %}</span>{% endif%}

            </li>
            {% endfor %}
        </ul>

        {% if current_workout.day_set.all %}
        <p><a href="#" id="logging-popup-link" data-toggle="modal" data-target="#calendar-day-select-popup">{% trans "Add new log" %}</a></p>
        {% endif %}

        {% if schedule %}
        <p>
            → {% trans "This workout is part of a schedule:" %}
            <a href="{{schedule.get_absolute_url}}">{{schedule.name}}</a>
        </p>
        {% endif %}

        {% else %}
            <p>
                <a href="{% url 'workout-add' %}" class="btn btn-block btn-default">
                {% trans "No workouts found." %} {% trans "Add one now." %}
                </a>
            </p>
        {% endif %}
    </div>
    <div class="col-md-6">
        <h3>{% trans "Nutrition plan"%}</h3>

        {% if plan %}
            <p>
            <a href="{% url 'nutrition-view' plan.id %}">
                {% if plan.description %}
                    {{ plan.description }}
                {% else %}
                    {% trans "Nutrition plan" %}
                {% endif %}
           </a>
           </p>
           – {{ plan.creation_date }}
           <ul>
               <li>
                   {% trans "Energy" %}: {{nutritional_info.total.energy|floatformat}} kcal
               </li>
               <li>
                   {% trans "Protein" %}: {{nutritional_info.total.protein|floatformat}} g<commit_msg>Fix index page for users without workouts<commit_after>{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}

{% block title %} {% trans "Dashboard" %}{% endblock %}

{% block header %}
{% endblock %}



{% block content %}
{% if current_workout %}
<div class="modal fade" id="calendar-day-select-popup">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title">{% trans 'Add log to day' %}</h4>
            </div>
            <div class="modal-body">
                {% if current_workout %}
                <p>{% blocktrans %}Click to add weight logs to a training
day in your current workout:{% endblocktrans %} <strong>{{current_workout}}</strong></p>

                {% for day in current_workout.day_set.all %}
                    <a href="{% url 'day-log' day.pk %}" class="btn btn-block btn-default">{{day.description}}</a>
                {% endfor %}

                {% else %}
                <p><em>{% trans "No workouts found." %}</em></p>
                <p>
                <a href="{% url 'workout-add' %}" class="btn btn-block btn-default">
                   <img src="{% static 'images/icons/add.svg' %}"
                        width="22"
                        height="22"
                        alt="">
                    {% trans "Add one now." %}
                </a>
                </p>
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endif %}

<div class="row">
    <div class="col-md-6">
        <h3>{% trans "Workout"%}</h3>

        {% if current_workout %}
            <p>
            <a href="{% url 'workout-view' current_workout.id %}">
                {% if current_workout.comment %}
                    {{ current_workout.comment }}
                {% else %}
                    {% trans "Workout" %}
                {% endif %}
            </a>
            </p>
             – {{ current_workout.creation_date }}

            <ul>
                {% for day, exercise, is_workout in weekdays %}
                <li>
                    {% if not is_workout %}<span class="text-muted">{% endif%}
                    {{ day }}:

                    {{ exercise }}
                    {% if not is_workout %}</span>{% endif%}

                </li>
                {% endfor %}
            </ul>

            {% if current_workout.day_set.all %}
                <p><a href="#" id="logging-popup-link" data-toggle="modal" data-target="#calendar-day-select-popup">{% trans "Add new log" %}</a></p>
            {% endif %}

            {% if schedule %}
                <p>
                    → {% trans "This workout is part of a schedule:" %}
                    <a href="{{schedule.get_absolute_url}}">{{schedule.name}}</a>
                </p>
            {% endif %}

        {% else %} {# no workout #}
            <a href="{% url 'workout-add' %}" class="btn btn-block btn-default">
            {% trans "No workouts found." %} {% trans "Add one now." %}
            </a>
        {% endif %}

    </div>
    <div class="col-md-6">
        <h3>{% trans "Nutrition plan"%}</h3>

        {% if plan %}
            <p>
            <a href="{% url 'nutrition-view' plan.id %}">
                {% if plan.description %}
                    {{ plan.description }}
                {% else %}
                    {% trans "Nutrition plan" %}
                {% endif %}
           </a>
           </p>
           – {{ plan.creation_date }}
           <ul>
               <li>
                   {% trans "Energy" %}: {{nutritional_info.total.energy|floatformat}} kcal
               </li>
               <li>
                   {% trans "Protein" %}: {{nutritional_info.total.protein|floatformat}} g
{'fraction_non_alphanumeric': 0.17262297243834893, 'fraction_numerical': 0.003692469998681261, 'mean_word_length': 1.3663026521060841, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 135, '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': '6320679', 'n_tokens_mistral': 2427, 'n_tokens_neox': 2091, 'n_words': 500}