Skip to content

Commit

Permalink
Merge pull request #4800 from ebmdatalab/evansd/measure-tag-links
Browse files Browse the repository at this point in the history
Fix measure tag links
  • Loading branch information
evansd authored May 22, 2024
2 parents fecf273 + 3c0e11c commit b9f2afe
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions openprescribing/frontend/views/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,10 @@ def measure_for_one_entity(request, measure, entity_code, entity_type):
),
"rollUpBy": "measure_id",
"tagsFocusUrlTemplate": _url_template("measures_for_one_" + entity_type),
"allMeasuresForOrgUrl": reverse(
"measures_for_one_" + entity_type,
kwargs={entity_type + "_code": entity_code},
),
}

_add_measure_for_children_in_entity_url(measure_options, entity_type)
Expand Down Expand Up @@ -589,6 +593,7 @@ def measure_for_all_england(request, measure):
),
"rollUpBy": "measure_id",
"tagsFocusUrlTemplate": reverse("all_england"),
"allMeasuresForOrgUrl": reverse("all_england"),
}

_add_measure_details(measure_options, measure)
Expand Down
1 change: 1 addition & 0 deletions openprescribing/media/js/src/measure_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ var utils = {
measureForAllPracticesUrl: measureForAllPracticesUrl,
measureForAllCCGsUrl: measureForAllCCGsUrl,
measureForSiblingsUrl: measureForSiblingsUrl,
allMeasuresForOrgUrl: options.allMeasuresForOrgUrl || "",
improvementRadarUrl: improvementRadarUrl,
chartExplanation: chartExplanation,
tags: d.tags,
Expand Down
2 changes: 1 addition & 1 deletion openprescribing/templates/_measures_panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
<div class="descriptive">
<strong>Tagged as:</strong>
{{# each tagsForDisplay as |tag index|}}
<a href="?tags={{ tag.id }}">{{ tag.name }}</a>{{#unless @last }}, {{/unless}}
<a href="{{ ../allMeasuresForOrgUrl }}?tags={{ tag.id }}">{{ tag.name }}</a>{{#unless @last }}, {{/unless}}
{{/each}}
{{# unless tagsForDisplay }}<em>No tags yet</em>{{/unless}}
</div>
Expand Down

0 comments on commit b9f2afe

Please sign in to comment.