Compare commits

..

No commits in common. "5df7cc5ec6048b4e3cda69046b969a06094bbab5" and "f73fa616d06a5c7eefac5b2df970004812c0a209" have entirely different histories.

9 changed files with 8 additions and 42 deletions

View File

@ -1701,11 +1701,6 @@ 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; }

View File

@ -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 %}

View File

@ -15,7 +15,7 @@
<article class="LP-TextSection"> <article class="LP-TextSection">
</article> </article>
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %} {% include 'partials/osm_map.html' with config=mapping_config %}
<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">

View File

@ -1,16 +0,0 @@
{% 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 %}

View File

@ -1,5 +1,5 @@
{% load static %} {% load static %}
<div tabindex="1" id="map" class="LP-Map {% if modifier %}LP-Map--{{modifier}}{% endif %} map"></div> <div tabindex="1" id="map" class="LP-Map map" style="height: 300px"></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">

View File

@ -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 modifier='wide' %} {% 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>

View File

@ -11,7 +11,7 @@
{% block maincontent %} {% block maincontent %}
{% include 'partials/osm_map.html' with config=mapping_config modifier='wide' %} {% include 'partials/osm_map.html' with config=mapping_config %}
<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">

View File

@ -18,8 +18,7 @@ from lostplaces.views import (
PlaceImageCreateView, PlaceImageCreateView,
PlaceImageDeleteView, PlaceImageDeleteView,
FlatView, FlatView,
ExplorerProfileView, ExplorerProfileView
OSMMapView
) )
urlpatterns = [ urlpatterns = [
@ -42,8 +41,7 @@ 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')
] ]

View File

@ -88,14 +88,3 @@ 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)