Replace include with partial tag

This commit is contained in:
reverend 2021-04-06 19:14:36 +02:00
parent 201ef73639
commit 120e63808a
4 changed files with 17 additions and 9 deletions

View File

@ -1,5 +1,6 @@
{% load static %}
{% load i18n %}
{% load lostplaces%}
<!DOCTYPE html>
<html lang="en">
@ -87,7 +88,7 @@
</div>
{% block footer %}
{% include 'partials/nav/footer.html' %}
{% partial 'nav/footer' %}
{% endblock footer %}
</body>

View File

@ -2,6 +2,7 @@
{% load static %}
{% load i18n %}
{% load lostplaces %}
{% block additional_head %}
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css">
<script src="{% static 'maps/ol.js' %}"></script>
@ -11,11 +12,13 @@
{% block maincontent %}
{% include 'partials/welcome.html' %}
{% partial 'welcome' %}
<article class="LP-TextSection">
</article>
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
{% partial 'osm_map' %}
{% set config mapping_config %}
{% set modifier 'wide' %}
{% endpartial %}
<div class="LP-PlaceGrid">
<h1 class="LP-Headline LP-Headline">{% translate 'Explore the latest places' %}</h1>
<ul class="LP-PlaceGrid__Grid">
@ -26,5 +29,4 @@
{% endfor %}
</ul>
</div>
{% endblock maincontent %}

View File

@ -1,11 +1,12 @@
{% extends 'global.html'%}
{% load i18n %}
{% load lostplaces%}
# {% block title %}Start{% endblock %}
{% block maincontent %}
{% include 'partials/welcome.html' %}
{% partial 'welcome' %}
<article class="LP-TextSection">
<p class="LP-Paragraph">
{% blocktranslate %}You can create, view and share your lost places with other members of this site. You can upload photos, place links to your web galleries and contribute your knowledge by tagging other places or commenting on them. You will find detailed information on where these locations are, how to get there and what to expect from them. This might even include detailed information on the surroundings or the history of a lost place.{% endblocktranslate %}
@ -24,7 +25,9 @@
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
<article class="LP-PlaceTeaser">
<div class="LP-PlaceTeaser__Image">
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
{% partial 'image' %}
{% source_url source_url=place.placeimages.first.filename.thumbnail.url %}
{% endpartial %}
</div>
<div class="LP-PlaceTeaser__Meta">
<div class="LP-PlaceTeaser__Info">

View File

@ -5,8 +5,10 @@
{% if place.placeimages.all|length > 0 %}
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url link_url=place.get_absolute_url%}
{% else %}
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
{% endif %}
<a href="{{place.get_absolute_url}}">
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
</a>
{% endif %}
</div>
</a>
<div class="LP-PlaceTeaser__Meta">