Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes core api, adds matomo snippet #78

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions histogis/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.urls import path, include
from django.contrib import admin
from rest_framework import routers
from rest_framework.documentation import include_docs_urls
from vocabs import api_views
from shps import api_views as shps_api_views

Expand All @@ -24,7 +23,6 @@
shps_api_views.TemporalizedSpatialQuery.as_view(),
name="where_was_api",
),
path("api-docs/", include_docs_urls(title="HistoGIS-API")),
path("api-auth/", include("rest_framework.urls", namespace="rest_framework")),
path("admin/", admin.site.urls),
path("vocabs/", include("vocabs.urls", namespace="vocabs")),
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Django>=5.0.6,<6
djangorestframework-gis
geopandas
psycopg2-binary
coreapi
lxml
rdflib
requests
Expand Down
39 changes: 0 additions & 39 deletions shps/api_views.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import coreapi
import coreschema
from dateutil.parser import parse
from django.contrib.gis.geos import Point
from django_filters.rest_framework import DjangoFilterBackend

from rest_framework.schemas import AutoSchema
from rest_framework import generics
from rest_framework import viewsets
from rest_framework.filters import OrderingFilter
Expand Down Expand Up @@ -69,42 +66,6 @@ class TemporalizedSpatialQuery(generics.ListAPIView):

serializer_class = TempSpatialSerializer
pagination_class = StandardResultsSetPagination
schema = AutoSchema(
manual_fields=[
coreapi.Field(
"page_size",
required=False,
location="query",
schema=coreschema.String(
description="Defaults to 1 due to performance reasons."
),
),
coreapi.Field(
"lat",
required=True,
location="query",
schema=coreschema.String(
description="Latitude of the place to query for."
),
),
coreapi.Field(
name="lng",
required=True,
location="query",
schema=coreschema.String(
description="Longitude of the place to query for."
),
),
coreapi.Field(
"when",
required=False,
location="query",
schema=coreschema.String(
description="Date the TempSpatial temporal extent has to contain."
),
),
]
)

def get_queryset(self):
lat = self.request.query_params.get("lat", None)
Expand Down
16 changes: 16 additions & 0 deletions webpage/templates/webpage/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,19 @@
href="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.css"
/>
<link rel="stylesheet" href="{% static 'webpage/css/style.css' %}" />
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://matomo.acdh.oeaw.ac.at/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '87']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

2 changes: 1 addition & 1 deletion webpage/templates/webpage/partials/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
Data
</a>
<ul class="dropdown-menu" aria-labelledby="navbarDropdown">
<li><a class="dropdown-item" href="/api-docs/">API-Docs</a></li>
<li><a class="dropdown-item disabled" href="/api-docs/" aria-disabled="true">API-Docs</a></li>
<li><a class="dropdown-item" href="/api/">API</a></li>
</ul>
</li>
Expand Down
Loading