Skip to content

Commit 36e0618

Browse files
Merge pull request #49 from developmentseed/update-item-page
Update item page
2 parents 4a28944 + b0b8403 commit 36e0618

File tree

1 file changed

+74
-10
lines changed
  • runtimes/eoapi/stac/eoapi/stac/templates

1 file changed

+74
-10
lines changed

runtimes/eoapi/stac/eoapi/stac/templates/item.html

Lines changed: 74 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
{% include "header.html" %}
1+
{% extends "base.html" %}
2+
23
{% if params %}
34
{% set urlq = url + '?' + params + '&' %}
45
{% else %}
56
{% set urlq = url + '?' %}
67
{% endif %}
78

9+
{% block content %}
810
<nav aria-label="breadcrumb">
911
<ol class="breadcrumb bg-light">
1012
{% for crumb in crumbs %}
@@ -18,20 +20,83 @@
1820
</ol>
1921
</nav>
2022

21-
<h1>Collection Item: {{ response.id }}</h1>
23+
<h1 class="my-4">
24+
<span class="d-block text-uppercase text-muted h6 mb-0">Collection Item:</span>
25+
{{ response.id }}
26+
</h1>
2227

2328
<div class="row">
24-
<div class="col-sm">
29+
<div class="col-md-7">
2530
<h2>Properties</h2>
31+
<ul class="list-unstyled">
32+
<li class="row small mb-1">
33+
<div class="col-3 font-weight-bold">ID</div>
34+
<div class="col-9">
35+
<pre class="mb-0">{{ response.id }}</pre>
36+
</div>
37+
</li>
38+
{% for key, value in response.properties | dictsort %}
39+
<li class="row small mb-1">
40+
<div class="col-3 font-weight-bold">{{ key }}</div>
41+
<div class="col-9">
42+
<pre class="mb-0">{{ value | tojson(2) | trim('"') }}</pre>
43+
</div>
44+
</li>
45+
{% endfor %}
46+
</ul>
47+
48+
<h2 class="mt-5">Assets</h2>
49+
<ul class="list-unstyled">
50+
{% for key, asset in response.assets.items() %}
51+
<li class="mb-4">
52+
<p class="mb-0 font-weight-bold ">
53+
<span class="text-muted text-monospace">{{ key }}</span>
54+
{% if asset.title and not key == asset.title %} &bull; {{ asset.title }}{% endif %}
55+
</p>
56+
{% if asset.type %}<p class="mb-0">{{ asset.type }}</p>{% endif %}
57+
{% if asset.description %}<p class="mb-0">{{ asset.description }}</p>{% endif %}
58+
<ul class="list-inline">
59+
<li class="list-inline-item"><a href="{{ asset.href }}">Asset link</a></li>
60+
{% if asset.alternate %}
61+
{% for alternate_key, alternate_link in asset.alternate.items() %}
62+
<li class="list-inline-item"><a href="{{ alternate_link.href }}">{{ alternate_link.title or alternate_key }}</a></li>
63+
{% endfor %}
64+
{% endif %}
65+
</ul>
66+
{% if asset.roles and asset.roles|length > 0 %}
67+
<ul class="list-inline">
68+
{% for role in asset.roles %}
69+
<li class="list-inline-item badge badge-light">{{ role }}</li>
70+
{% endfor %}
71+
</ul>
72+
{% endif %}
73+
74+
<details class="mt-2">
75+
<summary>Asset Properties</summary>
76+
{% for asset_key, asset_opt in asset | dictsort if asset_key not in ["title", "type", "description", "href", "roles", "alternate"] %}
77+
<div class="row mb-1 small">
78+
<div class="col-3 font-weight-bold">{{ asset_key }}</div>
79+
<div class="col-9">
80+
<pre class="mb-0">{{ asset_opt | tojson(2) }}</pre>
81+
</div>
82+
</div>
83+
{% else %}
84+
No additional properties for this asset.
85+
{% endfor %}
86+
</details>
87+
</li>
88+
{% endfor %}
89+
</ul>
90+
91+
<h2 class="mt-5">Links</h2>
2692
<ul>
27-
<li><strong>ID:</strong> {{ response.id }}</li>
28-
{% for key, value in response.properties.items() %}
29-
<li><strong>{{ key }}:</strong> {{ value }}</li>
93+
{% for link in response.links %}
94+
<li><a href="{{ link.href }}">{{ link.title or link.rel }}</a></li>
3095
{% endfor %}
3196
</ul>
3297
</div>
33-
<div class="col-sm">
34-
<div id="map" class="rounded" style="width:100%;height:400px;">Loading...</div>
98+
<div class="col-md-5">
99+
<div id="map" class="rounded" style="width:100%; height:calc(-6rem + 100vh); position: sticky; top: 5rem;">Loading...</div>
35100
</div>
36101
</div>
37102

@@ -97,5 +162,4 @@ <h2>Properties</h2>
97162
}
98163

99164
</script>
100-
101-
{% include "footer.html" %}
165+
{% endblock %}

0 commit comments

Comments
 (0)