From 0183254f3c312d306aff2e896b50e6b7646c89d6 Mon Sep 17 00:00:00 2001 From: Jay Guo Date: Wed, 6 Aug 2025 19:54:27 -0400 Subject: [PATCH 1/2] Replace resource item explore dropdown --- .../package/snippets/resource_item.html | 29 ------------------- .../package/snippets/resource_item.html | 29 ------------------- .../package/snippets/resource_item.html | 29 ------------------- .../package/snippets/resource_item.html | 24 --------------- .../package/snippets/resource_item.html | 25 ++++++++++++++++ 5 files changed, 25 insertions(+), 111 deletions(-) delete mode 100644 ckanext/opendata_theme/extended_themes/cademo/templates/package/snippets/resource_item.html delete mode 100644 ckanext/opendata_theme/extended_themes/chhs/templates/package/snippets/resource_item.html delete mode 100644 ckanext/opendata_theme/extended_themes/cnra/templates/package/snippets/resource_item.html delete mode 100644 ckanext/opendata_theme/extended_themes/virginiaogda/templates/package/snippets/resource_item.html diff --git a/ckanext/opendata_theme/extended_themes/cademo/templates/package/snippets/resource_item.html b/ckanext/opendata_theme/extended_themes/cademo/templates/package/snippets/resource_item.html deleted file mode 100644 index 2df56ecb..00000000 --- a/ckanext/opendata_theme/extended_themes/cademo/templates/package/snippets/resource_item.html +++ /dev/null @@ -1,29 +0,0 @@ -{% ckan_extends %} - -{% block resource_item_explore %} - {% if not url_is_edit %} -
- - - {{ _('Preview') }} - - {% if res.url and res.url_type == 'upload' %} - - - {{ _('Download') }} - - {% else %} - - - {{ _('Go to resource') }} - - {% endif %} - {% if can_edit %} - - - {{ _('Edit') }} - - {% endif %} -
- {% endif %} -{% endblock %} diff --git a/ckanext/opendata_theme/extended_themes/chhs/templates/package/snippets/resource_item.html b/ckanext/opendata_theme/extended_themes/chhs/templates/package/snippets/resource_item.html deleted file mode 100644 index 2df56ecb..00000000 --- a/ckanext/opendata_theme/extended_themes/chhs/templates/package/snippets/resource_item.html +++ /dev/null @@ -1,29 +0,0 @@ -{% ckan_extends %} - -{% block resource_item_explore %} - {% if not url_is_edit %} -
- - - {{ _('Preview') }} - - {% if res.url and res.url_type == 'upload' %} - - - {{ _('Download') }} - - {% else %} - - - {{ _('Go to resource') }} - - {% endif %} - {% if can_edit %} - - - {{ _('Edit') }} - - {% endif %} -
- {% endif %} -{% endblock %} diff --git a/ckanext/opendata_theme/extended_themes/cnra/templates/package/snippets/resource_item.html b/ckanext/opendata_theme/extended_themes/cnra/templates/package/snippets/resource_item.html deleted file mode 100644 index 2df56ecb..00000000 --- a/ckanext/opendata_theme/extended_themes/cnra/templates/package/snippets/resource_item.html +++ /dev/null @@ -1,29 +0,0 @@ -{% ckan_extends %} - -{% block resource_item_explore %} - {% if not url_is_edit %} -
- - - {{ _('Preview') }} - - {% if res.url and res.url_type == 'upload' %} - - - {{ _('Download') }} - - {% else %} - - - {{ _('Go to resource') }} - - {% endif %} - {% if can_edit %} - - - {{ _('Edit') }} - - {% endif %} -
- {% endif %} -{% endblock %} diff --git a/ckanext/opendata_theme/extended_themes/virginiaogda/templates/package/snippets/resource_item.html b/ckanext/opendata_theme/extended_themes/virginiaogda/templates/package/snippets/resource_item.html deleted file mode 100644 index 00280816..00000000 --- a/ckanext/opendata_theme/extended_themes/virginiaogda/templates/package/snippets/resource_item.html +++ /dev/null @@ -1,24 +0,0 @@ -{% ckan_extends %} - -{% block resource_item_explore %} - {% if not url_is_edit %} -
- - - {{ _('Preview') }} - - {% if res.url and h.is_url(res.url) %} - - - {{ _('Download') }} - - {% endif %} - {% if can_edit %} - - - {{ _('Edit') }} - - {% endif %} -
- {% endif %} -{% endblock %} diff --git a/ckanext/opendata_theme/opengov_custom_theme/templates/package/snippets/resource_item.html b/ckanext/opendata_theme/opengov_custom_theme/templates/package/snippets/resource_item.html index 4209eb4e..6fee9a84 100644 --- a/ckanext/opendata_theme/opengov_custom_theme/templates/package/snippets/resource_item.html +++ b/ckanext/opendata_theme/opengov_custom_theme/templates/package/snippets/resource_item.html @@ -6,3 +6,28 @@ {{ h.popular('views', res.tracking_summary.total, min=10) if res.tracking_summary }} {% endblock %} + +{% block resource_item_explore %} + {% if not url_is_edit %} +
+ {% if can_edit %} + + + {{ _('Edit') }} + + {% else %} + {% if res.url and res.url_type == 'upload' %} + + + {{ _('Download') }} + + {% else %} + + + {{ _('Go to resource') }} + + {% endif %} + {% endif %} +
+ {% endif %} +{% endblock %} \ No newline at end of file From 244f832d1806ffaf2575d1f65056cd48730c4c08 Mon Sep 17 00:00:00 2001 From: Jay Guo Date: Mon, 11 Aug 2025 21:07:40 -0400 Subject: [PATCH 2/2] Update CSS to fit resource item buttons --- .../opengov_custom_css/assets/css/theme.css | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ckanext/opendata_theme/opengov_custom_css/assets/css/theme.css b/ckanext/opendata_theme/opengov_custom_css/assets/css/theme.css index e8efb0bd..4e58e443 100644 --- a/ckanext/opendata_theme/opengov_custom_css/assets/css/theme.css +++ b/ckanext/opendata_theme/opengov_custom_css/assets/css/theme.css @@ -368,10 +368,6 @@ form.form-inline.form-select.lang-select { background-color: #852c7b !important; } -#dataset-resources .btn-group .btn { - margin-left: 5px; -} - .module-heading .action { color: #ffffff !important; } @@ -471,6 +467,12 @@ form.form-inline.form-select.lang-select { } } +@media (min-width: 991px) { + .resource-item { + padding-right: 140px; + } +} + .site-footer .og-attribution { display: inline-block; float: right;