Compare commits
No commits in common. "092b91825fed3081a8f27318a3c1c2934beac259" and "bae4e13137ee12a1982bf6f5072adba24c4349bf" have entirely different histories.
092b91825f
...
bae4e13137
@ -1,7 +1,7 @@
|
|||||||
{% extends 'global.html'%}
|
{% extends 'global.html'%}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}{% translate 'Forbidden' %}{% endblock %}
|
{% block title %}{% trans 'Forbidden' %}{% endblock %}
|
||||||
|
|
||||||
{% block additional_head %}
|
{% block additional_head %}
|
||||||
{% if request.META.HTTP_REFERER %}
|
{% if request.META.HTTP_REFERER %}
|
||||||
@ -11,6 +11,6 @@
|
|||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
{% if request.META.HTTP_REFERER %}
|
{% if request.META.HTTP_REFERER %}
|
||||||
<p class="LP-Headline">{% translate 'You will be redirected in 5 seconds' %}</p><p class="LP-Headline"><a href="{{ request.META.HTTP_REFERER }}" class="LP-Link">{% translate 'Go Back' %}</a></p>
|
<p class="LP-Headline">{% trans 'You will be redirected in 5 seconds' %}</p><p class="LP-Headline"><a href="{{ request.META.HTTP_REFERER }}" class="LP-Link">{% trans 'Go Back' %}</a></p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock maincontent %}
|
{% endblock maincontent %}
|
@ -16,7 +16,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LP-UserInfo__Key">
|
<td class="LP-UserInfo__Key">
|
||||||
<span class="LP-Paragraph">{% translate 'Joined' %}</span>
|
<span class="LP-Paragraph">{% trans 'Joined' %}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="LP-UserInfo__Value">
|
<td class="LP-UserInfo__Value">
|
||||||
<span class="LP-Paragraph">{{explorer.user.date_joined|date:'d.m.Y'}}</span>
|
<span class="LP-Paragraph">{{explorer.user.date_joined|date:'d.m.Y'}}</span>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LP-UserInfo__Key">
|
<td class="LP-UserInfo__Key">
|
||||||
<span class="LP-Paragraph">{% translate 'Places'%}</span>
|
<span class="LP-Paragraph">{% trans 'Places'%}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="LP-UserInfo__Value">
|
<td class="LP-UserInfo__Value">
|
||||||
<span class="LP-Paragraph">{{place_count}}</span>
|
<span class="LP-Paragraph">{{place_count}}</span>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="LP-UserInfo__Key">
|
<td class="LP-UserInfo__Key">
|
||||||
<span class="LP-Paragraph">{% translate 'Place Assets'%}</span>
|
<span class="LP-Paragraph">{% trans 'Place Assets'%}</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="LP-UserInfo__Value">
|
<td class="LP-UserInfo__Value">
|
||||||
<span class="LP-Paragraph">{{asset_count}}</span>
|
<span class="LP-Paragraph">{{asset_count}}</span>
|
||||||
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
<div class="LP-PlaceList">
|
<div class="LP-PlaceList">
|
||||||
<h1 class="LP-Headline">{% translate 'Places submitted by' %} {{explorer.user.username}}</h1>
|
<h1 class="LP-Headline">{% trans 'Places submitted by' %} {{explorer.user.username}}</h1>
|
||||||
<ul class="LP-PlaceList__List">
|
<ul class="LP-PlaceList__List">
|
||||||
{% for place in place_list %}
|
{% for place in place_list %}
|
||||||
<li class="LP-PlaceList__Item">
|
<li class="LP-PlaceList__Item">
|
||||||
@ -68,7 +68,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class=" LP-Section">
|
<section class=" LP-Section">
|
||||||
<h1 class="LP-Headline">{% translate 'Photo albums submitted by' %} {{explorer.user.username}}</h1>
|
<h1 class="LP-Headline">{% trans 'Photo albums submitted by' %} {{explorer.user.username}}</h1>
|
||||||
<div class="LP-LinkList">
|
<div class="LP-LinkList">
|
||||||
<ul class="LP-LinkList__Container">
|
<ul class="LP-LinkList__Container">
|
||||||
{% for photo_album in assets.photoalbums.all %}
|
{% for photo_album in assets.photoalbums.all %}
|
||||||
|
@ -29,16 +29,16 @@
|
|||||||
<span class="LP-Paragraph">
|
<span class="LP-Paragraph">
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
Hi {{ user.username }}!
|
Hi {{ user.username }}!
|
||||||
<a class="LP-Link" href="{% url 'logout' %}"><span class="LP-Link__Text">{% translate 'Logout' %}</span></a> |
|
<a class="LP-Link" href="{% url 'logout' %}"><span class="LP-Link__Text">{% trans 'Logout' %}</span></a> |
|
||||||
<a class="LP-Link" href="{% url 'explorer_profile' explorer_id=user.pk%}"><span class="LP-Link__Text">{% translate 'Profile' %}</span></a>
|
<a class="LP-Link" href="{% url 'explorer_profile' explorer_id=user.pk%}"><span class="LP-Link__Text">{% trans 'Profile' %}</span></a>
|
||||||
{% if user.is_superuser %}
|
{% if user.is_superuser %}
|
||||||
| <a class="LP-Link" href="{% url 'admin:index' %}" target="_blank"><span class="LP-Link__Text">{% translate 'Admin' %}</span></a>
|
| <a class="LP-Link" href="{% url 'admin:index' %}" target="_blank"><span class="LP-Link__Text">{% trans 'Admin' %}</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% else %}
|
{% else %}
|
||||||
You are not logged in.
|
You are not logged in.
|
||||||
<a class="LP-Link" href="{% url 'login' %}"><span class="LP-Link__Text">{% translate 'Login' %}</span></a> |
|
<a class="LP-Link" href="{% url 'login' %}"><span class="LP-Link__Text">{% trans 'Login' %}</span></a> |
|
||||||
<a class="LP-Link" href="{% url 'signup' %}"><span class="LP-Link__Text">{% translate 'Sign up' %}</span></a>
|
<a class="LP-Link" href="{% url 'signup' %}"><span class="LP-Link__Text">{% trans 'Sign up' %}</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@ -48,14 +48,14 @@
|
|||||||
<aside class="LP-Main__Sidebar">
|
<aside class="LP-Main__Sidebar">
|
||||||
<nav class="LP-Menu LP-Menu--sidebar">
|
<nav class="LP-Menu LP-Menu--sidebar">
|
||||||
<ul class="LP-Menu__List">
|
<ul class="LP-Menu__List">
|
||||||
<li class="LP-Menu__Item"><a href="{% url 'lostplaces_home' %}" class="LP-Link"><span class="LP-Link__Text">{% translate 'Home' %}</span></a></li>
|
<li class="LP-Menu__Item"><a href="{% url 'lostplaces_home' %}" class="LP-Link"><span class="LP-Link__Text">{% trans 'Home' %}</span></a></li>
|
||||||
<li class="LP-Menu__Item"><a href="{% url 'flatpage' slug='codex' %}" class="LP-Link"><span class="LP-Link__Text">{% translate 'UrBex Codex' %}</span></a></li>
|
<li class="LP-Menu__Item"><a href="{% url 'flatpage' slug='codex' %}" class="LP-Link"><span class="LP-Link__Text">{% trans 'UrBex Codex' %}</span></a></li>
|
||||||
|
|
||||||
{% block additional_menu_items %}
|
{% block additional_menu_items %}
|
||||||
{% endblock additional_menu_items %}
|
{% endblock additional_menu_items %}
|
||||||
|
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_create'%}" class="LP-Link"><span class="LP-Link__Text">{% translate 'Create place' %}</span></a></li>
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_create'%}" class="LP-Link"><span class="LP-Link__Text">{% trans 'Create place' %}</span></a></li>
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_list'%}" class="LP-Link"><span class="LP-Link__Text">{% translate 'All places' %}</span></a></li>
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_list'%}" class="LP-Link"><span class="LP-Link__Text">{% trans 'All places' %}</span></a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</aside>
|
</aside>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<script src="{% static 'maps/ol.js' %}"></script>
|
<script src="{% static 'maps/ol.js' %}"></script>
|
||||||
{% endblock additional_head %}
|
{% endblock additional_head %}
|
||||||
|
|
||||||
# {% block title %}{% translate 'Home' %}{% endblock %}
|
# {% block title %}{% trans 'Home' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
{% include 'partials/osm_map.html' with config=mapping_config %}
|
{% include 'partials/osm_map.html' with config=mapping_config %}
|
||||||
<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">{% trans 'Explore the latest places' %}</h1>
|
||||||
<ul class="LP-PlaceGrid__Grid">
|
<ul class="LP-PlaceGrid__Grid">
|
||||||
{% for place in place_list %}
|
{% for place in place_list %}
|
||||||
<li class="LP-PlaceGrid__Item">
|
<li class="LP-PlaceGrid__Item">
|
||||||
|
@ -8,16 +8,16 @@
|
|||||||
{% include 'partials/welcome.html' %}
|
{% 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 %}
|
{% blocktrans %}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.{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
{% url 'signup' as signup_url %}
|
{% url 'signup' as signup_url %}
|
||||||
<p class="LP-Paragraph">
|
<p class="LP-Paragraph">
|
||||||
{% blocktranslate %}Since vandalism is a growing problem these days, no sensitive information is available to the public. You have to <a class="LP-Link" href="{{signup_url}}"><span class="LP-Link__Text">sign up</span></a> with a voucher code as an invitation to join this community. Only admins can create these codes. Usually you are given a code when we know you in real life in person and when we trust you. A request from an unknown person will most probably be denied.{% endblocktranslate %}
|
{% blocktrans %}Since vandalism is a growing problem these days, no sensitive information is available to the public. You have to <a class="LP-Link" href="{{signup_url}}"><span class="LP-Link__Text">sign up</span></a> with a voucher code as an invitation to join this community. Only admins can create these codes. Usually you are given a code when we know you in real life in person and when we trust you. A request from an unknown person will most probably be denied.{% endblocktrans %}
|
||||||
</p>
|
</p>
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
<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">{% trans 'Explore the latest places' %}</h1>
|
||||||
<ul class="LP-PlaceGrid__Grid">
|
<ul class="LP-PlaceGrid__Grid">
|
||||||
{% for place in place_list %}
|
{% for place in place_list %}
|
||||||
<li class="LP-PlaceGrid__Item">
|
<li class="LP-PlaceGrid__Item">
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
||||||
<button class="LP-Button">{% if action %}{{ action }}{% else %}{% translate 'Submit' %}{% endif %}</button>
|
<button class="LP-Button">{% if action %}{{ action }}{% else %}{% trans 'Submit' %}{% endif %}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
||||||
<a class="LP-Link" href="{% if referer %}{{ referer }}{% else %}{% url 'lostplaces_home' %}{% endif %}">
|
<a class="LP-Link" href="{% if referer %}{{ referer }}{% else %}{% url 'lostplaces_home' %}{% endif %}">
|
||||||
<button type="button" class="LP-Button LP-Button--cancel">{% translate 'Cancel' %}</button>
|
<button type="button" class="LP-Button LP-Button--cancel">{% trans 'Cancel' %}</button>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -7,11 +7,7 @@
|
|||||||
<figure class="LP-Figure">
|
<figure class="LP-Figure">
|
||||||
<img
|
<img
|
||||||
src="{{ source_url }}"
|
src="{{ source_url }}"
|
||||||
{% if alt_text %}
|
{% if alt_text %} alt="{{alt_text}}" {% endif %}
|
||||||
alt="{{alt_text}}"
|
|
||||||
{% else %}
|
|
||||||
alt="{{block}}"
|
|
||||||
{% endif %}
|
|
||||||
class="LP-Image"
|
class="LP-Image"
|
||||||
/>
|
/>
|
||||||
</figure>
|
</figure>
|
||||||
|
@ -61,13 +61,13 @@
|
|||||||
<!-- Bottom section with last line of text and links. -->
|
<!-- Bottom section with last line of text and links. -->
|
||||||
<section class="LP-Footer__BottomSection LP-Footer__Flex">
|
<section class="LP-Footer__BottomSection LP-Footer__Flex">
|
||||||
<div class="LP-Footer__BottomWrapper">
|
<div class="LP-Footer__BottomWrapper">
|
||||||
{% translate 'Made by' %} <a href="https://git.mowoe.com/reverend" class="LP-Footer__GenericAnchor">Reverend</a>
|
{% trans 'Made by' %} <a href="https://git.mowoe.com/reverend" class="LP-Footer__GenericAnchor">Reverend</a>
|
||||||
{% translate 'and' %} <a href="https://www.commander1024.de" class="LP-Footer__GenericAnchor">Commander1024.</a></span>
|
{% trans 'and' %} <a href="https://www.commander1024.de" class="LP-Footer__GenericAnchor">Commander1024.</a></span>
|
||||||
</div>
|
</div>
|
||||||
<div class="LP-Footer__BottomWrapper">
|
<div class="LP-Footer__BottomWrapper">
|
||||||
<a href="{% url 'flatpage' slug='privacy-policy' %}" class="LP-Footer__GenericAnchor">{% translate 'Privacy Policy' %}</a>
|
<a href="{% url 'flatpage' slug='privacy-policy' %}" class="LP-Footer__GenericAnchor">{% trans 'Privacy Policy' %}</a>
|
||||||
|
|
|
|
||||||
<a href="{% url 'flatpage' slug='imprint' %}" class="LP-Footer__GenericAnchor">{% translate 'Imprint' %}</a>
|
<a href="{% url 'flatpage' slug='imprint' %}" class="LP-Footer__GenericAnchor">{% trans 'Imprint' %}</a>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -8,26 +8,26 @@
|
|||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--first">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--first">
|
||||||
<a href="?page=1" class="LP-Link">
|
<a href="?page=1" class="LP-Link">
|
||||||
<span class="LP-Icon">⟪</span>
|
<span class="LP-Icon">⟪</span>
|
||||||
<span class="LP-Text">{% translate 'First' %}</span>
|
<span class="LP-Text">{% trans 'First' %}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--previous">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--previous">
|
||||||
<a href="?page={{ page_obj.previous_page_number }}" class="LP-Link">
|
<a href="?page={{ page_obj.previous_page_number }}" class="LP-Link">
|
||||||
<span class="LP-Icon">⟨</span>
|
<span class="LP-Icon">⟨</span>
|
||||||
<span class="LP-Text">{% translate 'Previous' %}</span>
|
<span class="LP-Text">{% trans 'Previous' %}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--first LP-Pagination__Item--disabled">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--first LP-Pagination__Item--disabled">
|
||||||
<a href="#" class="LP-Link">
|
<a href="#" class="LP-Link">
|
||||||
<span class="LP-Icon">⟪</span>
|
<span class="LP-Icon">⟪</span>
|
||||||
<span class="LP-Text">{% translate 'First' %}</span>
|
<span class="LP-Text">{% trans 'First' %}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--previous LP-Pagination__Item--disabled">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--previous LP-Pagination__Item--disabled">
|
||||||
<a href="#" class="LP-Link">
|
<a href="#" class="LP-Link">
|
||||||
<span class="LP-Icon">⟨</span>
|
<span class="LP-Icon">⟨</span>
|
||||||
<span class="LP-Text">{% translate 'Previous' %}</span>
|
<span class="LP-Text">{% trans 'Previous' %}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -47,25 +47,25 @@
|
|||||||
{% if page_obj.has_next %}
|
{% if page_obj.has_next %}
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--next">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--next">
|
||||||
<a href="?page={{ page_obj.next_page_number }}" class="LP-Link">
|
<a href="?page={{ page_obj.next_page_number }}" class="LP-Link">
|
||||||
<span class="LP-Text">{% translate 'Next' %}</span>
|
<span class="LP-Text">{% trans 'Next' %}</span>
|
||||||
<span class="LP-Icon">⟩</span>
|
<span class="LP-Icon">⟩</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--last">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--last">
|
||||||
<a href="?page={{ page_obj.paginator.num_pages }}" class="LP-Link">
|
<a href="?page={{ page_obj.paginator.num_pages }}" class="LP-Link">
|
||||||
<span class="LP-Text">{% translate 'Last' %}</span>
|
<span class="LP-Text">{% trans 'Last' %}</span>
|
||||||
<span class="LP-Icon">⟫</span>
|
<span class="LP-Icon">⟫</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{% else %}
|
{% else %}
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--next LP-Pagination__Item--disabled">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--next LP-Pagination__Item--disabled">
|
||||||
<a href="#" class="LP-Link">
|
<a href="#" class="LP-Link">
|
||||||
<span class="LP-Text">{% translate 'Next' %}</span>
|
<span class="LP-Text">{% trans 'Next' %}</span>
|
||||||
<span class="LP-Icon">⟩</span>
|
<span class="LP-Icon">⟩</span>
|
||||||
</a>
|
</a>
|
||||||
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--last LP-Pagination__Item--disabled">
|
<li class="LP-Pagination__Item LP-Pagination__Item--other LP-Pagination__Item--last LP-Pagination__Item--disabled">
|
||||||
<a href="#" class="LP-Link">
|
<a href="#" class="LP-Link">
|
||||||
<span class="LP-Text">{% translate 'Last' %}</span>
|
<span class="LP-Text">{% trans 'Last' %}</span>
|
||||||
<span class="LP-Icon">⟫</span>
|
<span class="LP-Icon">⟫</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -27,11 +27,11 @@
|
|||||||
|
|
||||||
<form id="id_tag_submit_form" class="LP-Form LP-Form--inline LP-Form--tagging" method="POST" action="{% url config.submit_url_name tagged_id=config.tagged_item.id%}">
|
<form id="id_tag_submit_form" class="LP-Form LP-Form--inline LP-Form--tagging" method="POST" action="{% url config.submit_url_name tagged_id=config.tagged_item.id%}">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Add tags' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Add tags' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||||
<div class="LP-Form__Field LP-Form__Button LP-Input LP-Input--tagging">
|
<div class="LP-Form__Field LP-Form__Button LP-Input LP-Input--tagging">
|
||||||
<button id="id_tag_submit_button" class="LP-Button">{% translate 'Add tags' %}</button>
|
<button id="id_tag_submit_button" class="LP-Button">{% trans 'Add tags' %}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
{% include 'partials/form/inputField.html' with field=config.submit_form.tag_list classes="LP-Input--tagging" %}
|
{% include 'partials/form/inputField.html' with field=config.submit_form.tag_list classes="LP-Input--tagging" %}
|
||||||
|
@ -1,21 +1,21 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
<header class="LP-TextSection__Headline">
|
<header class="LP-TextSection__Headline">
|
||||||
<h1 class="LP-Headline">{% translate 'Start' %}</h1>
|
<h1 class="LP-Headline">{% trans 'Start' %}</h1>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="LP-TextSection__Text">
|
<div class="LP-TextSection__Text">
|
||||||
<p class="LP-Paragraph">{% translate 'Welcome to our Urban Exploration community catalogue,' %}
|
<p class="LP-Paragraph">{% trans 'Welcome to our Urban Exploration community catalogue,' %}
|
||||||
{% if user.is_authenticated %}
|
{% if user.is_authenticated %}
|
||||||
{{ user.username }}
|
{{ user.username }}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% translate 'explorer' %}
|
{% trans 'explorer' %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
!
|
!
|
||||||
</p>
|
</p>
|
||||||
<p class="LP-Paragraph">
|
<p class="LP-Paragraph">
|
||||||
{% translate 'We strictly follow our' %}
|
{% trans 'We strictly follow our' %}
|
||||||
<a class="LP-Link" href="{% url 'flatpage' slug='codex' %}"><span class="LP-Link__Text">{% translate 'UrBex codex' %}</span></a>
|
<a class="LP-Link" href="{% url 'flatpage' slug='codex' %}"><span class="LP-Link__Text">{% trans 'UrBex codex' %}</span></a>
|
||||||
{% translate 'and expect you to do so, too.' %}'
|
{% trans 'and expect you to do so, too.' %}'
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
{% extends 'global.html'%}
|
{% extends 'global.html'%}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}{% translate 'Submit a photo album' %}{% endblock %}
|
{% block title %}{% trans 'Submit a photo album' %}{% endblock %}
|
||||||
|
|
||||||
{% block additional_menu_items %}
|
{% block additional_menu_items %}
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_edit' pk=place.pk %}" class="LP-Link"><span
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_edit' pk=place.pk %}" class="LP-Link"><span
|
||||||
class="LP-Link__Text">{% translate 'Edit place' %}</span></a></li>
|
class="LP-Link__Text">{% trans 'Edit place' %}</span></a></li>
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_delete' pk=place.pk %}" class="LP-Link"><span
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_delete' pk=place.pk %}" class="LP-Link"><span
|
||||||
class="LP-Link__Text">{% translate 'Delete place' %}</span></a></li>
|
class="LP-Link__Text">{% trans 'Delete place' %}</span></a></li>
|
||||||
{% endblock additional_menu_items %}
|
{% endblock additional_menu_items %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
<form class="LP-Form" method="POST">
|
<form class="LP-Form" method="POST">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Submit a photo album for' %} {{place.name}}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Submit a photo album for' %} {{place.name}}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition">
|
<div class="LP-Form__Composition">
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
# {% block title %}{% translate 'Create place' %}{% endblock %}
|
# {% block title %}{% trans 'Create place' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Create place' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Create place' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% translate 'Create' as action %}
|
{% trans 'Create' as action %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
|
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,21 +2,21 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block title %}{% translate 'Delete lost place' %}{% endblock %}
|
{% block title %}{% trans 'Delete lost place' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
<form class="LP-Form" method="POST">
|
<form class="LP-Form" method="POST">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Delete place' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Delete place' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition">
|
<div class="LP-Form__Composition">
|
||||||
<div class="LP-Form__Field LP-Form__InfoText">
|
<div class="LP-Form__Field LP-Form__InfoText">
|
||||||
<p class="LP-Paragraph">{% blocktranslate with place_name=place.name%}Are you sure you want to delete {{place_name}}?{% endblocktranslate %}</p>
|
<p class="LP-Paragraph">{% blocktrans with place_name=place.name%}Are you sure you want to delete {{place_name}}?{% endblocktrans %}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% translate 'Delete' as action %}
|
{% trans 'Delete' as action %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
{% include 'partials/form/submit.html' with referer=request.META.HTTP_REFERER action=action %}
|
{% include 'partials/form/submit.html' with referer=request.META.HTTP_REFERER action=action %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
{% load thumbnail %}
|
{% load thumbnail %}
|
||||||
{% load svg_icon %}
|
{% load svg_icon %}
|
||||||
{% 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">
|
||||||
@ -16,8 +15,8 @@
|
|||||||
{% block title %}{{place.name}}{% endblock %}
|
{% block title %}{{place.name}}{% endblock %}
|
||||||
|
|
||||||
{% block additional_menu_items %}
|
{% block additional_menu_items %}
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_edit' pk=place.pk %}" class="LP-Link"><span class="LP-Link__Text">{% translate 'Edit place' %}</span></a></li>
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_edit' pk=place.pk %}" class="LP-Link"><span class="LP-Link__Text">{% trans 'Edit place' %}</span></a></li>
|
||||||
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_delete' pk=place.pk %}" class="LP-Link"><span class="LP-Link__Text">{% translate 'Delete place' %}</span></a></li>
|
<li class="LP-Menu__Item LP-Menu__Item--additional"><a href="{% url 'place_delete' pk=place.pk %}" class="LP-Link"><span class="LP-Link__Text">{% trans 'Delete place' %}</span></a></li>
|
||||||
{% endblock additional_menu_items %}
|
{% endblock additional_menu_items %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
@ -27,9 +26,7 @@
|
|||||||
<h1 class="LP-Headline">{{ place.name }}</h1>
|
<h1 class="LP-Headline">{{ place.name }}</h1>
|
||||||
{% if place.placeimages.first.filename.hero.url %}
|
{% if place.placeimages.first.filename.hero.url %}
|
||||||
<div class="LP-PlaceDetail__Image">
|
<div class="LP-PlaceDetail__Image">
|
||||||
{% partial image %}
|
{% include 'partials/image.html' with source_url=place.placeimages.first.filename.hero.url %}
|
||||||
{% set source_url place.placeimages.first.filename.hero.url %}
|
|
||||||
{% endpartial %}
|
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</header>
|
</header>
|
||||||
@ -41,15 +38,13 @@
|
|||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
|
|
||||||
{% url 'place_tag_submit' place_id=place.id as tag_submit_url%}
|
{% url 'place_tag_submit' place_id=place.id as tag_submit_url%}
|
||||||
{% partial tagging %}
|
{% include 'partials/tagging.html' with config=tagging_config %}
|
||||||
{% set config=tagging_config %}
|
|
||||||
{% endpartial %}
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
<h1 class="LP-Headline">{% translate 'Map links' %}</h1>
|
<h1 class="LP-Headline">{% trans 'Map links' %}</h1>
|
||||||
{% partial osm_map config=mapping_config %}
|
{% include 'partials/osm_map.html' with config=mapping_config%}
|
||||||
<div class="LP-LinkList">
|
<div class="LP-LinkList">
|
||||||
<ul class="LP-LinkList__Container">
|
<ul class="LP-LinkList__Container">
|
||||||
<li class="LP-LinkList__Item"><a target="_blank" href="https://www.google.com/maps?q={{place.latitude|safe}},{{place.longitude|safe}}" class="LP-Link"><span class="LP-Text">Google Maps</span></a></li>
|
<li class="LP-LinkList__Item"><a target="_blank" href="https://www.google.com/maps?q={{place.latitude|safe}},{{place.longitude|safe}}" class="LP-Link"><span class="LP-Text">Google Maps</span></a></li>
|
||||||
@ -60,7 +55,7 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class=" LP-Section">
|
<section class=" LP-Section">
|
||||||
<h1 class="LP-Headline">{% translate 'Photo albums' %}</h1>
|
<h1 class="LP-Headline">{% trans 'Photo albums' %}</h1>
|
||||||
<div class="LP-LinkList">
|
<div class="LP-LinkList">
|
||||||
<ul class="LP-LinkList__Container">
|
<ul class="LP-LinkList__Container">
|
||||||
{% for photo_album in place.photoalbums.all %}
|
{% for photo_album in place.photoalbums.all %}
|
||||||
@ -86,7 +81,7 @@
|
|||||||
v216c0,11.046,8.954,20,20,20s20-8.954,20-20V276h216c11.046,0,20-8.954,20-20C512,244.954,503.046,236,492,236z" />
|
v216c0,11.046,8.954,20,20,20s20-8.954,20-20V276h216c11.046,0,20-8.954,20-20C512,244.954,503.046,236,492,236z" />
|
||||||
</g>
|
</g>
|
||||||
</svg>
|
</svg>
|
||||||
<span class="RV-Iconized__Text">{% translate 'Add photo album' %}</span>
|
<span class="RV-Iconized__Text">{% trans 'Add photo album' %}</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
@ -95,8 +90,8 @@
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
{% translate 'Images' as headline %}
|
{% translate 'Images' as t_images %}
|
||||||
{% partial "placeImageGrid" image_list=place.placeimages.all %}
|
{% include 'partials/placeImageGrid.html' with headline=t_images image_list=place.placeimages.all%}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</article>
|
</article>
|
||||||
|
@ -7,13 +7,13 @@
|
|||||||
<script src="{% static 'maps/ol.js' %}"></script>
|
<script src="{% static 'maps/ol.js' %}"></script>
|
||||||
{% endblock additional_head %}
|
{% endblock additional_head %}
|
||||||
|
|
||||||
{% block title %}{% translate 'All Places' %}{% endblock %}
|
{% block title %}{% trans 'All Places' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
{% include 'partials/osm_map.html' with config=mapping_config %}
|
{% include 'partials/osm_map.html' with config=mapping_config %}
|
||||||
<div class="LP-PlaceList">
|
<div class="LP-PlaceList">
|
||||||
<h1 class="LP-Headline">{% translate 'Our lost places' %}</h1>
|
<h1 class="LP-Headline">{% trans 'Our lost places' %}</h1>
|
||||||
<ul class="LP-PlaceList__List">
|
<ul class="LP-PlaceList__List">
|
||||||
{% for place in place_list %}
|
{% for place in place_list %}
|
||||||
<li class="LP-PlaceList__Item">
|
<li class="LP-PlaceList__Item">
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
# {% block title %}{% translate 'Edit place' %}{% endblock %}
|
# {% block title %}{% trans 'Edit place' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Edit place' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Edit place' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
@ -39,7 +39,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% translate 'Update' as action %}
|
{% trans 'Update' as action %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
|
{% include 'partials/form/submit.html' with referrer=request.META.HTTP_REFERER action=action %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Submit images to a place' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Submit images to a place' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
|
|
||||||
<div class="LP-Form__Composition">
|
<div class="LP-Form__Composition">
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
{% extends 'global.html'%}
|
{% extends 'global.html'%}
|
||||||
{% load static %}
|
{% load static %}
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
# {% block title %}{% translate 'Login' %}{% endblock %}
|
# {% block title %}{% trans 'Login' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
<form class="LP-Form" method="POST" enctype="multipart/form-data">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Login' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Login' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
@ -20,12 +20,12 @@
|
|||||||
|
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
||||||
<button class="LP-Button">{% translate 'Login' %}</button>
|
<button class="LP-Button">{% trans 'Login' %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<p class="LP-Headline">{% translate 'No account, yet?' %} <a class="LP-Link" href="{% url 'signup' %}"><span class="LP-Link__Text">{% translate 'Sign up' %}</span></a></p>
|
<p class="LP-Headline">{% trans 'No account, yet?' %} <a class="LP-Link" href="{% url 'signup' %}"><span class="LP-Link__Text">{% trans 'Sign up' %}</span></a></p>
|
||||||
|
|
||||||
{% endblock maincontent %}
|
{% endblock maincontent %}
|
@ -3,13 +3,13 @@
|
|||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
{% load widget_tweaks %}
|
{% load widget_tweaks %}
|
||||||
|
|
||||||
# {% block title %}{% translate 'Sign up' %}{% endblock %}
|
# {% block title %}{% trans 'Sign up' %}{% endblock %}
|
||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
<form class="LP-Form" method="POST">
|
<form class="LP-Form" method="POST">
|
||||||
<fieldset class="LP-Form__Fieldset">
|
<fieldset class="LP-Form__Fieldset">
|
||||||
<legend class="LP-Form__Legend">{% translate 'Sign up' %}</legend>
|
<legend class="LP-Form__Legend">{% trans 'Sign up' %}</legend>
|
||||||
{% csrf_token %}
|
{% csrf_token %}
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
<div class="LP-Form__Composition LP-Form__Composition--breakable">
|
||||||
<div class="LP-Form__Field">
|
<div class="LP-Form__Field">
|
||||||
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
<div class="LP-Form__Composition LP-Form__Composition--buttons">
|
||||||
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
<div class="LP-Form__Field LP-Form__Button LP-Input">
|
||||||
<button class="LP-Button">{% translate 'Sign up' %}</button>
|
<button class="LP-Button">{% trans 'Sign up' %}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
@ -6,15 +6,6 @@ from django.http import request
|
|||||||
|
|
||||||
register = template.Library()
|
register = template.Library()
|
||||||
|
|
||||||
def remove_formatting(string):
|
|
||||||
for to_strip in ["'", '"', ' ']:
|
|
||||||
string = string.strip(to_strip)
|
|
||||||
|
|
||||||
for to_remove in ['\t', '\n',]:
|
|
||||||
string = string.replace(to_remove, '')
|
|
||||||
|
|
||||||
return string
|
|
||||||
|
|
||||||
@register.filter(name='proper_paginate')
|
@register.filter(name='proper_paginate')
|
||||||
def proper_paginate(paginator, current_page, neighbors=2):
|
def proper_paginate(paginator, current_page, neighbors=2):
|
||||||
if paginator.num_pages > 2*neighbors:
|
if paginator.num_pages > 2*neighbors:
|
||||||
@ -33,81 +24,3 @@ def proper_paginate(paginator, current_page, neighbors=2):
|
|||||||
page_list = [f for f in range(start_index, end_index+1)]
|
page_list = [f for f in range(start_index, end_index+1)]
|
||||||
return page_list[:(2*neighbors + 1)]
|
return page_list[:(2*neighbors + 1)]
|
||||||
return paginator.page_range
|
return paginator.page_range
|
||||||
|
|
||||||
|
|
||||||
class VariableNode(template.Node):
|
|
||||||
def __init__(self, name, content=None):
|
|
||||||
if content==None and '=' in name:
|
|
||||||
self.content = name.split('=')[1]
|
|
||||||
self.name = name.split('=')[0]
|
|
||||||
else:
|
|
||||||
self.content = content
|
|
||||||
self.name = name
|
|
||||||
|
|
||||||
def render(self, context):
|
|
||||||
if type(self.content) is not str:
|
|
||||||
self.content = self.content.render(context)
|
|
||||||
|
|
||||||
self.content = remove_formatting(self.content)
|
|
||||||
|
|
||||||
self.content = template.Variable(self.content).resolve(context)
|
|
||||||
|
|
||||||
context[self.name] = self.content
|
|
||||||
return ''
|
|
||||||
|
|
||||||
class PartialNode(template.Node):
|
|
||||||
def __init__(self, name, block):
|
|
||||||
self.name = remove_formatting(name)
|
|
||||||
self.block = block
|
|
||||||
|
|
||||||
def render(self, context):
|
|
||||||
if type(self.block) is template.NodeList:
|
|
||||||
self.block = self.block.render(context)
|
|
||||||
|
|
||||||
self.block = remove_formatting(self.block)
|
|
||||||
|
|
||||||
context = context.flatten()
|
|
||||||
context['block'] = self.block
|
|
||||||
t = template.loader.get_template('partials/%s.html' % self.name)
|
|
||||||
return t.render(context)
|
|
||||||
|
|
||||||
@register.tag(name='set')
|
|
||||||
def set_block(parser, token):
|
|
||||||
split = token.split_contents()
|
|
||||||
if len(split) >= 1:
|
|
||||||
variable_name = split[1]
|
|
||||||
else:
|
|
||||||
raise template.TemplateSyntaxError('%r expects a variable name' % split[0])
|
|
||||||
|
|
||||||
if len(split) == 2:
|
|
||||||
content=None
|
|
||||||
if '=' not in variable_name:
|
|
||||||
content = parser.parse(('end%s'%split[0],))
|
|
||||||
parser.delete_first_token()
|
|
||||||
return VariableNode(variable_name, content)
|
|
||||||
else:
|
|
||||||
return VariableNode(variable_name, split[2])
|
|
||||||
|
|
||||||
@register.tag(name='partial')
|
|
||||||
def partial(parser, token):
|
|
||||||
split = token.split_contents()
|
|
||||||
if len(split) >= 1:
|
|
||||||
partial_name = split[1]
|
|
||||||
else:
|
|
||||||
raise template.TemplateSyntaxError('%r expects a partial name' % split[0])
|
|
||||||
|
|
||||||
if len(split) == 2:
|
|
||||||
nodeList = parser.parse(('end%s'%split[0],))
|
|
||||||
parser.delete_first_token()
|
|
||||||
return PartialNode(partial_name, nodeList)
|
|
||||||
else:
|
|
||||||
nodeList = template.NodeList()
|
|
||||||
for parameter in split[2:]:
|
|
||||||
if '=' in parameter:
|
|
||||||
nodeList.append(
|
|
||||||
VariableNode(name=parameter)
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
raise template.TemplateSyntaxError('%r expects kwargs, got args' % split[0])
|
|
||||||
return PartialNode(partial_name, nodeList)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user