blob: 89267a219868a35bbe7a837dca0129fe9734f05e [file] [log] [blame]
Matthias Andreas Benkard5326f5e2023-08-06 21:34:08 +02001{@java.util.List<eu.mulk.mulkcms2.benki.posts.Post$Day<eu.mulk.mulkcms2.benki.posts.Post<?>>> postDays}
Matthias Andreas Benkardf435e662022-06-05 16:27:10 +02002{@java.lang.String feedUri}
3{@java.lang.String pageTitle}
4{@boolean showBookmarkForm}
5{@boolean showLazychatForm}
6{@boolean showCommentBox}
7{@boolean hasPreviousPage}
8{@boolean hasNextPage}
9{@java.lang.Integer previousCursor}
10{@java.lang.Integer nextCursor}
11{@java.lang.Integer pageSize}
12{@java.lang.String searchQuery}
13
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010014{#include base.html}
15
16{#title}Benki {pageTitle}{/title}
17{#siteSection}{pageTitle}{/siteSection}
18
Matthias Andreas Benkard188327d2020-04-17 21:22:57 +020019{#nav}{#navbar siteSection=pageTitle /}
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010020
21{#head}
22 <link href="{feedUri}" rel="alternate" type="application/atom+xml" />
23
Matthias Andreas Benkardad76d622020-04-27 08:08:17 +020024 {#if showBookmarkForm || showLazychatForm}
Matthias Andreas Benkard813e5972020-06-14 19:27:42 +020025 <script type="module" src="/lib.js"></script>
Matthias Andreas Benkardad76d622020-04-27 08:08:17 +020026 {/if}
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010027{/head}
28
29{#body}
30
31{#if showBookmarkForm}
32 <elix-expandable-section id="bookmark-submission-pane">
33 <h2 slot="header" class="small-title expandable-section-title"><button class="pure-button">Create New Bookmark</button></h2>
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020034 <div id="bookmark-submission">
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010035 <mlk-bookmark-submission-form id="bookmark-submission-form"></mlk-bookmark-submission-form>
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020036 </div>
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010037 </elix-expandable-section>
38{/if}
39
Matthias Andreas Benkard12c7cac2020-03-26 07:19:45 +010040{#if showLazychatForm}
41 <elix-expandable-section id="lazychat-submission-pane">
42 <h2 slot="header" class="small-title expandable-section-title"><button class="pure-button">Post Message</button></h2>
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020043 <div id="lazychat-submission">
Matthias Andreas Benkard12c7cac2020-03-26 07:19:45 +010044 <mlk-lazychat-submission-form id="lazychat-submission-form"></mlk-lazychat-submission-form>
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020045 </div>
Matthias Andreas Benkard12c7cac2020-03-26 07:19:45 +010046 </elix-expandable-section>
47{/if}
48
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010049<div class="paging">
Matthias Andreas Benkard8563a3c2020-09-16 17:57:24 +020050 <form id="post-search-bar" method="get" class="pure-form">
51 <input placeholder="Search..." value="{searchQuery}" aria-label="Search" id="post-search-query" name="search-query" type="search"/>
52 <input type="submit" aria-label="Submit search query" class="pure-button pure-button-primary" value="&#x1f50e;"/>
53 </form>
54 {#if hasPreviousPage}<a href="?i={previousCursor}&n={pageSize}&search-query={searchQuery}" class="pure-button">⇠ previous page</a>{/if}
55 {#if hasNextPage}<a href="?i={nextCursor}&n={pageSize}&search-query={searchQuery}" class="pure-button">next page ⇢</a>{/if}
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +010056</div>
57
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020058<div id="main-content">
Matthias Andreas Benkard1c2a8a72020-04-26 06:09:57 +020059 {#for day in postDays}
60 <div class="post-day">
Matthias Andreas Benkard369e6982020-04-26 13:14:21 +020061 <div class="post-day-info">
62 <time datetime="{day.date.htmlDate}">{day.date.humanDate}</time>
63 </div>
64
Matthias Andreas Benkard1c2a8a72020-04-26 06:09:57 +020065 {#for post in day.posts}
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020066 {#if post.isBookmark}
67 <article class="bookmark {#if post.descriptionHtml != ""}post-with-nonempty-body{/if}">
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020068 <div class="bookmark-editor post-editor">
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020069 {#if showBookmarkForm}
70 <elix-expandable-panel class="bookmark-editor-pane editor-pane">
71 <mlk-bookmark-submission-form edited-id="{post.id}"></mlk-bookmark-submission-form>
72 </elix-expandable-panel>
73 {/if}
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020074 </div>
Matthias Andreas Benkardbbac0c72020-04-19 19:38:49 +020075
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020076 <header>
77 <div class="bookmark-info">
78 <span class="bookmark-owner post-owner">{post.owner.firstName}</span>
79 <a class="post-link" href="/posts/{post.id}">
80 <span class="post-self-link">#</span>
81 </a>
Matthias Andreas Benkard8dcc6ae2022-06-04 16:02:25 +020082 {#if post.comments.size() > 0}
83 <a class="comment-box-link" href="/posts/{post.id}#comment-box-{post.id}">
84 <span class="comment-box-self-link">({post.comments.size()})</span>
85 </a>
86 {/if}
Matthias Andreas Benkardbbac0c72020-04-19 19:38:49 +020087
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020088 <a href="{post.uri}" class="bookmark-title">
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +020089 <h2 class="bookmark-title"><span class="bookmark-symbol">🔖 </span> {post.title}</h2>.
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020090 </a>
Matthias Andreas Benkard369e6982020-04-26 13:14:21 +020091 </div>
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020092 </header>
Matthias Andreas Benkard369e6982020-04-26 13:14:21 +020093
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +020094 <div class="bookmark-controls">
95 {#if showBookmarkForm}
96 <button class="pure-button bookmark-edit-button">Edit</button>
97 {/if}
98 </div>
Matthias Andreas Benkard533e6d42020-12-16 13:26:38 +010099
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200100 <div class="bookmark-description post-content">
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200101 {post.descriptionHtml.raw}
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200102 </div>
Matthias Andreas Benkarddb23ab62020-04-13 20:01:13 +0200103
Matthias Andreas Benkard14e59442022-05-24 22:19:29 +0200104 {#if showCommentBox}
Matthias Andreas Benkard0351a8f2022-05-26 08:05:00 +0200105 {#commentBox postId=post.id comments=post.comments /}
Matthias Andreas Benkard14e59442022-05-24 22:19:29 +0200106 {/if}
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200107 </article>
108 {#else}
109 <article class="lazychat-message">
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200110 <div class="lazychat-editor post-editor">
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200111 {#if showLazychatForm}
112 <elix-expandable-panel class="lazychat-editor-pane editor-pane">
113 <mlk-lazychat-submission-form edited-id="{post.id}"></mlk-lazychat-submission-form>
114 </elix-expandable-panel>
115 {/if}
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200116 </div>
Matthias Andreas Benkard369e6982020-04-26 13:14:21 +0200117
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200118 <header>
119 <div class="lazychat-message-info">
120 <span class="lazychat-message-owner post-owner">{post.owner.firstName}</span>
121 <a class="post-link" href="/posts/{post.id}">
122 <span class="post-self-link">#</span>
123 </a>
Matthias Andreas Benkard8dcc6ae2022-06-04 16:02:25 +0200124 {#if post.comments.size() > 0}
125 <a class="comment-box-link" href="/posts/{post.id}#comment-box-{post.id}">
126 <span class="comment-box-self-link">({post.comments.size()})</span>
127 </a>
128 {/if}
Matthias Andreas Benkard369e6982020-04-26 13:14:21 +0200129 </div>
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200130 </header>
Matthias Andreas Benkard369e6982020-04-26 13:14:21 +0200131
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200132 <div class="lazychat-message-controls">
133 {#if showLazychatForm}
134 <button class="pure-button lazychat-edit-button">Edit</button>
135 {/if}
136 </div>
137
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200138 <div class="lazychat-message-content post-content">
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200139 {post.descriptionHtml.raw}
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200140 </div>
Matthias Andreas Benkard14e59442022-05-24 22:19:29 +0200141
142 {#if showCommentBox}
Matthias Andreas Benkard0351a8f2022-05-26 08:05:00 +0200143 {#commentBox postId=post.id comments=post.comments /}
Matthias Andreas Benkard14e59442022-05-24 22:19:29 +0200144 {/if}
Matthias Andreas Benkard49b01512021-07-05 06:45:54 +0200145 </article>
146 {/if}
Matthias Andreas Benkard1c2a8a72020-04-26 06:09:57 +0200147 {/for}
148 </div>
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +0100149 {/for}
Matthias Andreas Benkarddcad91c2022-05-24 07:14:08 +0200150</div>
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +0100151
152<div class="paging">
Matthias Andreas Benkard8563a3c2020-09-16 17:57:24 +0200153 {#if hasPreviousPage}<a href="?i={previousCursor}&n={pageSize}&search-query={searchQuery}" class="pure-button">⇠ previous page</a>{/if}
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +0100154 <span class="filler"></span>
Matthias Andreas Benkard8563a3c2020-09-16 17:57:24 +0200155 {#if hasNextPage}<a href="?i={nextCursor}&n={pageSize}&search-query={searchQuery}" class="pure-button">next page ⇢</a>{/if}
Matthias Andreas Benkard371164a2020-03-23 06:21:25 +0100156</div>
157
158{/body}
159
160{/include}