Skip to content

Commit

Permalink
datatables for collection view
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Jan 12, 2025
1 parent 7c50581 commit fd0801c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sparqlunicorn_ontdoc/export/api/ogcapifeaturesexporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
"title": "this document as HTML"}]}
collectionshtml = "<html><head><meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /><link rel=\"stylesheet\" href=\"https://cdn.datatables.net/2.2.1/css/dataTables.dataTables.css\" /><script src=\"https://code.jquery.com/jquery-3.7.1.js\"></script><script src=\"https://cdn.datatables.net/2.2.1/js/dataTables.js\"></script></head><body><header><h1>Collections of " + str(
deploypath) + "</h1></head>{{collectiontable}}<footer><a href=\"index.json\">This page as JSON</a></footer><script>$(document).ready( function () {$('#collectiontable').DataTable();} );</script></body></html>"
collectiontable = "<table id=\"collectiontable\"><thead><th>Collection</th><th>Links</th></thead><tbody>"
collectiontable = "<table id=\"collectiontable\"><thead><th>Collection</th><th>#Features</th><th>Links</th></thead><tbody>"
apijson["paths"]["/collections"] = {"get": {"tags": ["Collections"], "summary": "describes collections",
"description": "Describes all collections provided by this service",
"operationId": "collections", "parameters": [], "responses": {
Expand Down Expand Up @@ -203,7 +203,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
"parameters": [], "responses": {"default": {"description": "default response", "content": {
"application/json": {"schema": {"$ref": "#/components/schemas/Collections"},"example": None}}}}}}
curcollrow = "<tr><td><a href=\"" + opweb.replace(".geojson", "") + "/items/indexc.html\">" + str(
featurecollectionspaths[coll]["name"]) + "</a></td><td><a href=\"" + opweb.replace(".geojson",
featurecollectionspaths[coll]["name"]) + "</a></td><td>"+str(len(curcoll["features"]))+"</td><td><a href=\"" + opweb.replace(".geojson",
"") + "/items/indexc.html\">[Collection as HTML]</a>&nbsp;<a href=\"" + opweb.replace(
".geojson", "") + "/items/\">[Collection as JSON]</a>&nbsp;<a href=\"" + opweb.replace(".geojson",
"") + "/items/index.ttl\">[Collection as TTL]</a></td></tr>"
Expand Down

0 comments on commit fd0801c

Please sign in to comment.