diff options
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/common.html | 14 | ||||
-rw-r--r-- | apioforum/templates/view_forum.html | 2 | ||||
-rw-r--r-- | apioforum/templates/view_thread.html | 2 | ||||
-rw-r--r-- | apioforum/templates/view_user.html | 4 |
4 files changed, 16 insertions, 6 deletions
diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 638c423..46402df 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -141,14 +141,24 @@ {% macro pagination_nav(page,max_pageno,view) %} <nav aria-label="pagination" id="pages"> + <div class="links"> {% if page > 1 %} <a href="{{url_for(view,**kwargs)}}" aria-label="first page"><< first</a> <a href="{{url_for(view,page=page-1,**kwargs)}}" aria-label="previous page">< prev</a> + {% else %} + <a aria-label="first page"><< first</a> + <a aria-label="previous page">< prev</a> {% endif %} - page {{page}} of {{max_pageno}} - {% if page < max_pageno %} {# > #} + </div> + <div class="pageno"><span id="the-word-page">page </span>{{page}} of {{max_pageno}}</div> + <div class="links"> + {% if page < max_pageno %} <a href="{{url_for(view,page=page+1,**kwargs)}}" aria-label="next page">next ></a> <a href="{{url_for(view,page=max_pageno,**kwargs)}}" aria-label="last page">last >></a> + {% else %} + <a aria-label="next page">next ></a> + <a aria-label="last page">last >></a> {% endif %} + </div> </nav> {% endmacro %} diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 75144c8..649c87c 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -84,6 +84,7 @@ you do not have permission to create threads in this forum {% endif %} {% if has_permission(forum.id, g.user, "p_view_threads", login_required=False) %} +{{ pagination_nav(page,max_pageno,'forum.view_forum',forum_id=forum.id) }} <div class="thread-list"> {%for thread in threads%} <div class="listing"> @@ -133,7 +134,6 @@ you do not have permission to create threads in this forum </div> {%endfor%} </div> -{{ pagination_nav(page,max_pageno,'forum.view_forum',forum_id=forum.id) }} {% else %} diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html index fe22cfc..6e881cb 100644 --- a/apioforum/templates/view_thread.html +++ b/apioforum/templates/view_thread.html @@ -32,6 +32,7 @@ </span> </div> +{{ pagination_nav(page,max_pageno,'thread.view_thread',thread_id=thread.id) }} <div class="posts"> {% for post in posts %} {% if votes[post.id] %} @@ -69,7 +70,6 @@ {% endif %} {% endfor %} </div> -{{ pagination_nav(page,max_pageno,'thread.view_thread',thread_id=thread.id) }} {% if g.user and has_permission(thread.forum, g.user, "p_reply_threads") %} <form class="new-post" action="{{url_for('thread.create_post',thread_id=thread.id)}}" method="POST"> <textarea class="new-post-box" placeholder="your post here..." name="content"></textarea> diff --git a/apioforum/templates/view_user.html b/apioforum/templates/view_user.html index 44a0b9d..f52e7c1 100644 --- a/apioforum/templates/view_user.html +++ b/apioforum/templates/view_user.html @@ -26,11 +26,11 @@ </div> {% if posts %} <h2>recent posts</h2> +{{ pagination_nav(page,max_pageno,'user.view_user', username=user.username) }} <div class="user_posts"> {% for post in posts %} {{ disp_post(post, False) }} {% endfor %} </div> -{{ pagination_nav(page,max_pageno,'user.view_user', username=user.username) }} {% endif %} -{% endblock %}
\ No newline at end of file +{% endblock %} |