Improve display of pagination on small viewports

https://www.openproject.org/work_packages/15375