Compare commits
3 Commits
201ef73639
...
a139594863
Author | SHA1 | Date | |
---|---|---|---|
a139594863 | |||
f2eb048f0b | |||
120e63808a |
@ -1,5 +1,6 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load lostplaces%}
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
@ -87,7 +88,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% block footer %}
|
{% block footer %}
|
||||||
{% include 'partials/nav/footer.html' %}
|
{% partial 'nav/footer' %}
|
||||||
{% endblock footer %}
|
{% endblock footer %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load lostplaces %}
|
||||||
{% block additional_head %}
|
{% block additional_head %}
|
||||||
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css">
|
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css">
|
||||||
<script src="{% static 'maps/ol.js' %}"></script>
|
<script src="{% static 'maps/ol.js' %}"></script>
|
||||||
@ -11,11 +12,13 @@
|
|||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
{% include 'partials/welcome.html' %}
|
{% partial 'welcome' %}
|
||||||
<article class="LP-TextSection">
|
<article class="LP-TextSection">
|
||||||
</article>
|
</article>
|
||||||
|
{% partial 'osm_map' %}
|
||||||
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
|
{% set config mapping_config %}
|
||||||
|
{% set modifier 'wide' %}
|
||||||
|
{% endpartial %}
|
||||||
<div class="LP-PlaceGrid">
|
<div class="LP-PlaceGrid">
|
||||||
<h1 class="LP-Headline LP-Headline">{% translate 'Explore the latest places' %}</h1>
|
<h1 class="LP-Headline LP-Headline">{% translate 'Explore the latest places' %}</h1>
|
||||||
<ul class="LP-PlaceGrid__Grid">
|
<ul class="LP-PlaceGrid__Grid">
|
||||||
@ -26,5 +29,4 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock maincontent %}
|
{% endblock maincontent %}
|
@ -1,11 +1,12 @@
|
|||||||
{% extends 'global.html'%}
|
{% extends 'global.html'%}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
{% load lostplaces%}
|
||||||
|
|
||||||
# {% block title %}Start{% endblock %}
|
# {% block title %}Start{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
{% include 'partials/welcome.html' %}
|
{% partial 'welcome' %}
|
||||||
<article class="LP-TextSection">
|
<article class="LP-TextSection">
|
||||||
<p class="LP-Paragraph">
|
<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 %}
|
{% 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">
|
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
|
||||||
<article class="LP-PlaceTeaser">
|
<article class="LP-PlaceTeaser">
|
||||||
<div class="LP-PlaceTeaser__Image">
|
<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>
|
||||||
<div class="LP-PlaceTeaser__Meta">
|
<div class="LP-PlaceTeaser__Meta">
|
||||||
<div class="LP-PlaceTeaser__Info">
|
<div class="LP-PlaceTeaser__Info">
|
||||||
|
@ -33,10 +33,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% if place %}
|
||||||
<li class="LP-ImageGrid__Item LP-ImageGrid__Item--add" title="Bild hinzufügen">
|
<li class="LP-ImageGrid__Item LP-ImageGrid__Item--add" title="Bild hinzufügen">
|
||||||
<a class="LP-Link" href="{% url 'place_image_create' place_id=place.id%}">
|
<a class="LP-Link" href="{% url 'place_image_create' place_id=place.id %}">
|
||||||
<img class="LP-Icon" src="{% static 'icons/plus.svg' %}" />
|
<img class="LP-Icon" src="{% static 'icons/plus.svg' %}" />
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
@ -5,8 +5,10 @@
|
|||||||
{% if place.placeimages.all|length > 0 %}
|
{% 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%}
|
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url link_url=place.get_absolute_url%}
|
||||||
{% else %}
|
{% else %}
|
||||||
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
|
<a href="{{place.get_absolute_url}}">
|
||||||
{% endif %}
|
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
<div class="LP-PlaceTeaser__Meta">
|
<div class="LP-PlaceTeaser__Meta">
|
||||||
|
@ -7,11 +7,12 @@ from django.http import request
|
|||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
def remove_formatting(string):
|
def remove_formatting(string):
|
||||||
for to_strip in ["'", '"', ' ']:
|
if type(string) is str:
|
||||||
string = string.strip(to_strip)
|
for to_strip in ["'", '"', ' ']:
|
||||||
|
string = string.strip(to_strip)
|
||||||
for to_remove in ['\t', '\n',]:
|
|
||||||
string = string.replace(to_remove, '')
|
for to_remove in ['\t', '\n',]:
|
||||||
|
string = string.replace(to_remove, '')
|
||||||
|
|
||||||
return string
|
return string
|
||||||
|
|
||||||
@ -50,11 +51,12 @@ class VariableNode(template.Node):
|
|||||||
def render(self, context):
|
def render(self, context):
|
||||||
if type(self.content) is not str:
|
if type(self.content) is not str:
|
||||||
self.content = self.content.render(context)
|
self.content = self.content.render(context)
|
||||||
|
try:
|
||||||
|
self.content = template.Variable(self.content).resolve(context)
|
||||||
|
except template.VariableDoesNotExist:
|
||||||
|
pass
|
||||||
|
|
||||||
self.content = remove_formatting(self.content)
|
self.content = remove_formatting(self.content)
|
||||||
|
|
||||||
self.content = template.Variable(self.content).resolve(context)
|
|
||||||
|
|
||||||
context[self.name] = self.content
|
context[self.name] = self.content
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
@ -100,8 +102,20 @@ def partial(parser, token):
|
|||||||
raise template.TemplateSyntaxError('%r expects a partial name' % split[0])
|
raise template.TemplateSyntaxError('%r expects a partial name' % split[0])
|
||||||
|
|
||||||
if len(split) == 2:
|
if len(split) == 2:
|
||||||
nodeList = parser.parse(('end%s'%split[0],))
|
block_tag = False
|
||||||
parser.delete_first_token()
|
for token in reversed(parser.tokens):
|
||||||
|
if 'end%s'%split[0] in token.contents:
|
||||||
|
block_tag = True
|
||||||
|
break
|
||||||
|
|
||||||
|
if split[0] in token.contents:
|
||||||
|
break
|
||||||
|
|
||||||
|
if block_tag:
|
||||||
|
nodeList = parser.parse(('end%s'%split[0],))
|
||||||
|
parser.delete_first_token()
|
||||||
|
else:
|
||||||
|
nodeList = template.NodeList()
|
||||||
return PartialNode(partial_name, nodeList)
|
return PartialNode(partial_name, nodeList)
|
||||||
else:
|
else:
|
||||||
nodeList = template.NodeList()
|
nodeList = template.NodeList()
|
||||||
|
Loading…
Reference in New Issue
Block a user