From 1c819ffb0b1d5389be44aab96edf771aef0812d5 Mon Sep 17 00:00:00 2001 From: tworrall Date: Mon, 12 May 2014 16:00:38 -0400 Subject: [PATCH] fixed usability issue on accounts list page --- webapp/web/js/account/accountUtils.js | 14 ++++++++++++++ .../partials/account/userAccounts-accountsNav.ftl | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/webapp/web/js/account/accountUtils.js b/webapp/web/js/account/accountUtils.js index 26b0f75aa..b3429d401 100644 --- a/webapp/web/js/account/accountUtils.js +++ b/webapp/web/js/account/accountUtils.js @@ -7,6 +7,20 @@ function changeAction(form, url) { } $(document).ready(function(){ + + // If filtering by role, make sure the role is included as a parameter (1) when the + // page count changes or (2) when the next or previous links are clicked. + if ( $('#roleFilterUri').val().length > 0 ) { + var roleURI = $('#roleFilterUri').val().substring($('#roleFilterUri').val().indexOf("=")+1); + roleURI = roleURI.replace("%3A%2F%2F","://").replace("%23","#").replace(/%2F/g,"/") + $('input#roleTypeContainer').val(roleURI); + var prevHref = $('a#previousPage').attr('href'); + var nextHref = $('a#nextPage').attr('href'); + prevHref += "&roleFilterUri=" + roleURI.replace("#","%23"); + nextHref += "&roleFilterUri=" + roleURI.replace("#","%23"); + $('a#previousPage').attr('href',prevHref); + $('a#nextPage').attr('href',nextHref); + } //Accounts per page //Hide if javascript is enabled diff --git a/webapp/web/templates/freemarker/body/partials/account/userAccounts-accountsNav.ftl b/webapp/web/templates/freemarker/body/partials/account/userAccounts-accountsNav.ftl index 9af9a7ec5..f3216584b 100644 --- a/webapp/web/templates/freemarker/body/partials/account/userAccounts-accountsNav.ftl +++ b/webapp/web/templates/freemarker/body/partials/account/userAccounts-accountsNav.ftl @@ -33,13 +33,13 @@ ${i18n().accounts_per_page} | - + <#if page.previous?has_content> - ${i18n().previous} + ${i18n().previous} ${page.current} of ${page.last} <#if page.next?has_content> - ${i18n().next_capitalized} + ${i18n().next_capitalized}