Compare commits

..

No commits in common. "a139594863570be7330f7fd1645db5c4e754fc81" and "201ef736392840310018c29b2656fff7ce5d74ee" have entirely different histories.

6 changed files with 20 additions and 44 deletions

View File

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

View File

@ -2,7 +2,6 @@
{% 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>
@ -12,13 +11,11 @@
{% block maincontent %} {% block maincontent %}
{% partial 'welcome' %} {% include 'partials/welcome.html' %}
<article class="LP-TextSection"> <article class="LP-TextSection">
</article> </article>
{% partial 'osm_map' %}
{% set config mapping_config %} {% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
{% 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">
@ -29,4 +26,5 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% endblock maincontent %} {% endblock maincontent %}

View File

@ -1,12 +1,11 @@
{% extends 'global.html'%} {% extends 'global.html'%}
{% load i18n %} {% load i18n %}
{% load lostplaces%}
# {% block title %}Start{% endblock %} # {% block title %}Start{% endblock %}
{% block maincontent %} {% block maincontent %}
{% partial 'welcome' %} {% include 'partials/welcome.html' %}
<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 %}
@ -25,9 +24,7 @@
<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">
{% partial 'image' %} {% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
{% 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">

View File

@ -33,12 +33,10 @@
</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>

View File

@ -5,10 +5,8 @@
{% 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 %}
<a href="{{place.get_absolute_url}}"> <img class="LP-Image" src="{% static 'images/missing_image.png' %}" />
<img class="LP-Image" src="{% static 'images/missing_image.png' %}" /> {% endif %}
</a>
{% endif %}
</div> </div>
</a> </a>
<div class="LP-PlaceTeaser__Meta"> <div class="LP-PlaceTeaser__Meta">

View File

@ -7,12 +7,11 @@ from django.http import request
register = template.Library() register = template.Library()
def remove_formatting(string): def remove_formatting(string):
if type(string) is str: for to_strip in ["'", '"', ' ']:
for to_strip in ["'", '"', ' ']: string = string.strip(to_strip)
string = string.strip(to_strip)
for to_remove in ['\t', '\n',]: for to_remove in ['\t', '\n',]:
string = string.replace(to_remove, '') string = string.replace(to_remove, '')
return string return string
@ -51,12 +50,11 @@ 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 ''
@ -102,20 +100,8 @@ 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:
block_tag = False nodeList = parser.parse(('end%s'%split[0],))
for token in reversed(parser.tokens): parser.delete_first_token()
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()