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

View File

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

View File

@ -1,12 +1,11 @@
{% extends 'global.html'%}
{% load i18n %}
{% load lostplaces%}
# {% block title %}Start{% endblock %}
{% block maincontent %}
{% partial 'welcome' %}
{% include 'partials/welcome.html' %}
<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 %}
@ -25,9 +24,7 @@
<a href="{% url 'place_detail' pk=place.pk %}" class="LP-Link">
<article class="LP-PlaceTeaser">
<div class="LP-PlaceTeaser__Image">
{% partial 'image' %}
{% source_url source_url=place.placeimages.first.filename.thumbnail.url %}
{% endpartial %}
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.thumbnail.url %}
</div>
<div class="LP-PlaceTeaser__Meta">
<div class="LP-PlaceTeaser__Info">

View File

@ -33,12 +33,10 @@
</div>
</li>
{% endfor %}
{% if place %}
<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' %}" />
</a>
</li>
{% endif %}
</ul>
</div>

View File

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

View File

@ -7,12 +7,11 @@ from django.http import request
register = template.Library()
def remove_formatting(string):
if type(string) is str:
for to_strip in ["'", '"', ' ']:
string = string.strip(to_strip)
for to_remove in ['\t', '\n',]:
string = string.replace(to_remove, '')
for to_strip in ["'", '"', ' ']:
string = string.strip(to_strip)
for to_remove in ['\t', '\n',]:
string = string.replace(to_remove, '')
return string
@ -51,12 +50,11 @@ class VariableNode(template.Node):
def render(self, context):
if type(self.content) is not str:
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 = template.Variable(self.content).resolve(context)
context[self.name] = self.content
return ''
@ -102,20 +100,8 @@ def partial(parser, token):
raise template.TemplateSyntaxError('%r expects a partial name' % split[0])
if len(split) == 2:
block_tag = False
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()
nodeList = parser.parse(('end%s'%split[0],))
parser.delete_first_token()
return PartialNode(partial_name, nodeList)
else:
nodeList = template.NodeList()