#46 Large Map
This commit is contained in:
parent
e242dc4add
commit
5df7cc5ec6
@ -1701,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 %}
|
||||||
|
|
||||||
|
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 %}
|
@ -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')
|
||||||
|
|
||||||
|
|
||||||
]
|
]
|
||||||
|
@ -88,3 +88,14 @@ def FlatView(request, slug):
|
|||||||
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user