Skip to content

Commit 8258ccd

Browse files
uxairibrarnuest
authored andcommitted
Added locate functionality
1 parent d676973 commit 8258ccd

File tree

4 files changed

+134
-0
lines changed

4 files changed

+134
-0
lines changed

publications/templates/footer.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
<a class="px-2 text-white" title="Accessibility / Barrierefreiheit" href="{% url 'optimap:accessibility' %}">Accessibility</a>
77
<a class="px-2 text-white" title="Data & API documentation and browser" href="{% url 'optimap:data' %}">Data & API</a>
88
<a class="px-3 text-white" title="Feeds" href="{% url 'optimap:feeds' %}">Feeds</a>
9+
<a class="px-2 text-white" title="Help locate publications without geolocation data" href="{% url 'optimap:locate' %}">Locate</a>
910
<a class="px-2 text-white" title="Link to source code project" href="https://github.com/GeoinformationSystems/optimap">Code&nbsp;(v{{ optimap_version }})</a>
1011
<a class="px-2 text-white" title="About / Contact / Imprint" href="{% url 'optimap:about' %}">About / Contact / Imprint</a>
1112
<span class="px-3">Data license: <a class="text-white" title="Publication metadata license" href='https://creativecommons.org/publicdomain/zero/1.0/'>CC-0</a></span>

publications/templates/locate.html

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
{% extends "main.html" %}
2+
3+
{% block title %}Locate Publications | {% endblock %}
4+
5+
{% block head %}
6+
{{ block.super }}
7+
<style>
8+
.locate-container {
9+
max-width: 100%;
10+
overflow-wrap: break-word;
11+
word-wrap: break-word;
12+
word-break: break-word;
13+
hyphens: auto;
14+
}
15+
.locate-container p, .locate-container div, .locate-container span {
16+
max-width: 100%;
17+
overflow-wrap: break-word;
18+
word-wrap: break-word;
19+
}
20+
</style>
21+
{% endblock %}
22+
23+
{% block content %}
24+
25+
<div class="container-fluid locate-container">
26+
<div class="row justify-content-center">
27+
<div class="col-md-10 col-lg-8 py-5">
28+
<h1 class="py-2">Locate Publications</h1>
29+
30+
<p class="lead">Help us locate scientific publications on the map!</p>
31+
32+
<p class="text-wrap text-break">The publications listed below have been harvested from various scientific sources but do not have geolocation data yet. If you know the geographic location or area mentioned in any of these publications, you can help us improve our database.</p>
33+
34+
{% if total_count > 0 %}
35+
<div class="alert alert-info text-break" role="alert">
36+
<i class="fas fa-info-circle"></i>
37+
<strong>{{ total_count }}</strong> publication{{ total_count|pluralize }} need{{ total_count|pluralize:"s," }} geolocation data.
38+
</div>
39+
40+
<div class="row">
41+
{% for publication in publications %}
42+
<div class="col-md-6 mb-4">
43+
<div class="card h-100">
44+
<div class="card-body">
45+
<h5 class="card-title text-break">
46+
{% if publication.doi %}
47+
<a href="https://doi.org/{{ publication.doi }}" target="_blank" class="text-decoration-none">
48+
{{ publication.title|truncatechars:100 }}
49+
<i class="fas fa-external-link-alt fa-sm"></i>
50+
</a>
51+
{% else %}
52+
{{ publication.title|truncatechars:100 }}
53+
{% endif %}
54+
</h5>
55+
56+
{% if publication.abstract %}
57+
<p class="card-text text-muted text-break">
58+
{{ publication.abstract|truncatechars:200 }}
59+
</p>
60+
{% endif %}
61+
62+
<div class="card-footer bg-transparent">
63+
<small class="text-muted text-break">
64+
{% if publication.publicationDate %}
65+
Published: {{ publication.publicationDate|date:"M d, Y" }}
66+
{% endif %}
67+
{% if publication.source %}
68+
<br>Source: {{ publication.source.name }}
69+
{% endif %}
70+
{% if publication.doi %}
71+
<br>DOI: <span class="text-break">{{ publication.doi }}</span>
72+
{% endif %}
73+
</small>
74+
</div>
75+
</div>
76+
</div>
77+
</div>
78+
{% endfor %}
79+
</div>
80+
81+
{% if publications|length >= 20 %}
82+
<div class="alert alert-secondary mt-4" role="alert">
83+
<i class="fas fa-info-circle"></i>
84+
Showing first 20 publications. More publications without geolocation data are available.
85+
</div>
86+
{% endif %}
87+
88+
{% else %}
89+
<div class="alert alert-success" role="alert">
90+
<i class="fas fa-check-circle"></i>
91+
Great! All harvested publications currently have geolocation data.
92+
</div>
93+
{% endif %}
94+
95+
<div class="mt-5">
96+
<h3>How to help</h3>
97+
<p>If you recognize any publications that reference specific geographic locations, please contact us with the following information:</p>
98+
<ul>
99+
<li>Publication DOI or title</li>
100+
<li>Geographic coordinates (latitude/longitude) or place names</li>
101+
<li>Brief description of the geographic relevance</li>
102+
</ul>
103+
<p>
104+
<a href="/about" class="btn btn-primary">
105+
<i class="fas fa-envelope"></i> Contact Us
106+
</a>
107+
<a href="/" class="btn btn-outline-secondary">
108+
<i class="fas fa-map"></i> Back to Map
109+
</a>
110+
</p>
111+
</div>
112+
</div>
113+
</div>
114+
115+
{% endblock content %}

publications/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@
5656
GeoFeedByGeometry(feed_type_variant="georss"), name="feed-georss-by-slug",),
5757
path("feeds/geoatom/<slug:geometry_slug>/",
5858
GeoFeedByGeometry(feed_type_variant="geoatom"), name="feed-geoatom-by-slug"),
59+
path('locate/', views.locate, name="locate"),
5960

6061
]

publications/views.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,23 @@ def download_geopackage(request):
128128
def main(request):
129129
return render(request, "main.html")
130130

131+
def locate(request):
132+
# Get publications that are harvested but have no geometry
133+
publications_query = Publication.objects.filter(
134+
status='h', # Harvested status
135+
geometry__isnull=True # No geometry data
136+
).order_by('-creationDate')
137+
138+
total_count = publications_query.count()
139+
# Limit to first 20 for performance (no pagination)
140+
publications_without_geo = publications_query[:20]
141+
142+
context = {
143+
'publications': publications_without_geo,
144+
'total_count': total_count,
145+
}
146+
return render(request, 'locate.html', context)
147+
131148
def about(request):
132149
return render(request, 'about.html')
133150

0 commit comments

Comments
 (0)