Self hosted FLOSS fitness/workout, nutrition and weight tracker
Use a constant to display the days of the week
Roland Geider3648f179feec
diff --git a/manager/templates/index.html b/manager/templates/index.htmlindex 68041fbfe..08c664a66 100644--- a/manager/templates/index.html+++ b/manager/templates/index.html@@ -25,12 +25,12 @@<ul>- {% for i in weekdays %}+ {% for i, j in weekdays %}<li>- {{ i }}:+ {{ j }}:{% for day in current_workout.day_set.select_related %}- {% if day.day == forloop.parentloop.counter %}+ {% if day.day == i %}{{ day.description }}{% endif %}{% endfor %}diff --git a/manager/views.py b/manager/views.pyindex bb7f68bb1..01d82a333 100644--- a/manager/views.py+++ b/manager/views.py@@ -34,6 +34,7 @@ from django.contrib.auth.models import User as Django_Userfrom django.contrib.auth.forms import AuthenticationFormfrom django.contrib.auth.forms import UserCreationForm+from manager.models import DAYS_OF_WEEK_CHOICESfrom manager.models import TrainingSchedulefrom manager.models import Dayfrom manager.models import Set@@ -71,16 +72,7 @@ def index(request):template_data = {}template_data['active_tab'] = 'user'- weekdays = (_('Monday'),- _('Tuesday'),- _('Wednesday'),- _('Thursday'),- _('Friday'),- _('Saturday'),- _('Sunday'),- )-- template_data['weekdays'] = weekdays+ template_data['weekdays'] = DAYS_OF_WEEK_CHOICEScurrent_workout = TrainingSchedule.objects.filter(user=request.user).latest('creation_date')template_data['current_workout'] = current_workout