Skip to content

Commit

Permalink
[SUPDESQ-21] added facet to cat and org (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
awset authored Aug 6, 2021
1 parent 4ca74b2 commit 0b96849
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ckanext/qdes_schema/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,12 @@ def dataset_facets(self, facets_dict, package_type):

return ordered_facets

def group_facets(self, facets_dict, group_type, package_type):
return self.dataset_facets(facets_dict, 'dataset')

def organization_facets(self, facets_dict, organization_type, package_type):
return self.dataset_facets(facets_dict, 'dataset')

# IAuthFunctions
def get_auth_functions(self):
return {
Expand Down
21 changes: 21 additions & 0 deletions ckanext/qdes_schema/templates/group/read.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% ckan_extends %}

{% block secondary_content %}
{% snippet "group/snippets/info.html", group=group_dict, show_nums=true %}

{% set default_extent = h.get_qld_bounding_box_config() %}
{% snippet "snippets/spatial_query.html", default_extent=default_extent, extras={'id':group_dict.id} %}

<div class="filters">
<div>
{% for facet in facet_titles %}
{% if facet == 'temporal_start' or facet == 'temporal_end' %}
{{ h.snippet('snippets/facet_list_temporal.html', title=facet_titles[facet], name=facet, search_facets=search_facets, extras={'id':group_dict.id}) }}
{% elif not facet in ['collection_package_id', 'temporal_coverage_from', 'temporal_coverage_to'] %}
{{ h.snippet('snippets/facet_list.html', title=facet_titles[facet], name=facet, extras={'id':group_dict.id}) }}
{% endif %}
{% endfor %}
</div>
<a class="close no-text hide-filters"><i class="fa fa-times-circle"></i><span class="text">close</span></a>
</div>
{% endblock %}
19 changes: 19 additions & 0 deletions ckanext/qdes_schema/templates/organization/read.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% ckan_extends %}

{% block organization_facets %}
{% set default_extent = h.get_qld_bounding_box_config() %}
{% snippet "snippets/spatial_query.html", default_extent=default_extent, extras={'id':group_dict.id} %}

<div class="filters">
<div>
{% for facet in facet_titles %}
{% if facet == 'temporal_start' or facet == 'temporal_end' %}
{{ h.snippet('snippets/facet_list_temporal.html', title=facet_titles[facet], name=facet, search_facets=search_facets, extras={'id':group_dict.id}) }}
{% elif not facet in ['collection_package_id', 'temporal_coverage_from', 'temporal_coverage_to'] %}
{{ h.snippet('snippets/facet_list.html', title=facet_titles[facet], name=facet, extras={'id':group_dict.id}) }}
{% endif %}
{% endfor %}
</div>
<a class="close no-text hide-filters"><i class="fa fa-times-circle"></i><span class="text">close</span></a>
</div>
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2 class="module-heading">
{{ _('Temporal coverage') }}
</h2>

<form method="get" class="temporal-coverage form-inline" action="{{ h.add_url_param() }}">
<form method="get" class="temporal-coverage form-inline" action="{{ h.add_url_param(extras=extras) }}">


<div class="form-group">
Expand Down
2 changes: 1 addition & 1 deletion ckanext/qdes_schema/templates/snippets/spatial_query.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<h2 class="module-heading">
<i class="icon-medium icon-globe"></i>
{{ _('Location') }}
<a id="dataset-map-clear" href="{{ h.remove_url_param(['ext_bbox','ext_prev_extent', 'ext_location']) }}" class="action">{{ _('Clear map') }}</a>
<a id="dataset-map-clear" href="{{ h.remove_url_param(['ext_bbox','ext_prev_extent', 'ext_location'], extras=extras) }}" class="action">{{ _('Clear map') }}</a>
</h2>
<ul class="unstyled nav nav-simple nav-facet nav-dataset-map" id="dataset-map-nav">
<li class="nav-item">
Expand Down

0 comments on commit 0b96849

Please sign in to comment.