Mercurial > wikked
changeset 345:6a40510578f6
Fix pagination and revisions links on site history page.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 17 Sep 2015 23:01:48 -0700 |
parents | 43b18814420d |
children | 59bbf4358a76 |
files | wikked/templates/special-changes.html wikked/views/history.py |
diffstat | 2 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/wikked/templates/special-changes.html Wed Sep 16 23:51:59 2015 -0700 +++ b/wikked/templates/special-changes.html Thu Sep 17 23:01:48 2015 -0700 @@ -36,7 +36,7 @@ <ul class="pure-ul-unstyled"> {%for p in e.pages%} <li> - <a href="/revision{{p.url}}/{{e.rev_id}}">{{p.url}}</a> + <a href="{{get_rev_url(p.url, e.rev_id)}}">{{p.url}}</a> {{p.action_label}} </li> {%endfor%} @@ -54,10 +54,12 @@ </tbody> </table> <div class="wiki-history-pagination pure-g"> - <div class="pure-u-1-2"> + <div class="pure-u-1-3"> <a href="{{first_page}}">First page</a> </div> - <div class="pure-u-1-2"> + <div class="pure-u-1-3"> + </div> + <div class="pure-u-1-3"> <a href="{{next_page}}">Next page</a> </div> </div>
--- a/wikked/views/history.py Wed Sep 16 23:51:59 2015 -0700 +++ b/wikked/views/history.py Thu Sep 17 23:01:48 2015 -0700 @@ -15,6 +15,9 @@ user = current_user.get_id() after_rev = request.args.get('rev') data = get_site_history(wiki, user, after_rev=after_rev) + last_rev = data['history'][-1]['rev_id'] + data['first_page'] = '/special/history' + data['next_page'] = '/special/history?rev=%s' % last_rev add_auth_data(data) add_navigation_data( '', data,