refactor for less duplication
refactored to use a common 'list.html' refactored to allow some modularization (using blocks)
This commit is contained in:
@@ -1,13 +0,0 @@
|
||||
{% load bootstrap5 %}
|
||||
{% bootstrap_css %}
|
||||
{% bootstrap_javascript %}
|
||||
|
||||
<Title>Teams</Title>
|
||||
<h1>Teams</h1>
|
||||
<ol>
|
||||
{% for team in teams %}
|
||||
<li>
|
||||
{{ team.name }}
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
@@ -6,4 +6,4 @@ def root(request):
|
||||
|
||||
def list(request):
|
||||
teams = Team.objects.all()
|
||||
return render(request, 'teams/list.html', {'teams': teams})
|
||||
return render(request, 'list.html', {'title': "Teams", 'items': [f"{team.name}" for team in teams]})
|
||||
Reference in New Issue
Block a user