Skip to content

Commit

Permalink
expose dataset release date in more info bit of filter
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Aug 14, 2023
1 parent 30eec6f commit 1d6244a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class Migration(migrations.Migration):

dependencies = [
("hub", "0041_alter_dataset_subcategory"),
("hub", "0048_alter_area_area_type"),
]

operations = [
Expand Down
1 change: 1 addition & 0 deletions hub/templates/hub/explore.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ <h3 class="h6">${ filter.title }</h3>
<p class="text-muted fs-7 mb-0 mt-3">
<template v-if="filter.description">${ filter.description }.</template>
Data from <a href="${ filter.source }">${ filter.source_label }</a>.
<span v-if="filter.release_date">Last update: ${ filter.release_date }</span>
</p>
<table v-if="Number.isFinite(filter.min)" class="table table-sm table-bordered table-fixed text-center mb-0 mt-3 fs-7">
<thead>
Expand Down
3 changes: 3 additions & 0 deletions hub/views/explore.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ def render_to_response(self, context, **response_kwargs):
is_range=d.is_range,
data_type=d.data_type,
)
if d.release_date is not None:
ds["release_date"] = d.release_date

if (
type_map.get(d.name, None) is not None
and type_map[d.name]["min"] is not None
Expand Down

0 comments on commit 1d6244a

Please sign in to comment.