Skip to content

Commit

Permalink
Merge branch 'master' into TSS-2212_Width_Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ferozerub authored Dec 2, 2024
2 parents fd6500d + 6ce026a commit bbdf672
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions barriers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,25 +289,25 @@ class Statuses:
RELATED_BARRIER_TAGS = {
"duplicate": {
"lower_boundary": 0.9,
"upper_boundary": 1,
"upper_boundary": 2,
"label": "Potential duplicate",
"class": "govuk-tag--green",
},
"similar": {
"lower_boundary": 0.7,
"upper_boundary": 0.8,
"upper_boundary": 0.9,
"label": "Very similar",
"class": "govuk-tag--turquoise",
},
"good": {
"lower_boundary": 0.4,
"upper_boundary": 0.6,
"upper_boundary": 0.7,
"label": "Good match",
"class": "govuk-tag--blue",
},
"some": {
"lower_boundary": 0.2,
"upper_boundary": 0.3,
"upper_boundary": 0.4,
"label": "Some relevance",
"class": "govuk-tag--purple",
},
Expand Down
4 changes: 2 additions & 2 deletions templates/barriers/related_barriers.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ <h3 class="govuk-heading-s">
<div class="govuk-grid-column-one-half">
<dt class="govuk-summary-list__key">Similarity Score:</dt>
<dd class="govuk-summary-list__value">
{{ barrier.similarity|floatformat:3 }}
{% widthratio barrier.similarity 1 100 %}%
{% for key, value in related_barrier_tags.items %}
{% if barrier.similarity <= value.upper_boundary and barrier.similarity >= value.lower_boundary %}
{% if barrier.similarity|floatformat:2 < value.upper_boundary|floatformat:2 and barrier.similarity|floatformat:2 >= value.lower_boundary|floatformat:2 %}
<strong class="govuk-tag {{ value.class }}">{{ value.label }}</strong>
{% endif %}
{% endfor %}
Expand Down

0 comments on commit bbdf672

Please sign in to comment.