summaryrefslogtreecommitdiff
path: root/src/main/resources/templates
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-07-05 06:45:54 +0200
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-07-05 07:46:10 +0200
commit49b01519bbfcd4219ce77ff9ef7497d4ab1458e0 (patch)
tree0be6ff32ffab41e5a20503b0aa68ec72fd943644 /src/main/resources/templates
parent2f931dece84c0f3f974cbf0d8863046b9268277d (diff)
KB66 Use type-safe templates everywhere.
Change-Id: I879e76e5bbaf91349f6df4637d9dc15291a3ada1
Diffstat (limited to 'src/main/resources/templates')
-rw-r--r--src/main/resources/templates/benki/bookmarks/newBookmark.html5
-rw-r--r--src/main/resources/templates/benki/posts/postList.html138
-rw-r--r--src/main/resources/templates/benki/wiki/wikiPage.html4
-rw-r--r--src/main/resources/templates/benki/wiki/wikiPageRevisionList.html21
4 files changed, 74 insertions, 94 deletions
diff --git a/src/main/resources/templates/benki/bookmarks/newBookmark.html b/src/main/resources/templates/benki/bookmarks/newBookmark.html
index d6a868c..bc469f5 100644
--- a/src/main/resources/templates/benki/bookmarks/newBookmark.html
+++ b/src/main/resources/templates/benki/bookmarks/newBookmark.html
@@ -1,5 +1,6 @@
-{@java.util.List<eu.mulk.mulkcms2.benki.bookmarks.Bookmark> bookmarks}
-{@java.lang.Boolean authenticated}
+{@java.lang.String uri}
+{@java.lang.String title}
+{@java.lang.String description}
{#include base.html}
diff --git a/src/main/resources/templates/benki/posts/postList.html b/src/main/resources/templates/benki/posts/postList.html
index 7039d65..7198af1 100644
--- a/src/main/resources/templates/benki/posts/postList.html
+++ b/src/main/resources/templates/benki/posts/postList.html
@@ -1,13 +1,3 @@
-{@java.util.List<eu.mulk.mulkcms2.benki.posts.Post.PostPage<eu.mulk.mulkcms2.benki.posts.Post>.Day> postDays}
-{@java.lang.String pageTitle}
-{@java.lang.Boolean showBookmarkForm}
-{@java.lang.Boolean hasPreviousPage}
-{@java.lang.Boolean hasNextPage}
-{@java.lang.Integer previousCursor}
-{@java.lang.Integer nextCursor}
-{@java.lang.Integer pageSize}
-{@java.lang.String searchQuery}
-
{#include base.html}
{#title}Benki {pageTitle}{/title}
@@ -60,73 +50,71 @@
</div>
{#for post in day.posts}
- {#with post}
- {#if post.isBookmark}
- <article class="bookmark {#if descriptionHtml != ""}post-with-nonempty-body{/if}">
- <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>
-
- <header>
- <div class="bookmark-info">
- <span class="bookmark-owner post-owner">{owner.firstName}</span>
- <a class="post-link" href="/posts/{post.id}">
- <span class="post-self-link">#</span>
- </a>
-
- <a href="{uri}" class="bookmark-title">
- <h1 class="bookmark-title"><span class="bookmark-symbol">🔖 </span> {title}</h1>.
- </a>
- </div>
- </header>
-
- <div class="bookmark-controls">
- {#if showBookmarkForm}
- <button class="pure-button bookmark-edit-button">Edit</button>
- {/if}
+ {#if post.isBookmark}
+ <article class="bookmark {#if post.descriptionHtml != ""}post-with-nonempty-body{/if}">
+ <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>
+
+ <header>
+ <div class="bookmark-info">
+ <span class="bookmark-owner post-owner">{post.owner.firstName}</span>
+ <a class="post-link" href="/posts/{post.id}">
+ <span class="post-self-link">#</span>
+ </a>
+
+ <a href="{post.uri}" class="bookmark-title">
+ <h1 class="bookmark-title"><span class="bookmark-symbol">🔖 </span> {post.title}</h1>.
+ </a>
</div>
-
- <section class="bookmark-description post-content">
- {descriptionHtml.raw}
- </section>
-
- <section class="comment-box"></section>
- </article>
- {#else}
- <article class="lazychat-message">
- <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>
-
- <header>
- <div class="lazychat-message-info">
- <span class="lazychat-message-owner post-owner">{owner.firstName}</span>
- <a class="post-link" href="/posts/{post.id}">
- <span class="post-self-link">#</span>
- </a>
- </div>
- </header>
-
- <div class="lazychat-message-controls">
- {#if showLazychatForm}
- <button class="pure-button lazychat-edit-button">Edit</button>
- {/if}
+ </header>
+
+ <div class="bookmark-controls">
+ {#if showBookmarkForm}
+ <button class="pure-button bookmark-edit-button">Edit</button>
+ {/if}
+ </div>
+
+ <section class="bookmark-description post-content">
+ {post.descriptionHtml.raw}
+ </section>
+
+ <section class="comment-box"></section>
+ </article>
+ {#else}
+ <article class="lazychat-message">
+ <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>
+
+ <header>
+ <div class="lazychat-message-info">
+ <span class="lazychat-message-owner post-owner">{post.owner.firstName}</span>
+ <a class="post-link" href="/posts/{post.id}">
+ <span class="post-self-link">#</span>
+ </a>
</div>
-
- <section class="lazychat-message-content post-content">
- {contentHtml.raw}
- </section>
- </article>
- {/if}
- {/with}
+ </header>
+
+ <div class="lazychat-message-controls">
+ {#if showLazychatForm}
+ <button class="pure-button lazychat-edit-button">Edit</button>
+ {/if}
+ </div>
+
+ <section class="lazychat-message-content post-content">
+ {post.descriptionHtml.raw}
+ </section>
+ </article>
+ {/if}
{/for}
</div>
{/for}
diff --git a/src/main/resources/templates/benki/wiki/wikiPage.html b/src/main/resources/templates/benki/wiki/wikiPage.html
index 048c9b3..63d9950 100644
--- a/src/main/resources/templates/benki/wiki/wikiPage.html
+++ b/src/main/resources/templates/benki/wiki/wikiPage.html
@@ -1,5 +1,3 @@
-{@eu.mulk.mulkcms2.benki.wiki.WikiPageRevision page}
-
{#include base.html}
{#title}{page.title} &#8212; Benki Wiki{/title}
@@ -84,7 +82,7 @@
<section id="wiki-page-content">
<div data-editable data-name="wiki-content" id="wiki-content">
- {#with page}{enrichedContent.raw}{/}
+ {page.enrichedContent.raw}
</div>
</section>
diff --git a/src/main/resources/templates/benki/wiki/wikiPageRevisionList.html b/src/main/resources/templates/benki/wiki/wikiPageRevisionList.html
index eacad4b..ca84fcb 100644
--- a/src/main/resources/templates/benki/wiki/wikiPageRevisionList.html
+++ b/src/main/resources/templates/benki/wiki/wikiPageRevisionList.html
@@ -1,6 +1,3 @@
-{@eu.mulk.mulkcms2.benki.wiki.WikiPage page}
-{@java.lang.String title}
-
{#include base.html}
{#title}Revisions &#8212; {title} &#8212; Benki Wiki{/title}
@@ -25,17 +22,13 @@
</thead>
<tbody>
- {#with page}
- {#for revision in revisions}
- <tr>
- {#with revision}
- <td>{date.humanDateTime}</td>
- <td>{title}</td>
- <td>{author.firstName}</td>
- {/with}
- </tr>
- {/for}
- {/with}
+ {#for revision in page.revisions}
+ <tr>
+ <td>{revision.date.humanDateTime}</td>
+ <td>{revision.title}</td>
+ <td>{revision.author.firstName}</td>
+ </tr>
+ {/for}
</tbody>
</table>
</main>