Skip to content

Commit 2aa40be

Browse files
author
Tim Davies
committed
Updates following review
1 parent 15604e4 commit 2aa40be

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

prefix_finder/frontend/templates/results.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,30 @@
55
{% for result in results %}
66
<div class="col-xs-12 col-md-6">
77
<div class="panel panel-default">
8-
<div class="panel-heading"><span class="badge pull-right" data-toggle="popover" data-placement="bottom" title="Quality score" data-html="true" data-content="{%for key,value in result.quality_explained.items %}{{ key }} - {{ value }}<br/>{%endfor%}" data-trigger="hover">Quality score: {{ result.quality }}</span>
9-
<h4><a href="{% url 'list' result.code %}" data-toggle="tooltip" data-placement="top" title="More info">{{result.name.en}} ({{result.code}})</a> </h4>
8+
<div class="panel-heading"><span class="badge pull-right" data-toggle="popover" data-placement="bottom" title="Quality score" data-html="true" data-content="{% for key,value in result.quality_explained.items %}{{ key }} - {{ value }}<br/>{% endfor %} data-trigger="hover">Quality score: {{ result.quality }}</span>
9+
<h4><a href="{% url 'list' result.code %}" data-toggle="tooltip" data-placement="top" title="More info">{{ result.name.en }} ({{ result.code }})</a> </h4>
1010

1111
</div>
1212
<div class="panel-body">
1313
<p style="font-size:larger;">
14-
Use the list code <code>{{result.code}}</code> and an identifier found at <a href="{{result.url}}" target="_blank">{{result.url|truncatechars:100}}</a>
14+
Use the list code <code>{{ result.code }}</code> and an identifier found at <a href="{{ result.url }}" target="_blank">{{ result.url|truncatechars:100 }}</a>
1515
</p>
1616
<p>
17-
{{result.description.en|truncatewords_html:50}} <a href="{% url 'list' result.code %}">Read more</a>
17+
{{ result.description.en|truncatewords_html:50 }} <a href="{% url 'list' result.code %}">Read more</a>
1818
</p>
1919
<p>
2020
This is a <strong>{{ result.listType }}</strong> list.
2121
{% if result.listType = "primary" %}
2222
Organisations are generally entered into this list when they are registered
23-
{%if result.structure %} as a {{ result.structure_titles|join_or:True }} {% endif %}
23+
{% if result.structure %} as a {{ result.structure_titles|join_or:True }} {% endif %}
2424
{% if result.subnationalCoverage %}
2525
in {{ result.subnationalCoverage_titles|join_or }}.
2626
{% else %}
2727
in {{ result.coverage_titles|join_or }}.
2828
{% endif %}
2929
{% endif %}
3030
{% if result.listType = "secondary" %}
31-
{% if result.structure %}{{ result.structure_titles|join_or }} organisations{% else %}{% if result.sector %}{{ result.sector_titles|join_or }} organisations{%else%} Organisations{% endif %}{% endif %} may be entered onto this offical list as a result of a transaction with the list owner.
31+
{% if result.structure %}{{ result.structure_titles|join_or }} organisations{% else %}{% if result.sector %}{{ result.sector_titles|join_or }} organisations{% else %} Organisations{% endif %}{% endif %} may be entered onto this offical list as a result of a transaction with the list owner.
3232
{% endif %}
3333
{% if result.listType = "third_party" %}
3434
This list is maintained by a third-party who may or may not have had interactions or transactions with the organiastions listed.
@@ -46,15 +46,15 @@ <h4><a href="{% url 'list' result.code %}" data-toggle="tooltip" data-placement=
4646
{% if result.sector %}<p>
4747
It includes organisations working in the following sectors: {{ result.sector_titles|join_or }}
4848
</p>{% endif %}
49-
<a class="pull-right" href="{% url 'list' result.code %}"><button class="btn">More info</button></a>
49+
<a class="pull-right" href="{% url 'list' result.code %}"><button class="btn" style="margin-top:25px;">More info</button></a>
5050
<hr/>
5151
<p>
5252
<strong>Example identifiers</strong>: {{ result.access.exampleIdentifiers }}
5353
</p>
5454
{% if local %}
5555
<strong>Debug info</strong>
5656
{{ result.relevance }} | {{ result.relevance_debug }}
57-
{%endif%}
57+
{% endif %}
5858
</div>
5959
</div>
6060
</div>

prefix_finder/frontend/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"MATCH_DROPDOWN": 10,
1717
"MATCH_DROPDOWN_ONLY_VALUE": 10,
1818
"MATCH_EMPTY": 2,
19-
"RECOMENDED_RELEVANCE_THRESHOLD": 5,
19+
"RECOMMENDED_RELEVANCE_THRESHOLD": 5,
2020
"SUGGESTED_RELEVANCE_THRESHOLD": 35,
2121
"SUGGESTED_QUALITY_THRESHOLD": 45
2222
}
@@ -323,7 +323,7 @@ def filter_and_score_results(query):
323323
and value['quality'] > RELEVANCE["SUGGESTED_QUALITY_THRESHOLD"]
324324
and not all_results['suggested'] or (all_results['suggested'] and value['relevance'] == all_results['suggested'][0]['relevance'])):
325325
all_results['suggested'].append(value)
326-
elif value['relevance'] >= RELEVANCE["RECOMENDED_RELEVANCE_THRESHOLD"]:
326+
elif value['relevance'] >= RELEVANCE["RECOMMENDED_RELEVANCE_THRESHOLD"]:
327327
all_results['recommended'].append(value)
328328
else:
329329
all_results['other'].append(value)

0 commit comments

Comments
 (0)