Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Use a very basic base template

Roland Geider7266c46fbaea
diff --git a/manager/templates/base.html b/manager/templates/base.html
new file mode 100644
index 000000000..a14336032
--- /dev/null
+++ b/manager/templates/base.html
@@ -0,0 +1,10 @@
+{% load i18n %}
+
+<html>
+<head>
+ <title>{% block title %}{% endblock %}</title>
+</head>
+<body>
+ {% block content %}{% endblock %}
+</body>
+</html>
\ No newline at end of file
diff --git a/manager/templates/detail.html b/manager/templates/detail.html
index e2f1235be..faccd533a 100644
--- a/manager/templates/detail.html
+++ b/manager/templates/detail.html
@@ -1,6 +1,10 @@
+{% extends "base.html" %}
{% load i18n %}
-<h1>{% trans "Workout for" %} {{ workout.creation_date }}</h1>
+{% block title %}{% trans "Workout for" %} {{ workout.creation_date }}{% endblock %}
+
+{% block content %}
+<h1> {% trans "Workout for" %} {{ workout.creation_date }}</h1>
<ul>
{% for day in workout.day_set.all %}
<li>
@@ -24,7 +28,7 @@
{% endfor %}
-->
- {% for setting in exercise.setting_set.all %}
+ {% for setting in exercise.setting_set.filter %}
{{ set.sets }} x <!--x {{setting.reps}} @ {{setting.weight}}-->
{% for individual_setting in setting.individual_exercises.all %}
@@ -40,4 +44,5 @@
</ul>
</li>
{% endfor %}
-</ul>
\ No newline at end of file
+</ul>
+{% endblock %}
\ No newline at end of file
diff --git a/manager/templates/index.html b/manager/templates/index.html
index 374fa5439..c0a94ab86 100644
--- a/manager/templates/index.html
+++ b/manager/templates/index.html
@@ -1,9 +1,16 @@
-{% if latest_poll_list %}
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block title %} {% trans "Workout list" %}{% endblock %}
+
+{% block content %}
+{% if latest_workouts_list %}
<ul>
- {% for workout in latest_poll_list %}
+ {% for workout in latest_workouts_list %}
<li><a href="/workout/{{ workout.id }}/view">{{ workout.creation_date }}</a></li>
{% endfor %}
</ul>
{% else %}
<p>No workouts are available.</p>
-{% endif %}
\ No newline at end of file
+{% endif %}
+{% endblock %}
\ No newline at end of file
diff --git a/manager/views.py b/manager/views.py
index efd708732..10ad5a214 100644
--- a/manager/views.py
+++ b/manager/views.py
@@ -21,7 +21,7 @@ from manager.models import TrainingSchedule
def index(request):
latest_trainings = TrainingSchedule.objects.all().order_by('-creation_date')[:5]
- return render_to_response('index.html', {'latest_poll_list': latest_trainings})
+ return render_to_response('index.html', {'latest_workouts_list': latest_trainings})
def add(request):