Use a very basic base template

This commit is contained in:
Roland Geider
2012-08-05 00:25:55 +02:00
parent b846cba9a4
commit 7266c46fba
4 changed files with 29 additions and 7 deletions

View File

@@ -0,0 +1,10 @@
{% load i18n %}
<html>
<head>
<title>{% block title %}{% endblock %}</title>
</head>
<body>
{% block content %}{% endblock %}
</body>
</html>

View File

@@ -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>
</ul>
{% endblock %}

View File

@@ -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 %}
{% endif %}
{% endblock %}

View File

@@ -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):