From 22c5effd6f646e16e68fb171acdb010b8008547d Mon Sep 17 00:00:00 2001 From: Jari Voutilainen Date: Tue, 7 Feb 2023 11:00:53 +0200 Subject: [PATCH 1/2] Fix updating reports and breadcrumbs --- ckanext/report/blueprint.py | 5 +++-- ckanext/report/templates/report/view.html | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ckanext/report/blueprint.py b/ckanext/report/blueprint.py index 4960028..96f937f 100644 --- a/ckanext/report/blueprint.py +++ b/ckanext/report/blueprint.py @@ -159,13 +159,14 @@ def view(report_name, organization=None, refresh=False): 'report_date': report_date, 'options': options, 'options_html': options_html, 'report_template': report['template'], - 'are_some_results': are_some_results}) + 'are_some_results': are_some_results, + 'organization': organization }) report.add_url_rule(u'/report', view_func=index) report.add_url_rule(u'/reports', 'reports', view_func=redirect_to_index) report.add_url_rule(u'/report/', view_func=view, methods=['GET', 'POST']) -report.add_url_rule(u'/report//', 'org', view_func=view) +report.add_url_rule(u'/report//', 'org', view_func=view, methods=['GET', 'POST']) def get_blueprints(): diff --git a/ckanext/report/templates/report/view.html b/ckanext/report/templates/report/view.html index e527ed8..a8cea41 100644 --- a/ckanext/report/templates/report/view.html +++ b/ckanext/report/templates/report/view.html @@ -5,6 +5,9 @@ {% block breadcrumb_content %}
  • {{ h.nav_link(_('Reports'), named_route='report.index') }}
  • {{ h.nav_link(report.title, named_route='report.view', report_name=report_name) }}
  • + {% if organization %} +
  • {{ h.nav_link(organization, named_route='report.org', report_name=report_name, organization=organization) }}
  • + {% endif %} {% endblock%} {% block primary_content_inner %} From d5f66e1d907b2475ef4aaaca82d15a97b92d117b Mon Sep 17 00:00:00 2001 From: Jari Voutilainen Date: Tue, 7 Feb 2023 11:03:15 +0200 Subject: [PATCH 2/2] lint --- ckanext/report/blueprint.py | 2 +- ckanext/report/controllers.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ckanext/report/blueprint.py b/ckanext/report/blueprint.py index 96f937f..2a476b1 100644 --- a/ckanext/report/blueprint.py +++ b/ckanext/report/blueprint.py @@ -160,7 +160,7 @@ def view(report_name, organization=None, refresh=False): 'options_html': options_html, 'report_template': report['template'], 'are_some_results': are_some_results, - 'organization': organization }) + 'organization': organization}) report.add_url_rule(u'/report', view_func=index) diff --git a/ckanext/report/controllers.py b/ckanext/report/controllers.py index 46e4190..c319d7b 100644 --- a/ckanext/report/controllers.py +++ b/ckanext/report/controllers.py @@ -133,4 +133,5 @@ def view(self, report_name, organization=None, refresh=False): 'report_date': report_date, 'options': options, 'options_html': options_html, 'report_template': report['template'], - 'are_some_results': are_some_results}) + 'are_some_results': are_some_results, + 'organization': organization})