Stripped down unauth_home template, limited places to 5.

This commit is contained in:
Marcus Scholz 2020-09-02 00:26:03 +02:00
parent 91c888db8f
commit b95e565bef
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,31 @@
{% extends 'global.html'%}
# {% block title %}Start{% endblock %}
{% block maincontent %}
<div class="LP-PlaceGrid">
<h1 class="LP-Headline LP-Headline">Our latest locations</h1>
<ul class="LP-PlaceGrid__Grid">
{% for place in place_list %}
<li class="LP-PlaceGrid__Item">
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
<article class="LP-PlaceTeaser">
<div class="LP-PlaceTeaser__Image">
<img class="LP-Image" src="{{ place.images.first.filename.thumbnail.url}}" />
</div>
<div class="LP-PlaceTeaser__Meta">
<div class="LP-PlaceTeaser__Info">
<span class="LP-PlaceTeaser__Title">
<h1 class="LP-Headline LP-Headline--teaser">{{place.name|truncatechars:19}}</h1>
</span>
</div>
</div>
</article>
</a>
</li>
{% endfor %}
</ul>
</div>
{% endblock maincontent %}

View File

@ -31,7 +31,7 @@ class HomeView(IsAuthenticated, View):
return render(request, 'home.html', context)
def handle_no_permission(self):
place_list = Place.objects.all().order_by('-submitted_when')[:10]
place_list = Place.objects.all().order_by('-submitted_when')[:5]
context = {
'place_list': place_list
}