added the '(...)' sign to result lists

This commit is contained in:
mb@mb 2018-08-31 13:10:55 +02:00
parent 9c69fa4118
commit 8fe9eb912f
4 changed files with 18 additions and 0 deletions

View File

@ -53,6 +53,15 @@ h1, h2, h3{
.result{ .result{
margin:10px 0 0 0; margin:10px 0 0 0;
} }
#more{
margin:10px 0;
}
#more-descr{
margin:10px 0;
}
#more sup{
color:#800000;
}
.sentence{ .sentence{
margin:10px 0 0 0; margin:10px 0 0 0;
} }

View File

@ -23,6 +23,8 @@
<li>{{txt}}</li> <li>{{txt}}</li>
{% endfor %} {% endfor %}
<ul> <ul>
{% block txtlist %}
{% endblock %}
</div> </div>
{% block results %} {% block results %}
{% endblock %} {% endblock %}

View File

@ -1,5 +1,10 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block title %}{{query}}{% endblock %} {% block title %}{{query}}{% endblock %}
{% block txtlist %}
<div id="more-descr">[*] The algorithm is asked to not return more than 3 sentences from the same manifesto. There are more sentences that match this search query!</div>
{% endblock %}
{% block results %} {% block results %}
<h1>The results for the query "{{query}}" are:</h1> <h1>The results for the query "{{query}}" are:</h1>
<div id="results"> <div id="results">

View File

@ -137,6 +137,8 @@ def request_results(query):
if done is not 'yes': if done is not 'yes':
sentence = s.replace(query, '<strong style="font-size:{}px;">{}</strong>'.format(value, query)) sentence = s.replace(query, '<strong style="font-size:{}px;">{}</strong>'.format(value, query))
html = Markup(sentence) html = Markup(sentence)
if count == 3:
html = html + Markup('<div id="more">(...)<sup>*</sup></div>')
result_sentences.append(html) result_sentences.append(html)
done = 'yes' done = 'yes'
results[x]['sentences'] = result_sentences results[x]['sentences'] = result_sentences