Skip to content

Commit

Permalink
Add pagination rel-links to all searches, Alfanous-team#406
Browse files Browse the repository at this point in the history
 Apply escape charaters filter on it
  • Loading branch information
sneetsher committed May 22, 2018
1 parent 9c8d98a commit 9b0fb4e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/alfanous-django/templates/aya_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
{% block pagination_phone %} {% endblock %}
{% endkwacro %}

{% block pagination_rel_block %}
{% include 'wui/pagination_rel.html' with page=results.search.interval.page nb_pages=results.search.interval.nb_pages %}
{% endblock %}

{% block results %}
<div id="#search_result_static" class="row span9 offset2 text-center ">

Expand Down
6 changes: 6 additions & 0 deletions src/alfanous-django/templates/aya_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
{% load custom_filters %}
{% load query %}

{% block pagination_rel_block %}
{% if results.search.interval.nb_pages > 1 %}
{% include 'wui/pagination_rel.html' with page=results.search.interval.page nb_pages=results.search.interval.nb_pages %}
{% endif %}
{% endblock %}

{% block options %}
<!-- Multiple Checkboxes -->
<div class="control-group">
Expand Down
6 changes: 6 additions & 0 deletions src/alfanous-django/templates/translation_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
{% load custom_filters %}
{% load query %}

{% block pagination_rel_block %}
{% if results.search.interval.nb_pages > 1 %}
{% include 'wui/pagination_rel.html' with page=results.search.interval.page nb_pages=results.search.interval.nb_pages %}
{% endif %}
{% endblock %}

{% block no_request %}
<div style="direction: {{ bidi.direction }};">
{{ _("List of indexed Quran translations") }} ({{ _("Translation source:") }} <a href='http://tanzil.net/trans/' target='_blank' >{{ _("Tanzil") }}</a>):<button id="showlog" type="button">{{ _("Show/Hide!") }}</button><br>
Expand Down
6 changes: 5 additions & 1 deletion src/alfanous-django/templates/word_search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
{% load custom_filters %}
{% load query %}


{% block pagination_rel_block %}
{% if results.search.interval.nb_pages > 1 %}
{% include 'wui/pagination_rel.html' with page=results.search.interval.page nb_pages=results.search.interval.nb_pages %}
{% endif %}
{% endblock %}

{% block options %}
{% endblock %}
Expand Down
4 changes: 2 additions & 2 deletions src/alfanous-django/wui/templates/wui/pagination_rel.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

{% if page != 1 %}
{% with page|add:"-1" as prev_page %}
<link rel="prev" href="?{% custom_query params.query prev_page False %}" />
<link rel="prev" href="{% filter force_escape %}?{% custom_query params.query prev_page False %}{% endfilter %}" />
{% endwith %}
{% endif %}

{% if page != nb_pages %}
{% with page|add:"+1" as next_page %}
<link rel="next" href="?{% custom_query params.query next_page False %}" />
<link rel="next" href="{% filter force_escape %}?{% custom_query params.query next_page False %}{% endfilter %}" />
{% endwith %}
{% endif %}

0 comments on commit 9b0fb4e

Please sign in to comment.