Skip to content

Commit

Permalink
Merge pull request #6442 from OCHA-DAP/dev
Browse files Browse the repository at this point in the history
dev into prod
  • Loading branch information
danmihaila authored Oct 2, 2024
2 parents 3952635 + eefd501 commit 76824a2
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def _search(self, additional_fq='', additional_facets=None,
self.template_data.sort_by_fields = [field.split()[0]
for field in sort_by.split(',')]

self._set_other_links()
self.template_data.other_links = {'current_page_url': self._current_url()}

search_extras = {}
try:
Expand Down Expand Up @@ -414,29 +414,6 @@ def _set_search_url_params(self):
params_nopage = self._params_nopage()
self.template_data['search_url_params'] = urlencode(_encode_params(params_nopage))

def _set_other_links(self, suffix='', other_params_dict=None):
url_param_list = ['sort', 'q', 'organization', 'tags',
'vocab_Topics', 'license_id', 'groups', 'res_format', '_show_filters']
# named_route = self._get_named_route()
params = {}

for k, v in request.args.items():
if k in url_param_list:
if k in params:
params[k].append(v)
else:
params[k] = [v]

if other_params_dict:
params.update(other_params_dict)

self.template_data.other_links = {}
self.template_data.other_links['params_noq'] = {k: v for k, v in params.items()
if k not in ['q', '_show_filters', 'id']}
self.template_data.other_links['params_nosort_noq'] = {k: v for k, v in params.items()
if k not in ['sort', 'q', 'id']}
self.template_data.other_links['current_page_url'] = self._current_url()

def _current_url(self):
url = h.url_for('hdx_light_dataset.search')
return url
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.bem-partners__image {
max-width: 100px;
max-width: 95px;
}
.bem-partners__indicators {
bottom: -2rem;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.bem-partners {

&__image {
max-width: 100px;
max-width: 95px;
}

&__indicators {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'HERO_SECTION_DESCRIPTION': '''HDX HAPI is in beta phase, and we are seeking feedback. To share your thoughts or join our slack channel, send an email to <a href="{0}" title="Contact us">[email protected]</a>.''',

'DATA_COVERAGE_SECTION_TITLE': '''Data Coverage''',
'DATA_COVERAGE_SECTION_DESCRIPTION': '''Our initial coverage aligns with the data included in the <a href="{0}" target="_blank" data-module="hdx_click_stopper" data-module-link_type="hapi data coverage description" title="HDX Data Grids">HDX Data Grids</a>, which places the most important crisis data into six categories and 20 sub-categories. Our beta version of HDX HAPI covers 44 indicators across 25 locations that have a <a href="{1}" target="_blank" title="Humanitarian Response Plan" data-module="hdx_click_stopper" data-module-link_type="hapi data coverage description">Humanitarian Response Plan</a>. This data has been shared by nine different contributing organisations.''',
'DATA_COVERAGE_SECTION_DESCRIPTION': '''Our initial coverage aligns with the data included in the <a href="{0}" target="_blank" data-module="hdx_click_stopper" data-module-link_type="hapi data coverage description" title="HDX Data Grids">HDX Data Grids</a>, which places the most important crisis data into six categories and 20 sub-categories. Our beta version of HDX HAPI covers 62 indicators across 25 locations that have a <a href="{1}" target="_blank" title="Humanitarian Response Plan" data-module="hdx_click_stopper" data-module-link_type="hapi data coverage description">Humanitarian Response Plan</a>. This data has been shared by nine different contributing organisations.''',
'DATA_COVERAGE_SECTION_PARAGRAPH': '''Refer to the <a href="{0}" target="_blank" data-module="hdx_click_stopper" data-module-link_type="hapi data coverage description" title="HAPI - The Humanitarian API">documentation</a> for the latest coverage. <a href="{1}" data-module="hdx_click_stopper" data-module-link_type="hapi data coverage description" title="Contact us">Contact us</a> to request additional indicators in future versions of HDX HAPI.''',

'BE_INSPIRED_SECTION_TITLE': '''Be Inspired''',
Expand Down Expand Up @@ -41,12 +41,24 @@
"contributor": "OCHA offices",
"link": "https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/affected_people/#humanitarian-needs"
},
{
"category": "Affected People",
"subcategory": "Internally-Displaced Persons",
"contributor": "International Organization for Migration (IOM)",
"link": "https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/affected_people/#internally-displaced-persons"
},
{
"category": "Affected People",
"subcategory": "Refugees and Persons of Concern",
"contributor": "UN Refugee Agency (UNHCR)",
"link": "https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/affected_people/#refugees-persons-of-concern"
},
{
"category": "Affected People",
"subcategory": "Returnees",
"contributor": "UN Refugee Agency (UNHCR)",
"link": "https://hdx-hapi.readthedocs.io/en/latest/data_usage_guides/affected_people/#returnees"
},
{
"category": "Coordination & Context",
"subcategory": "Conflict Events",
Expand Down Expand Up @@ -103,3 +115,16 @@
{'name': 'FAQ', 'url': '#faq'},
{'name': 'Read the documentation', 'url': 'https://hdx-hapi.readthedocs.io/'},
]

PARTNERS_CONSTANTS = [
('acled', 'ACLED'),
('inform', 'INFORM'),
('fts', 'FTS'),
('unfpa', 'UNFPA'),
('ophi', 'OPHI'),
('fsnwg', 'FSNWG'),
('unchr', 'UNHCR'),
('ocha', 'OCHA'),
('wfp', 'WFP'),
('iom', 'IOM'),
]
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,11 @@
{'name': 'Resources', 'url': '#resources'},
{'name': 'FAQ', 'url': '#faq'},
]

PARTNERS_CONSTANTS = [
('european_comission', 'European Commission'),
('acled', 'ACLED'),
('ipc', 'IPC'),
('idmc', 'IDMC'),
('wfp', 'WFP'),
]
2 changes: 1 addition & 1 deletion ckanext-hdx_theme/ckanext/hdx_theme/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
hdx_version = 'v1.83.4'
hdx_version = 'v1.83.5'
27 changes: 6 additions & 21 deletions ckanext-hdx_theme/ckanext/hdx_theme/views/landing_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
import ckanext.hdx_theme.helpers.faq_wordpress as fw
from ckanext.hdx_theme.views.faqs import read as faq_read
from ckanext.hdx_theme.helpers.ui_constants.landing_pages.hapi import \
DATA_COVERAGE_CONSTANTS as HAPI_DATA_COVERAGE_CONSTANTS, SECTIONS_CONSTANTS as HAPI_SECTIONS_CONSTANTS
DATA_COVERAGE_CONSTANTS as HAPI_DATA_COVERAGE_CONSTANTS, SECTIONS_CONSTANTS as HAPI_SECTIONS_CONSTANTS, \
PARTNERS_CONSTANTS as HAPI_PARTNERS_CONSTANTS
from ckanext.hdx_theme.helpers.ui_constants.landing_pages.signals import \
DATA_COVERAGE_CONSTANTS as SIGNALS_DATA_COVERAGE_CONSTANTS, SECTIONS_CONSTANTS as SIGNALS_SECTIONS_CONSTANTS
DATA_COVERAGE_CONSTANTS as SIGNALS_DATA_COVERAGE_CONSTANTS, SECTIONS_CONSTANTS as SIGNALS_SECTIONS_CONSTANTS, \
PARTNERS_CONSTANTS as SIGNALS_PARTNERS_CONSTANTS

abort = tk.abort
g = tk.g
Expand All @@ -24,17 +26,7 @@ def hapi():
wp_category_terms = config.get('hdx.wordpress.category.hapi')
data = fw.faq_for_category(wp_category_terms)

partners = [
('acled', 'ACLED'),
('inform', 'INFORM'),
('fts', 'FTS'),
('unfpa', 'UNFPA'),
('ophi', 'OPHI'),
('fsnwg', 'FSNWG'),
('unchr', 'UNHCR'),
('ocha', 'OCHA'),
('wfp', 'WFP')
]
partners = HAPI_PARTNERS_CONSTANTS
sections = HAPI_SECTIONS_CONSTANTS
data_coverage = HAPI_DATA_COVERAGE_CONSTANTS

Expand All @@ -56,14 +48,7 @@ def signals():
wp_category_terms = config.get('hdx.wordpress.category.signals')
data = fw.faq_for_category(wp_category_terms)

partners = [
('european_comission', 'European Commission'),
('acled', 'ACLED'),
('ipc', 'IPC'),
('idmc', 'IDMC'),
('wfp', 'WFP')
]

partners = SIGNALS_PARTNERS_CONSTANTS
sections = SIGNALS_SECTIONS_CONSTANTS
data_coverage = SIGNALS_DATA_COVERAGE_CONSTANTS

Expand Down

0 comments on commit 76824a2

Please sign in to comment.