github.com/PDOK/gokoala@v0.50.6/internal/ogc/common/geospatial/templates/collections.go.html (about)

     1  {{- /*gotype: github.com/PDOK/gokoala/internal/engine.TemplateData*/ -}}
     2  {{define "content"}}
     3  {{ $cfg := .Config }}
     4  {{ $baseUrl := $cfg.BaseURL }}
     5  <hgroup>
     6      <h1 class="title" id="title">{{ .Config.Title }} - {{ i18n "Collections" }}</h1>
     7  </hgroup>
     8  
     9  <section class="row row-cols-md-4 g-4 py-3">
    10      {{ range $index, $coll := .Config.AllCollections.Unique }}
    11          <div class="col-md-4 col-sm-12">
    12              <div class="card h-100">
    13                  <h2 class="card-header h5">
    14                      {{ if and $coll.Metadata $coll.Metadata.Title }}
    15                      <a href="{{ $baseUrl }}/collections/{{ $coll.ID }}" aria-label="{{ i18n "To" }} {{ $coll.Metadata.Title }}">{{ $coll.Metadata.Title }}</a>
    16                      {{ else }}
    17                      <a href="{{ $baseUrl }}/collections/{{ $coll.ID }}" aria-label="{{ i18n "To" }} {{ $coll.ID }}">{{ $coll.ID }}</a>
    18                      {{ end }}
    19                  </h2>
    20                  <div class="card-body">
    21                      {{ if and $coll.Metadata $coll.Metadata.Description }}
    22                          {{ markdown $coll.Metadata.Description }}
    23                      {{ end }}
    24                      <small class="text-body-secondary">{{ i18n "ViewCollectionAs" }} <a href="{{ $baseUrl }}/collections/{{ $coll.ID }}?f=json" target="_blank" aria-label="{{ i18n "Collection" }} {{ i18n "As" }} JSON">JSON</a></small>
    25                  </div>
    26                  <ul class="list-group list-group-flush">
    27                      {{ if and $coll.Metadata $coll.Metadata.Keywords }}
    28                      <li class="list-group-item">
    29                          <strong>{{ i18n "Keywords" }}</strong>: {{ $coll.Metadata.Keywords | join ", " }}
    30                      </li>
    31                      {{ end }}
    32                      {{/* <li class="list-group-item"><b>Schema</b>: TODO link to collection schema</li> */}}
    33                      {{ if and $coll.Metadata $coll.Metadata.LastUpdated }}
    34                      <li class="list-group-item">
    35                          {{ if and $coll.Metadata $coll.Metadata.LastUpdatedBy }}
    36                          <strong>{{ i18n "UpdatedBy" }} {{ $coll.Metadata.LastUpdatedBy }} {{ i18n "On" }}</strong>:
    37                          {{ else if $cfg.LastUpdatedBy }}
    38                          <strong>{{ i18n "UpdatedBy" }} {{ $cfg.LastUpdatedBy }} {{ i18n "On" }}</strong>:
    39                          {{ else }}
    40                          <strong>{{ i18n "LastUpdated" }}</strong>:
    41                          {{ end }}
    42                          {{ toDate "2006-01-02T15:04:05Z07:00" $coll.Metadata.LastUpdated | date "2006-01-02" }}
    43                      </li>
    44                      {{ else if $cfg.LastUpdated }}
    45                      <li class="list-group-item">
    46                          {{ if $cfg.LastUpdatedBy }}
    47                          <strong>{{ i18n "UpdatedBy" }} {{ $cfg.LastUpdatedBy }} {{ i18n "On" }}</strong>:
    48                          {{ else }}
    49                          <strong>{{ i18n "LastUpdated" }}</strong>:
    50                          {{ end }}
    51                          {{ toDate "2006-01-02T15:04:05Z07:00" $cfg.LastUpdated | date "2006-01-02" }}
    52                      </li>
    53                      {{ end }}
    54                      {{ if and $coll.Metadata $coll.Metadata.Extent }}
    55                      <li class="list-group-item">
    56                          <strong>{{ i18n "GeographicExtent" }}</strong>
    57                          {{ if $coll.Metadata.Extent.Srs }}
    58                          (<a href="http://www.opengis.net/def/crs/EPSG/0/{{ trimPrefix "EPSG:" $coll.Metadata.Extent.Srs }}" target="_blank"
    59                              aria-label="{{ i18n "To" }} {{ $coll.Metadata.Extent.Srs }} {{ i18n "Definition" }}">{{ $coll.Metadata.Extent.Srs }}</a>):
    60                          {{ else }}
    61                          (<a href="http://www.opengis.net/def/crs/OGC/1.3/CRS84" target="_blank"
    62                              aria-label="{{ i18n "To" }} CRS84 {{ i18n "Definition" }}">CRS84</a>):
    63                          {{ end }}
    64                          {{ $coll.Metadata.Extent.Bbox | join ", " }}
    65                      </li>
    66                      {{ end }}
    67                      {{ if and $coll.Metadata $coll.Metadata.Extent $coll.Metadata.Extent.Interval }}
    68                      <li class="list-group-item">
    69                          <strong>{{ i18n "TemporalExtent" }}</strong>
    70                          (<a href="http://www.opengis.net/def/uom/ISO-8601/0/Gregorian" target="_blank" aria-label="{{ i18n "To" }} ISO-8601 {{ i18n "Definition" }}">ISO-8601</a>):
    71                          {{ toDate "2006-01-02T15:04:05Z" ((first $coll.Metadata.Extent.Interval) | replace "\"" "") | date "2006-01-02" }} /
    72                          {{ if not (contains "null" (last $coll.Metadata.Extent.Interval)) }}{{ toDate "2006-01-02T15:04:05Z" ((last $coll.Metadata.Extent.Interval) | replace "\"" "") | date "2006-01-02" }}{{ else }}..{{ end }}
    73                      </li>
    74                      {{ end }}
    75                  </ul>
    76                  {{ if and $coll.Metadata $coll.Metadata.Thumbnail }}
    77                  <img src="resources/{{ $coll.Metadata.Thumbnail }}" class="card-img-bottom" alt="{{ $coll.ID }} Thumbnail">
    78                  {{ end }}
    79              </div>
    80          </div>
    81      {{end}}
    82  </section>
    83  {{end}}