From 92866539051759ae003c42a01ac83c3d8f4d2dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steind=C3=B3r?= Date: Sat, 27 May 2017 07:16:43 +0000 Subject: [PATCH] Nav fixes (#766) * Update README.md Added a link to the db dump and IRC channels. * Minor fix * Update README.md * disabling email links * Killed github autolinking * Update README.md * Removed database link * fixed a FF only bug with the carets * added a static size to pagination * worked on the pagination widget * fixed the arrow buttons too * fixed appearance on pages over 1000 --- public/css/main.css | 4 ++-- router/template_functions.go | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/public/css/main.css b/public/css/main.css index 4db4e27f..d647749b 100644 --- a/public/css/main.css +++ b/public/css/main.css @@ -271,11 +271,11 @@ th { border-bottom-width: 2px; } .pagination li { border: 1px solid; display: inline-block; - padding: 0.4rem 0.5rem; + padding: 0.4rem; border-right-width: 0; list-style-type: none; text-align: center; - width: 35px; + min-width: 35px; } .pagination li:first-child { border-radius: 3px 0 0 3px; } diff --git a/router/template_functions.go b/router/template_functions.go index 509bca81..5a2e6a65 100644 --- a/router/template_functions.go +++ b/router/template_functions.go @@ -110,7 +110,7 @@ var FuncMap = template.FuncMap{ if nav.CurrentPage-1 > 0 { url, _ := Router.Get(nav.Route).URL("page", "1") - ret = ret + "
  • «
  • " + ret = ret + "
  • «
  • " } startValue := 1 if nav.CurrentPage > pagesSelectable/2 { @@ -126,16 +126,15 @@ var FuncMap = template.FuncMap{ for i := startValue; i <= endValue; i++ { pageNum := strconv.Itoa(i) url, _ := Router.Get(nav.Route).URL("page", pageNum) - ret = ret + "" + "" + strconv.Itoa(i) + "" + ret = ret + ">" + strconv.Itoa(i) + "" } if nav.CurrentPage < int(maxPages) { url, _ := Router.Get(nav.Route).URL("page", strconv.Itoa(nav.CurrentPage+1)) - ret = ret + "
  • »
  • " + ret = ret + "
  • »
  • " } itemsThisPageStart := nav.MaxItemPerPage*(nav.CurrentPage-1) + 1 itemsThisPageEnd := nav.MaxItemPerPage * nav.CurrentPage