summaryrefslogtreecommitdiff
path: root/src/main/resources/templates
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2020-04-26 06:09:57 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2020-04-26 06:12:43 +0200
commit1c2a8a70eed63a6b59dde22bdcb1d029e8485089 (patch)
treec3df25d8f9ff64daaeb27b19530eb13fc9e0b6b3 /src/main/resources/templates
parent95d29a00d3f37d64f5256cea4e7308f5a975c86c (diff)
KB54 Put posts in date buckets for templating.
Change-Id: Ic17b2dede722f5962a55b9c4d3b4663a71480e9c
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r--src/main/resources/templates/benki/posts/postList.html138
1 files changed, 71 insertions, 67 deletions
diff --git a/src/main/resources/templates/benki/posts/postList.html b/src/main/resources/templates/benki/posts/postList.html
index bc479f4..2911be4 100644
--- a/src/main/resources/templates/benki/posts/postList.html
+++ b/src/main/resources/templates/benki/posts/postList.html
@@ -1,4 +1,4 @@
-{@java.util.List<eu.mulk.mulkcms2.benki.posts.Post> posts}
+{@java.util.List<eu.mulk.mulkcms2.benki.posts.Day> postDays}
{@java.lang.String pageTitle}
{@java.lang.Boolean showBookmarkForm}
{@java.lang.Boolean hasPreviousPage}
@@ -52,72 +52,76 @@
</div>
<section id="main-content">
- {#for post in posts}
- {#with post}
- {#if post.isBookmark}
- <article class="bookmark">
- <header>
- <div class="bookmark-info">
- <a class="post-link" href="/posts/{post.id}">
- <time datetime="{date.htmlDateTime}">{date.humanDateTime}</time>
- <span class="bookmark-owner">{owner.firstName} {owner.lastName}</span>
- </a>
- </div>
-
- <div class="bookmark-controls">
- {#if showBookmarkForm}
- <button class="pure-button bookmark-edit-button">Edit</button>
- {/if}
- </div>
- </header>
-
- <section class="bookmark-editor post-editor">
- {#if showBookmarkForm}
- <elix-expandable-panel class="bookmark-editor-pane editor-pane">
- <mlk-bookmark-submission-form edited-id="{post.id}"></mlk-bookmark-submission-form>
- </elix-expandable-panel>
- {/if}
- </section>
-
- <section class="bookmark-title-section">
- <a href="{uri}" class="bookmark-title"><h1 class="bookmark-title">⇢&nbsp;{title}</h1></a>
- </section>
-
- <section class="bookmark-description">
- {descriptionHtml.raw}
- </section>
- </article>
- {#else}
- <article class="lazychat-message">
- <header>
- <div class="lazychat-message-info">
- <a class="post-link" href="/posts/{post.id}">
- <time datetime="{date.htmlDateTime}">{date.humanDateTime}</time>
- <span class="lazychat-message-owner">{owner.firstName} {owner.lastName}</span>
- </a>
- </div>
-
- <div class="lazychat-message-controls">
- {#if showLazychatForm}
- <button class="pure-button lazychat-edit-button">Edit</button>
- {/if}
- </div>
- </header>
-
- <section class="lazychat-editor post-editor">
- {#if showLazychatForm}
- <elix-expandable-panel class="lazychat-editor-pane editor-pane">
- <mlk-lazychat-submission-form edited-id="{post.id}"></mlk-lazychat-submission-form>
- </elix-expandable-panel>
- {/if}
- </section>
-
- <section class="lazychat-message-content">
- {contentHtml.raw}
- </section>
- </article>
- {/if}
- {/with}
+ {#for day in postDays}
+ <div class="post-day">
+ {#for post in day.posts}
+ {#with post}
+ {#if post.isBookmark}
+ <article class="bookmark">
+ <header>
+ <div class="bookmark-info">
+ <a class="post-link" href="/posts/{post.id}">
+ <time datetime="{date.htmlDateTime}">{date.humanDateTime}</time>
+ <span class="bookmark-owner">{owner.firstName} {owner.lastName}</span>
+ </a>
+ </div>
+
+ <div class="bookmark-controls">
+ {#if showBookmarkForm}
+ <button class="pure-button bookmark-edit-button">Edit</button>
+ {/if}
+ </div>
+ </header>
+
+ <section class="bookmark-editor post-editor">
+ {#if showBookmarkForm}
+ <elix-expandable-panel class="bookmark-editor-pane editor-pane">
+ <mlk-bookmark-submission-form edited-id="{post.id}"></mlk-bookmark-submission-form>
+ </elix-expandable-panel>
+ {/if}
+ </section>
+
+ <section class="bookmark-title-section">
+ <a href="{uri}" class="bookmark-title"><h1 class="bookmark-title">⇢&nbsp;{title}</h1></a>
+ </section>
+
+ <section class="bookmark-description">
+ {descriptionHtml.raw}
+ </section>
+ </article>
+ {#else}
+ <article class="lazychat-message">
+ <header>
+ <div class="lazychat-message-info">
+ <a class="post-link" href="/posts/{post.id}">
+ <time datetime="{date.htmlDateTime}">{date.humanDateTime}</time>
+ <span class="lazychat-message-owner">{owner.firstName} {owner.lastName}</span>
+ </a>
+ </div>
+
+ <div class="lazychat-message-controls">
+ {#if showLazychatForm}
+ <button class="pure-button lazychat-edit-button">Edit</button>
+ {/if}
+ </div>
+ </header>
+
+ <section class="lazychat-editor post-editor">
+ {#if showLazychatForm}
+ <elix-expandable-panel class="lazychat-editor-pane editor-pane">
+ <mlk-lazychat-submission-form edited-id="{post.id}"></mlk-lazychat-submission-form>
+ </elix-expandable-panel>
+ {/if}
+ </section>
+
+ <section class="lazychat-message-content">
+ {contentHtml.raw}
+ </section>
+ </article>
+ {/if}
+ {/with}
+ {/for}
+ </div>
{/for}
</section>