Self hosted FLOSS fitness/workout, nutrition and weight tracker
Move the user tabe to the very left and use the url method to generate links
Roland Geider8f13d4b98c13
diff --git a/manager/templates/base.html b/manager/templates/base.htmlindex accbdb2ce..e2acea9e7 100644--- a/manager/templates/base.html+++ b/manager/templates/base.html@@ -47,27 +47,23 @@<div class="ym-wrapper"><div class="ym-hlist"><ul>- <li {% if active_tab == 'workout' %}class="active"{% endif %}><a href="/">{% trans "Workouts" %}</a></li>- <li {% if active_tab == 'exercises' %}class="active"{% endif %}><a href="/exercise/overview/">{% trans "Exercises" %}</a></li>- <li {% if active_tab == 'weight' %}class="active"{% endif %}><a href="/weight/overview/">{% trans "Weight" %} </a></li>- <li {% if active_tab == 'nutrition' %}class="active"{% endif %}><a href="/nutrition/overview/">{% trans "Nutrition" %} </a></li>+ <li {% if active_tab == 'user' %}class="active"{% endif %}>+ {% if not user.username %}+ <a href="{% url manager.views.login %}">{% trans "Login" %}</a>+ {% else %}+ <a href="{% url manager.views.preferences %}">{% trans "Dashboard" %}</a>+ </li>+ <li {% if active_tab == 'workout' %}class="active"{% endif %}><a href="{% url manager.views.index %}">{% trans "Workouts" %}</a></li>+ <li {% if active_tab == 'exercises' %}class="active"{% endif %}><a href="{% url exercises.views.exercise_overview %}">{% trans "Exercises" %}</a></li>+ <li {% if active_tab == 'weight' %}class="active"{% endif %}><a href="{% url weight.views.overview %}">{% trans "Weight" %} </a></li>+ <li {% if active_tab == 'nutrition' %}class="active"{% endif %}><a href="{% url nutrition.views.overview %}">{% trans "Nutrition" %} </a></li></ul><ul style="float:right;">- <li {% if active_tab == 'user' %}class="active"{% endif %}>- {% if not user.username %}- <a href="{% url manager.views.login %}">{% trans "Login" %}</a>- {% else %}- <a href="{% url manager.views.preferences %}">{% trans "My preferences" %}</a>- </li><li><a href="{% url manager.views.logout %}">- <img src="{% static 'images/icons/logout.svg' %}"- width="18"- height="18"- alt="{% trans 'Logout' %}: {{ user.username }}"- title="{% trans 'Logout' %}: {{ user.username }}">+ {% trans 'Logout' %}</a>{% endif %}</li>diff --git a/manager/views.py b/manager/views.pyindex cbc24b350..0a97b5ab0 100644--- a/manager/views.py+++ b/manager/views.py@@ -68,7 +68,7 @@ def index(request):"""template_data = {}- template_data['active_tab'] = 'workout'+ template_data['active_tab'] = 'user'latest_trainings = TrainingSchedule.objects.filter(user=request.user).order_by('-creation_date')[:5]template_data['latest_workouts_list'] = latest_trainings