diff options
author | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-03-22 09:23:07 +0100 |
---|---|---|
committer | Matthias Andreas Benkard <code@mail.matthias.benkard.de> | 2020-03-22 09:23:07 +0100 |
commit | 573f806676a7ebc2a62aa39d742127fbf74fbb3c (patch) | |
tree | 1c7fc50b116c9a1d2fe6302a1cbe64e8a1d91b94 /src/main/resources | |
parent | 3d399f3e0b150064b778a64ebfd495da2640bb4f (diff) |
Lazychat: Add paging.
Change-Id: I1db0b0733397d5e7a77b925ba185a39a72041f3e
Diffstat (limited to 'src/main/resources')
3 files changed, 41 insertions, 20 deletions
diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index b90cc9e..4d03175 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -9,6 +9,7 @@ quarkus.log.level = INFO mulkcms.tag-base = hub.benkard.de mulkcms.bookmarks.default-max-results = 25 +mulkcms.lazychat.default-max-results = 25 quarkus.datasource.driver = org.postgresql.Driver quarkus.datasource.max-size = 8 diff --git a/src/main/resources/templates/benki/bookmarks/bookmarkList.html b/src/main/resources/templates/benki/bookmarks/bookmarkList.html index 290cb26..8c87a55 100644 --- a/src/main/resources/templates/benki/bookmarks/bookmarkList.html +++ b/src/main/resources/templates/benki/bookmarks/bookmarkList.html @@ -1,4 +1,4 @@ -{@java.util.List<eu.mulk.mulkcms2.benki.bookmarks.Bookmark> bookmarks} +{@java.util.List<eu.mulk.mulkcms2.benki.bookmarks.Bookmark> posts} {@java.lang.Boolean authenticated} {@java.lang.Boolean hasPreviousPage} {@java.lang.Boolean hasNextPage} @@ -38,8 +38,8 @@ </div> <section id="main-content"> - {#for bookmark in bookmarks} - {#with bookmark} + {#for post in posts} + {#with post} <article class="bookmark"> <header> <a href="{uri}"><h1 class="bookmark-title">{title}</h1></a> diff --git a/src/main/resources/templates/benki/lazychat/lazychatList.html b/src/main/resources/templates/benki/lazychat/lazychatList.html index ecac7a7..b644662 100644 --- a/src/main/resources/templates/benki/lazychat/lazychatList.html +++ b/src/main/resources/templates/benki/lazychat/lazychatList.html @@ -1,4 +1,10 @@ -{@java.util.List<eu.mulk.mulkcms2.benki.lazychat.LazychatMessage> lazychatMessages} +{@java.util.List<eu.mulk.mulkcms2.benki.lazychat.LazychatMessage> posts} +{@java.lang.Boolean authenticated} +{@java.lang.Boolean hasPreviousPage} +{@java.lang.Boolean hasNextPage} +{@java.lang.Integer previousCursor} +{@java.lang.Integer nextCursor} +{@java.lang.Integer pageSize} {#include base.html} @@ -10,22 +16,36 @@ {#body} -{#for lazychatMessage in lazychatMessages} - {#with lazychatMessage} - <article class="lazychat-message"> - <header> - <div class="lazychat-message-info"> - <time datetime="{date.htmlDateTime}">{date.humanDateTime}</time> - <span class="lazychat-message-owner">{owner.firstName} {owner.lastName}</span> - </div> - </header> - - <section class="lazychat-message-content"> - {contentHtml.raw} - </section> - </article> - {/with} -{/for} +<div class="paging"> + {#if hasPreviousPage}<a href="?i={previousCursor}&n={pageSize}" class="pure-button">⇠ previous page</a>{/if} + <span class="filler"></span> + {#if hasNextPage}<a href="?i={nextCursor}&n={pageSize}" class="pure-button">next page ⇢</a>{/if} +</div> + +<section id="main-content"> + {#for post in posts} + {#with post} + <article class="lazychat-message"> + <header> + <div class="lazychat-message-info"> + <time datetime="{date.htmlDateTime}">{date.humanDateTime}</time> + <span class="lazychat-message-owner">{owner.firstName} {owner.lastName}</span> + </div> + </header> + + <section class="lazychat-message-content"> + {contentHtml.raw} + </section> + </article> + {/with} + {/for} +</section> + +<div class="paging"> + {#if hasPreviousPage}<a href="?i={previousCursor}&n={pageSize}" class="pure-button">⇠ previous page</a>{/if} + <span class="filler"></span> + {#if hasNextPage}<a href="?i={nextCursor}&n={pageSize}" class="pure-button">next page ⇢</a>{/if} +</div> {/body} |