Compare commits
8 Commits
feature/30
...
5df7cc5ec6
Author | SHA1 | Date | |
---|---|---|---|
5df7cc5ec6 | |||
e242dc4add | |||
f73fa616d0 | |||
629a609ff5 | |||
04fe93c7bb | |||
b42be489dc | |||
dc79b9d05c | |||
b845cc054a |
@@ -6,6 +6,9 @@ The software is currently in early development status, neither scope, datamodel(
|
|||||||
|
|
||||||
We value privacy as a whole, all resources the frontend requires will be shipped with lostplace's distribution. We also try to minimize the use of JavaScript as far as we can and try to offer JS-less alternatives where we can.
|
We value privacy as a whole, all resources the frontend requires will be shipped with lostplace's distribution. We also try to minimize the use of JavaScript as far as we can and try to offer JS-less alternatives where we can.
|
||||||
|
|
||||||
|
## Contact
|
||||||
|
If you run into any issues, have any questions or If you are interested in this project in general, feel free to get in touch with us via [reverend@reverend2048.de](mailto:reverend@reverend2048.de), we do speak English and German.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- Manage lost places with lots of useful information.
|
- Manage lost places with lots of useful information.
|
||||||
- OSM-Maps
|
- OSM-Maps
|
||||||
@@ -145,8 +148,4 @@ Before making the django instance public, you should tweak the config `settings.
|
|||||||
4. Set a new (random) SECRET_KEY in settings.py, e. g.: `base64 /dev/urandom | head -c50`
|
4. Set a new (random) SECRET_KEY in settings.py, e. g.: `base64 /dev/urandom | head -c50`
|
||||||
|
|
||||||
|
|
||||||
Run `django_lostplaces/manage.py collectstatic` you should be ready to go.
|
Run `django_lostplaces/manage.py collectstatic` you should be ready to go.
|
||||||
|
|
||||||
|
|
||||||
### Contact
|
|
||||||
If you run into any issues, have any questions or If you are interested in this project in general, feel free to get in touch with us via [reverend@reverend2048.de](mailto:reverend@reverend2048.de), we do speak English and German.
|
|
@@ -1,3 +1,5 @@
|
|||||||
|
from django.shortcuts import redirect
|
||||||
|
|
||||||
def get_all_subclasses(cls):
|
def get_all_subclasses(cls):
|
||||||
'''
|
'''
|
||||||
Gets all subclasses recursively, does not contain
|
Gets all subclasses recursively, does not contain
|
||||||
@@ -8,4 +10,16 @@ def get_all_subclasses(cls):
|
|||||||
if not subclass._meta.abstract:
|
if not subclass._meta.abstract:
|
||||||
subclass_list.append(subclass)
|
subclass_list.append(subclass)
|
||||||
subclass_list += get_all_subclasses(subclass)
|
subclass_list += get_all_subclasses(subclass)
|
||||||
return subclass_list
|
return subclass_list
|
||||||
|
|
||||||
|
def redirect_referer_or(request, url='/'):
|
||||||
|
'''
|
||||||
|
Returns a django redirect to the requests referer,
|
||||||
|
if there is no referer the redirect will poin to the given url
|
||||||
|
Default url is /
|
||||||
|
'''
|
||||||
|
referer = request.META.get('HTTP_REFERER')
|
||||||
|
if referer is not None:
|
||||||
|
return redirect(referer)
|
||||||
|
else:
|
||||||
|
return redirect(url)
|
@@ -44,7 +44,15 @@ class PlaceForm(forms.ModelForm):
|
|||||||
class Meta:
|
class Meta:
|
||||||
model = Place
|
model = Place
|
||||||
fields = '__all__'
|
fields = '__all__'
|
||||||
exclude = ['submitted_by']
|
exclude = ['submitted_by', 'latitude', 'longitute']
|
||||||
|
|
||||||
|
latitude = forms.IntegerField(
|
||||||
|
widget=forms.NumberInput(attrs={'min':-90,'max': 90,'type': 'number'})
|
||||||
|
)
|
||||||
|
|
||||||
|
longitude = forms.IntegerField(
|
||||||
|
widget=forms.NumberInput(attrs={'min':-180,'max': 180,'type': 'number'})
|
||||||
|
)
|
||||||
|
|
||||||
class PlaceImageForm(forms.ModelForm):
|
class PlaceImageForm(forms.ModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
|
@@ -30,7 +30,7 @@ class Explorer(models.Model):
|
|||||||
|
|
||||||
favorite_places = models.ManyToManyField(
|
favorite_places = models.ManyToManyField(
|
||||||
Place,
|
Place,
|
||||||
related_name='favorite_places',
|
related_name='explorer_favorites',
|
||||||
verbose_name='Explorers favorite places',
|
verbose_name='Explorers favorite places',
|
||||||
blank=True
|
blank=True
|
||||||
)
|
)
|
||||||
|
@@ -923,7 +923,8 @@ body {
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
gap: unset; }
|
gap: unset; }
|
||||||
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Meta .LP-Headline, .LP-PlaceTeaser--extended .LP-PlaceTeaser__Meta .LP-Paragraph {
|
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Meta .LP-Headline,
|
||||||
|
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Meta .LP-Paragraph {
|
||||||
font-size: unset; }
|
font-size: unset; }
|
||||||
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Meta .LP-PlaceTeaser__Info .LP-Headline {
|
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Meta .LP-PlaceTeaser__Info .LP-Headline {
|
||||||
font-size: 28px; }
|
font-size: 28px; }
|
||||||
@@ -941,7 +942,12 @@ body {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
order: unset; }
|
order: unset; }
|
||||||
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Description .LP-Paragraph {
|
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Description .LP-Paragraph {
|
||||||
font-size: unset; }
|
font-size: unset;
|
||||||
|
display: -webkit-box;
|
||||||
|
-webkit-box-orient: vertical;
|
||||||
|
-webkit-line-clamp: 2;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis; }
|
||||||
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Image {
|
.LP-PlaceTeaser--extended .LP-PlaceTeaser__Image {
|
||||||
height: 165px;
|
height: 165px;
|
||||||
width: 280px;
|
width: 280px;
|
||||||
@@ -1695,6 +1701,11 @@ body {
|
|||||||
|
|
||||||
.LP-Map {
|
.LP-Map {
|
||||||
margin-bottom: 25px; }
|
margin-bottom: 25px; }
|
||||||
|
.LP-Map--wide {
|
||||||
|
height: 300px; }
|
||||||
|
.LP-Map--full {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%; }
|
||||||
.LP-Map .ol-attribution {
|
.LP-Map .ol-attribution {
|
||||||
font-family: "Montserrat", Helvetica, sans-serif;
|
font-family: "Montserrat", Helvetica, sans-serif;
|
||||||
color: #565656; }
|
color: #565656; }
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
{% 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">{% trans '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">{% trans '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">{% trans 'Admin' %}</span></a>
|
| <a class="LP-Link" href="{% url 'admin:index' %}" target="_blank"><span class="LP-Link__Text">{% trans 'Admin' %}</span></a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -50,7 +50,7 @@
|
|||||||
<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">{% trans '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">{% trans '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>
|
||||||
|
<li class="LP-Menu__Item"><a href="{% url 'osm' %}" class="LP-Link"><span class="LP-Link__Text">{% trans 'Map' %}</span></a></li>
|
||||||
{% block additional_menu_items %}
|
{% block additional_menu_items %}
|
||||||
{% endblock additional_menu_items %}
|
{% endblock additional_menu_items %}
|
||||||
|
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
<article class="LP-TextSection">
|
<article class="LP-TextSection">
|
||||||
</article>
|
</article>
|
||||||
|
|
||||||
{% include 'partials/osm_map.html' with config=mapping_config %}
|
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
|
||||||
<div class="LP-PlaceGrid">
|
<div class="LP-PlaceGrid">
|
||||||
<h1 class="LP-Headline LP-Headline">{% trans '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">
|
||||||
|
16
django_lostplaces/lostplaces/templates/osm_map_full.html
Normal file
16
django_lostplaces/lostplaces/templates/osm_map_full.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{% extends 'global.html'%}
|
||||||
|
|
||||||
|
{% load static %}
|
||||||
|
{% load i18n %}
|
||||||
|
{% block additional_head %}
|
||||||
|
<link rel="stylesheet" href="{% static 'maps/ol.css' %}" type="text/css">
|
||||||
|
<script src="{% static 'maps/ol.js' %}"></script>
|
||||||
|
{% endblock additional_head %}
|
||||||
|
|
||||||
|
# {% block title %}{% trans 'Map' %}{% endblock %}
|
||||||
|
|
||||||
|
{% block maincontent %}
|
||||||
|
|
||||||
|
{% include 'partials/osm_map.html' with config=mapping_config modifier='full' %}
|
||||||
|
|
||||||
|
{% endblock maincontent %}
|
@@ -1,5 +1,5 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
<div tabindex="1" id="map" class="LP-Map map" style="height: 300px"></div>
|
<div tabindex="1" id="map" class="LP-Map {% if modifier %}LP-Map--{{modifier}}{% endif %} map"></div>
|
||||||
<div id="info" class="map-popup LP-Map__Popup"></div>
|
<div id="info" class="map-popup LP-Map__Popup"></div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
|
|
||||||
<section class="LP-Section">
|
<section class="LP-Section">
|
||||||
<h1 class="LP-Headline">{% trans 'Map links' %}</h1>
|
<h1 class="LP-Headline">{% trans 'Map links' %}</h1>
|
||||||
{% include 'partials/osm_map.html' with config=mapping_config%}
|
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
|
||||||
<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>
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
{% block maincontent %}
|
{% block maincontent %}
|
||||||
|
|
||||||
{% include 'partials/osm_map.html' with config=mapping_config %}
|
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %}
|
||||||
<div class="LP-PlaceList">
|
<div class="LP-PlaceList">
|
||||||
<h1 class="LP-Headline">{% trans 'Our lost places' %}</h1>
|
<h1 class="LP-Headline">{% trans 'Our lost places' %}</h1>
|
||||||
<ul class="LP-PlaceList__List">
|
<ul class="LP-PlaceList__List">
|
||||||
|
@@ -18,7 +18,8 @@ from lostplaces.views import (
|
|||||||
PlaceImageCreateView,
|
PlaceImageCreateView,
|
||||||
PlaceImageDeleteView,
|
PlaceImageDeleteView,
|
||||||
FlatView,
|
FlatView,
|
||||||
ExplorerProfileView
|
ExplorerProfileView,
|
||||||
|
OSMMapView
|
||||||
)
|
)
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
@@ -41,7 +42,8 @@ urlpatterns = [
|
|||||||
path('explorer/<int:explorer_id>/', ExplorerProfileView.as_view(), name='explorer_profile'),
|
path('explorer/<int:explorer_id>/', ExplorerProfileView.as_view(), name='explorer_profile'),
|
||||||
|
|
||||||
path('explorer/favorite/<int:place_id>/', PlaceFavoriteView.as_view(), name='place_favorite'),
|
path('explorer/favorite/<int:place_id>/', PlaceFavoriteView.as_view(), name='place_favorite'),
|
||||||
path('explorer/unfavorite/<int:place_id>/', PlaceUnfavoriteView.as_view(), name='place_unfavorite')
|
path('explorer/unfavorite/<int:place_id>/', PlaceUnfavoriteView.as_view(), name='place_unfavorite'),
|
||||||
|
path('osm/', OSMMapView.as_view(), name='osm')
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@@ -10,10 +10,11 @@ from django.contrib.auth.mixins import UserPassesTestMixin, LoginRequiredMixin
|
|||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
|
|
||||||
from django.shortcuts import redirect, get_object_or_404
|
from django.shortcuts import redirect, get_object_or_404
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy, reverse
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from lostplaces.models import Place
|
from lostplaces.models import Place
|
||||||
|
from lostplaces.common import redirect_referer_or
|
||||||
|
|
||||||
class IsAuthenticatedMixin(LoginRequiredMixin, View):
|
class IsAuthenticatedMixin(LoginRequiredMixin, View):
|
||||||
'''
|
'''
|
||||||
@@ -108,4 +109,4 @@ class PlaceAssetDeleteView(IsAuthenticatedMixin, IsPlaceSubmitterMixin, SingleOb
|
|||||||
place_id = self.get_object().place.id
|
place_id = self.get_object().place.id
|
||||||
self.get_object().delete()
|
self.get_object().delete()
|
||||||
messages.success(self.request, self.success_message)
|
messages.success(self.request, self.success_message)
|
||||||
return redirect(reverse_lazy('place_detail', kwargs={'pk': place_id}))
|
return redirect_referer_or(request, reverse('place_detail', kwargs={'pk': place_id}))
|
||||||
|
@@ -16,7 +16,7 @@ from lostplaces.models.place import Place, PlaceAsset
|
|||||||
class ExplorerProfileView(IsAuthenticatedMixin, View):
|
class ExplorerProfileView(IsAuthenticatedMixin, View):
|
||||||
def get(self, request, explorer_id):
|
def get(self, request, explorer_id):
|
||||||
explorer = get_object_or_404(Explorer, pk=explorer_id)
|
explorer = get_object_or_404(Explorer, pk=explorer_id)
|
||||||
place_list = Place.objects.filter(submitted_by=explorer)
|
place_list = explorer.places.all()
|
||||||
place_count = place_list.count()
|
place_count = place_list.count()
|
||||||
|
|
||||||
context={
|
context={
|
||||||
|
@@ -13,12 +13,13 @@ from django.contrib.messages.views import SuccessMessageMixin
|
|||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
|
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy, reverse
|
||||||
|
|
||||||
from lostplaces.models import Place, PlaceImage
|
from lostplaces.models import Place, PlaceImage
|
||||||
from lostplaces.views.base_views import IsAuthenticatedMixin, IsPlaceSubmitterMixin
|
from lostplaces.views.base_views import IsAuthenticatedMixin, IsPlaceSubmitterMixin
|
||||||
from lostplaces.views.place_image_views import MultiplePlaceImageUploadMixin
|
from lostplaces.views.place_image_views import MultiplePlaceImageUploadMixin
|
||||||
from lostplaces.forms import PlaceForm, PlaceImageForm, TagSubmitForm
|
from lostplaces.forms import PlaceForm, PlaceImageForm, TagSubmitForm
|
||||||
|
from lostplaces.common import redirect_referer_or
|
||||||
|
|
||||||
from taggit.models import Tag
|
from taggit.models import Tag
|
||||||
|
|
||||||
@@ -104,7 +105,14 @@ class PlaceCreateView(MultiplePlaceImageUploadMixin, IsAuthenticatedMixin, View)
|
|||||||
self.request,
|
self.request,
|
||||||
_('Please fill in all required fields.')
|
_('Please fill in all required fields.')
|
||||||
)
|
)
|
||||||
return render(request, 'place/place_create.html', context={'form': place_form})
|
return render(
|
||||||
|
request=request,
|
||||||
|
template_name='place/place_create.html',
|
||||||
|
context={
|
||||||
|
'place_form': place_form,
|
||||||
|
'place_image_form': PlaceImageForm()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
class PlaceDeleteView(IsAuthenticatedMixin, IsPlaceSubmitterMixin, DeleteView):
|
class PlaceDeleteView(IsAuthenticatedMixin, IsPlaceSubmitterMixin, DeleteView):
|
||||||
template_name = 'place/place_delete.html'
|
template_name = 'place/place_delete.html'
|
||||||
@@ -127,14 +135,8 @@ class PlaceFavoriteView(IsAuthenticatedMixin, View):
|
|||||||
if request.user is not None:
|
if request.user is not None:
|
||||||
request.user.explorer.favorite_places.add(place)
|
request.user.explorer.favorite_places.add(place)
|
||||||
request.user.explorer.save()
|
request.user.explorer.save()
|
||||||
|
|
||||||
referer = request.META.get('HTTP_REFERER')
|
return redirect_referer_or(request, reverse('place_detail', kwargs={'pk': place.pk}))
|
||||||
if referer is not None:
|
|
||||||
return redirect(referer)
|
|
||||||
else:
|
|
||||||
return redirect(
|
|
||||||
reverse_lazy('place_detail', kwargs={'pk': place.pk})
|
|
||||||
)
|
|
||||||
|
|
||||||
class PlaceUnfavoriteView(IsAuthenticatedMixin, View):
|
class PlaceUnfavoriteView(IsAuthenticatedMixin, View):
|
||||||
|
|
||||||
@@ -144,10 +146,4 @@ class PlaceUnfavoriteView(IsAuthenticatedMixin, View):
|
|||||||
request.user.explorer.favorite_places.remove(place)
|
request.user.explorer.favorite_places.remove(place)
|
||||||
request.user.explorer.save()
|
request.user.explorer.save()
|
||||||
|
|
||||||
referer = request.META.get('HTTP_REFERER')
|
return redirect_referer_or(request, reverse('place_detail', kwargs={'pk': place.pk}))
|
||||||
if referer is not None:
|
|
||||||
return redirect(referer)
|
|
||||||
else:
|
|
||||||
return redirect(
|
|
||||||
reverse_lazy('place_detail', kwargs={'pk': place.pk})
|
|
||||||
)
|
|
@@ -6,7 +6,7 @@ from django.views.generic.edit import CreateView
|
|||||||
|
|
||||||
from django.contrib.messages.views import SuccessMessageMixin
|
from django.contrib.messages.views import SuccessMessageMixin
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.urls import reverse_lazy
|
from django.urls import reverse_lazy, reverse
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
from django.http import HttpResponseForbidden
|
from django.http import HttpResponseForbidden
|
||||||
from django.utils.translation import ugettext_lazy as _
|
from django.utils.translation import ugettext_lazy as _
|
||||||
@@ -14,6 +14,7 @@ from django.utils.translation import ugettext_lazy as _
|
|||||||
from lostplaces.forms import ExplorerCreationForm, TagSubmitForm
|
from lostplaces.forms import ExplorerCreationForm, TagSubmitForm
|
||||||
from lostplaces.models import Place, PhotoAlbum
|
from lostplaces.models import Place, PhotoAlbum
|
||||||
from lostplaces.views.base_views import IsAuthenticatedMixin
|
from lostplaces.views.base_views import IsAuthenticatedMixin
|
||||||
|
from lostplaces.common import redirect_referer_or
|
||||||
|
|
||||||
from lostplaces.views.base_views import (
|
from lostplaces.views.base_views import (
|
||||||
PlaceAssetCreateView,
|
PlaceAssetCreateView,
|
||||||
@@ -79,10 +80,22 @@ class PlaceTagDeleteView(IsAuthenticatedMixin, View):
|
|||||||
place = get_object_or_404(Place, pk=tagged_id)
|
place = get_object_or_404(Place, pk=tagged_id)
|
||||||
tag = get_object_or_404(Tag, pk=tag_id)
|
tag = get_object_or_404(Tag, pk=tag_id)
|
||||||
place.tags.remove(tag)
|
place.tags.remove(tag)
|
||||||
return redirect(reverse_lazy('place_detail', kwargs={'pk': tagged_id}))
|
|
||||||
|
return redirect_referer_or(request, reverse('place_detail', kwargs={'pk': tagged_id}))
|
||||||
|
|
||||||
def FlatView(request, slug):
|
def FlatView(request, slug):
|
||||||
if request.LANGUAGE_CODE == 'de':
|
if request.LANGUAGE_CODE == 'de':
|
||||||
return render(request, 'flat/' + slug + '-de' + '.html')
|
return render(request, 'flat/' + slug + '-de' + '.html')
|
||||||
else:
|
else:
|
||||||
return render(request, 'flat/' + slug + '.html')
|
return render(request, 'flat/' + slug + '.html')
|
||||||
|
|
||||||
|
class OSMMapView(IsAuthenticatedMixin, View):
|
||||||
|
def get(self, request):
|
||||||
|
place_list = Place.objects.all()
|
||||||
|
context = {
|
||||||
|
'mapping_config': {
|
||||||
|
'all_points': place_list,
|
||||||
|
'map_center': Place.average_latlon(place_list)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return render(request, 'osm_map_full.html', context)
|
||||||
|
Reference in New Issue
Block a user