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/templates/benki/lazychat | |
parent | 3d399f3e0b150064b778a64ebfd495da2640bb4f (diff) |
Lazychat: Add paging.
Change-Id: I1db0b0733397d5e7a77b925ba185a39a72041f3e
Diffstat (limited to 'src/main/resources/templates/benki/lazychat')
-rw-r--r-- | src/main/resources/templates/benki/lazychat/lazychatList.html | 54 |
1 files changed, 37 insertions, 17 deletions
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} |