From 45faf8d99559653d64343706cac8d3e18c17408f Mon Sep 17 00:00:00 2001 From: Jona Date: Wed, 18 Oct 2023 18:55:45 -0400 Subject: [PATCH] Try using the templates to avoid maps for non-spatial tables --- .../cloud_run_tipg/templates/collection.html | 77 +++++++++ .../cloud_run_tipg/templates/item.html | 96 ++++++++++++ .../cloud_run_tipg/templates/items.html | 147 ++++++++++++++++++ 3 files changed, 320 insertions(+) create mode 100644 cerulean_cloud/cloud_run_tipg/templates/collection.html create mode 100644 cerulean_cloud/cloud_run_tipg/templates/item.html create mode 100644 cerulean_cloud/cloud_run_tipg/templates/items.html diff --git a/cerulean_cloud/cloud_run_tipg/templates/collection.html b/cerulean_cloud/cloud_run_tipg/templates/collection.html new file mode 100644 index 00000000..5ebc1740 --- /dev/null +++ b/cerulean_cloud/cloud_run_tipg/templates/collection.html @@ -0,0 +1,77 @@ +{% include "header.html" %} + + + +

Collection: {{ response.title or response.id }}

+ +
+
+

{{ response.description or response.title or response.id }}

+ {% if "keywords" in response and length(response.keywords) > 0 %} +
+

+ {% for keyword in response.keywords %} + {{ keyword }} + {% endfor %} +

+
+ {% endif %} + +

Links

+ +
+
+
+ Loading... +
+
+
+ + + +{% include "footer.html" %} diff --git a/cerulean_cloud/cloud_run_tipg/templates/item.html b/cerulean_cloud/cloud_run_tipg/templates/item.html new file mode 100644 index 00000000..e8654220 --- /dev/null +++ b/cerulean_cloud/cloud_run_tipg/templates/item.html @@ -0,0 +1,96 @@ +{% include "header.html" %} + + + +

Collection Item: {{ response.id }}

+ +
+
+

Properties

+
    +
  • ID: {{ response.id }}
  • + {% for key, value in response.properties.items() %} +
  • {{ key }}: {{ value }}
  • + {% endfor %} +
+
+
+
Loading...
+
+
+ + + +{% include "footer.html" %} diff --git a/cerulean_cloud/cloud_run_tipg/templates/items.html b/cerulean_cloud/cloud_run_tipg/templates/items.html new file mode 100644 index 00000000..ad66ed23 --- /dev/null +++ b/cerulean_cloud/cloud_run_tipg/templates/items.html @@ -0,0 +1,147 @@ +{% include "header.html" %} + +{% set show_prev_link = false %} +{% set show_next_link = false %} +{% if 'items?' in url %} + {% set urlq = url + '&' %} + {% else %} + {% set urlq = url + '?' %} +{% endif %} + + + + +

Collection Items: {{ response.title or response.id }}

+ +
Loading...
+ +

+ Number of matching items: {{ response.numberMatched }}
+ Number of returned items: {{ response.numberReturned }}
+ Page: of
+

+ +
+ {% for link in response.links %} + {% if link.rel == 'prev' %} + + {% endif %} + {% endfor %} +
+ +
+ {% for link in response.links %} + {% if link.rel == 'next' %} + + {% endif %} + {% endfor %} +
+
+{% if response.features is defined and response.features|length > 0 %} + + + +{% for key, value in response.features.0.properties.items() %} + +{% endfor %} + + +{% for feature in response.features %} + + + {% for key, value in feature.properties.items() %} + + {% endfor %} + +{% endfor %} + +
ID{{ key }}
{{ feature.id }}{{ value }}
+{% endif %} +
+ + + +{% include "footer.html" %}