Skip to content

Commit fd0801c

Browse files
committed
datatables for collection view
1 parent 7c50581 commit fd0801c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sparqlunicorn_ontdoc/export/api/ogcapifeaturesexporter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
127127
"title": "this document as HTML"}]}
128128
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(
129129
deploypath) + "</h1></head>{{collectiontable}}<footer><a href=\"index.json\">This page as JSON</a></footer><script>$(document).ready( function () {$('#collectiontable').DataTable();} );</script></body></html>"
130-
collectiontable = "<table id=\"collectiontable\"><thead><th>Collection</th><th>Links</th></thead><tbody>"
130+
collectiontable = "<table id=\"collectiontable\"><thead><th>Collection</th><th>#Features</th><th>Links</th></thead><tbody>"
131131
apijson["paths"]["/collections"] = {"get": {"tags": ["Collections"], "summary": "describes collections",
132132
"description": "Describes all collections provided by this service",
133133
"operationId": "collections", "parameters": [], "responses": {
@@ -203,7 +203,7 @@ def generateOGCAPIFeaturesPages(outpath,deploypath, featurecollectionspaths, pre
203203
"parameters": [], "responses": {"default": {"description": "default response", "content": {
204204
"application/json": {"schema": {"$ref": "#/components/schemas/Collections"},"example": None}}}}}}
205205
curcollrow = "<tr><td><a href=\"" + opweb.replace(".geojson", "") + "/items/indexc.html\">" + str(
206-
featurecollectionspaths[coll]["name"]) + "</a></td><td><a href=\"" + opweb.replace(".geojson",
206+
featurecollectionspaths[coll]["name"]) + "</a></td><td>"+str(len(curcoll["features"]))+"</td><td><a href=\"" + opweb.replace(".geojson",
207207
"") + "/items/indexc.html\">[Collection as HTML]</a>&nbsp;<a href=\"" + opweb.replace(
208208
".geojson", "") + "/items/\">[Collection as JSON]</a>&nbsp;<a href=\"" + opweb.replace(".geojson",
209209
"") + "/items/index.ttl\">[Collection as TTL]</a></td></tr>"

0 commit comments

Comments
 (0)