From 99a8a41ceabf85ba38a9beced8c3bae78ade9c58 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 25 Feb 2020 18:19:43 +0000 Subject: [PATCH] Show navigation icons --- blog.py | 34 ++++++++++++++++++++++++++-------- epicyon-blog.css | 14 ++++++++++++++ 2 files changed, 40 insertions(+), 8 deletions(-) diff --git a/blog.py b/blog.py index 904b14b4..0d9865f5 100644 --- a/blog.py +++ b/blog.py @@ -93,7 +93,9 @@ def htmlBlogPostContent(baseDir: str,httpPrefix: str,translate: {}, \ blogStr+='
'+attachmentStr+'
' if postJsonObject['object'].get('content'): - contentStr=addEmbeddedElements(translate,postJsonObject['object']['content']) + contentStr= \ + addEmbeddedElements(translate, \ + postJsonObject['object']['content']) if postJsonObject['object'].get('tag'): contentStr= \ replaceEmojiFromTags(contentStr, \ @@ -153,13 +155,6 @@ def htmlBlogPage(session, \ if not os.path.isfile(blogsIndex): return blogStr+htmlFooter() - if pageNumber: - if pageNumber>1: - # show previous button - print('TODO previous') - # show next button - print('TODO next') - timelineJson= \ createBlogsTimeline(session,baseDir, \ nickname,domain,port,httpPrefix, \ @@ -173,6 +168,26 @@ def htmlBlogPage(session, \ if port!=80 and port!=443: domainFull=domain+':'+str(port) + if pageNumber: + iconsDir=getIconsDir(baseDir) + navigateStr='

' + if pageNumber>1: + # show previous button + navigateStr+= \ + ''+ \ + '<\n' + if len(timelineJson['orderedItems'])>=noOfItems: + # show next button + navigateStr+= \ + ''+ \ + '>\n' + navigateStr='

' + blogStr+=navigateStr + for item in timelineJson['orderedItems']: if item['type']!='Create': continue @@ -182,6 +197,9 @@ def htmlBlogPage(session, \ nickname,domain,domainFull,item, \ None,True) + if len(timelineJson['orderedItems'])>=noOfItems: + blogStr+=navigateStr + return blogStr+htmlFooter() return None diff --git a/epicyon-blog.css b/epicyon-blog.css index 22c06aad..3516c652 100644 --- a/epicyon-blog.css +++ b/epicyon-blog.css @@ -91,3 +91,17 @@ img { img:hover { box-shadow: 0 0 2px 1px var(--gallery-hover); } + +.buttonprev { + float: left; + width: 10%; + -ms-transform: translateY(30%); + transform: translateY(30%); +} + +.buttonnext { + float: right; + width: 10%; + -ms-transform: translateY(30%) scaleX(-1); + transform: translateY(30%) scaleX(-1); +}