From 631dc03f38716a43ccda25427992e297f7549684 Mon Sep 17 00:00:00 2001 From: Chase Sterling Date: Sat, 9 Jul 2016 19:09:15 -0400 Subject: [PATCH] Add a + to indicate all revisions are not loaded in history view --- realms/modules/wiki/views.py | 3 ++- realms/templates/wiki/history.html | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/realms/modules/wiki/views.py b/realms/modules/wiki/views.py index 99705c5..6b00643 100644 --- a/realms/modules/wiki/views.py +++ b/realms/modules/wiki/views.py @@ -88,7 +88,8 @@ def history_data(name): 'draw': draw, 'recordsTotal': total_records, 'recordsFiltered': total_records, - 'data': items + 'data': items, + 'fully_loaded': hist_complete } diff --git a/realms/templates/wiki/history.html b/realms/templates/wiki/history.html index 1332843..97a9ed5 100644 --- a/realms/templates/wiki/history.html +++ b/realms/templates/wiki/history.html @@ -45,7 +45,13 @@ $('.dataTable').dataTable({ serverSide: true, - ajax: '{{ url_for('.history_data', name=name) }}', + ajax: { + url: '{{ url_for('.history_data', name=name) }}', + dataSrc: function (data) { + $('.dataTable').data('fully_loaded', data.fully_loaded); + return data.data + } + }, ordering: false, bFilter: false, columns: [ @@ -64,6 +70,12 @@ if ( $.inArray(data.DT_RowId, selected) !== -1 ) { $(row).addClass('active'); } + }, + infoCallback: function( settings, start, end, max, total, pre ) { + if (!$('.dataTable').data('fully_loaded')) { + total += "+" + } + return "Showing " + start +" to "+ end + " of " + total + " revisions."; } });