diff options
Diffstat (limited to 'youtube/templates/common_elements.html')
-rw-r--r-- | youtube/templates/common_elements.html | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/youtube/templates/common_elements.html b/youtube/templates/common_elements.html index 7914c08..8ee0a3c 100644 --- a/youtube/templates/common_elements.html +++ b/youtube/templates/common_elements.html @@ -90,3 +90,18 @@ {% endfor %} {% endmacro %} + +{% macro next_previous_buttons(is_last_page, url, parameters_dictionary) %} + {% set current_page = parameters_dictionary.get('page', 1)|int %} + {% set parameters_dictionary = parameters_dictionary.to_dict() %} + + {% if current_page != 1 %} + {% set _ = parameters_dictionary.__setitem__('page', current_page - 1) %} + <a class="page-button previous-page" href="{{ url + '?' + parameters_dictionary|urlencode }}">Previous page</a> + {% endif %} + + {% if not is_last_page %} + {% set _ = parameters_dictionary.__setitem__('page', current_page + 1) %} + <a class="page-button next-page" href="{{ url + '?' + parameters_dictionary|urlencode }}">Next page</a> + {% endif %} +{% endmacro %} |