From: Radek Czajka Date: Sat, 10 Jun 2023 18:34:06 +0000 (+0200) Subject: map X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/3276983123b2b6c99285d2a10820255f433deec8?ds=inline map --- diff --git a/src/references/templates/references/map.html b/src/references/templates/references/map.html index 620483712..e97ccbfb7 100644 --- a/src/references/templates/references/map.html +++ b/src/references/templates/references/map.html @@ -1,35 +1,71 @@ +{% extends "2022/base.html" %} + {% load l10n %} - +{% block extrahead %} + -
- + +{% endblock %} + +{% block global-content %} + +
+ +{% endblock %} + + +{% block extrabody %} + + + map.addLayer(markers); + + +{% endblock %} diff --git a/src/references/templates/references/popup.html b/src/references/templates/references/popup.html new file mode 100644 index 000000000..506cb3292 --- /dev/null +++ b/src/references/templates/references/popup.html @@ -0,0 +1,11 @@ +{% load thumbnail %} +

{{ entity.label }}

+ +
+{% for ref in entity.reference_set.all %} + + {% thumbnail ref.book.cover_clean '150x150' as th %} + {{ ref.book.pretty_title }} + {% endthumbnail %} + +{% endfor %} diff --git a/src/references/urls.py b/src/references/urls.py index 5bd2a62cc..bc6c10499 100644 --- a/src/references/urls.py +++ b/src/references/urls.py @@ -4,4 +4,5 @@ from . import views urlpatterns = [ path('mapa/', views.map), + path('popup/', views.popup), ] diff --git a/src/references/views.py b/src/references/views.py index b98d181f1..773a37d1c 100644 --- a/src/references/views.py +++ b/src/references/views.py @@ -1,9 +1,18 @@ -from django.shortcuts import render +from django.views.decorators.cache import never_cache +from django.shortcuts import render, get_object_or_404 from . import models def map(request): return render(request, 'references/map.html', { 'entities': models.Entity.objects.exclude(lat=None).exclude(lon=None), + 'funding_no_show_current': True, }) - + +@never_cache +def popup(request, pk): + e = get_object_or_404(models.Entity, pk=pk) + return render(request, 'references/popup.html', { + 'entity': e, + }) +