feat: Use adoption list template in index too
This commit is contained in:
parent
32021be0f7
commit
1bcdbdbbf5
@ -2,13 +2,11 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{% translate "Notfellchen - Vermittlungen finden" %}</h1>
|
<h1>{% translate "Notfellchen - Vermittlungen finden" %}</h1>
|
||||||
<p>{% translate "Alle Tiere brauchen ein liebendes Zuhause. Damit keins vergessen wird gibt es diese Seite. Entwickelt und betreut von " %}<em><a href="https://hyteck.de">moanos</a></em>!</p>
|
<p>{% translate "Alle Tiere brauchen ein liebendes Zuhause. Damit keins vergessen wird gibt es diese Seite. Entwickelt und betreut von " %}<em><a
|
||||||
<h2>{% translate "Aktuelle Vermittlungen" %}</h2>
|
href="https://hyteck.de">moanos</a></em>!</p>
|
||||||
<ul>
|
<h2>{% translate "Aktuelle Vermittlungen" %}</h2>
|
||||||
{% for adoption_notice in latest_adoptions %}
|
<ul>
|
||||||
<li><a href="{{ adoption_notice.get_absolute_url }}">{{ adoption_notice.name }}</a>: {{ adoption_notice.animals | join:", " }} </li>
|
{% include "fellchensammlung/list-adoption-notices.html" %}
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
</ul>
|
</ul>
|
||||||
{% endblock %}
|
{% endblock %}
|
@ -10,7 +10,7 @@ from .forms import AdoptionNoticeForm, AnimalForm
|
|||||||
def index(request):
|
def index(request):
|
||||||
"""View function for home page of site."""
|
"""View function for home page of site."""
|
||||||
latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5]
|
latest_adoption_list = AdoptionNotice.objects.order_by("-created_at")[:5]
|
||||||
context = {"latest_adoptions": latest_adoption_list}
|
context = {"adoption_notices": latest_adoption_list}
|
||||||
|
|
||||||
return render(request, 'fellchensammlung/index.html', context=context)
|
return render(request, 'fellchensammlung/index.html', context=context)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user