Skip to content

Commit

Permalink
Merge pull request ckan#33 from ckan/fix_refresh_reports
Browse files Browse the repository at this point in the history
Fix updating reports and breadcrumbs
  • Loading branch information
Zharktas authored Feb 7, 2023
2 parents ea3e1c1 + d5f66e1 commit 3588577
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ckanext/report/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<report_name>', view_func=view, methods=['GET', 'POST'])
report.add_url_rule(u'/report/<report_name>/<organization>', 'org', view_func=view)
report.add_url_rule(u'/report/<report_name>/<organization>', 'org', view_func=view, methods=['GET', 'POST'])


def get_blueprints():
Expand Down
3 changes: 2 additions & 1 deletion ckanext/report/controllers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
3 changes: 3 additions & 0 deletions ckanext/report/templates/report/view.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
{% block breadcrumb_content %}
<li>{{ h.nav_link(_('Reports'), named_route='report.index') }}</li>
<li>{{ h.nav_link(report.title, named_route='report.view', report_name=report_name) }}</li>
{% if organization %}
<li>{{ h.nav_link(organization, named_route='report.org', report_name=report_name, organization=organization) }}</li>
{% endif %}
{% endblock%}

{% block primary_content_inner %}
Expand Down

0 comments on commit 3588577

Please sign in to comment.