Rewrite
This commit is contained in:
+5
-4
@@ -1,4 +1,4 @@
|
||||
include "pages/page.wl"
|
||||
include "page.wl"
|
||||
|
||||
let posts = $query("SELECT P.id, P.title, P.is_link, P.content, (SELECT COUNT(*) FROM Comments as C WHERE c.parent_post=P.id) as num_comments, CURRENT_TIMESTAMP as date FROM Posts as P")
|
||||
|
||||
@@ -42,8 +42,9 @@ let style =
|
||||
let main =
|
||||
<main>
|
||||
|
||||
\if len(posts) == 0:
|
||||
\if len(posts) == 0: {
|
||||
<div id="no-posts">There are no posts yet!</div>
|
||||
}
|
||||
|
||||
\for post in posts: {
|
||||
|
||||
@@ -55,10 +56,10 @@ let main =
|
||||
|
||||
<div class="item">
|
||||
<div>
|
||||
<a href=\'"'\link\'"'>\escape(post.title)</a>
|
||||
<a href="\{link}">\{escape post.title}</a>
|
||||
</div>
|
||||
<div>
|
||||
<span>\escape(post.date)</span> | <span>\escape(post.num_comments) comments</span>
|
||||
<span>\{escape post.date}</span> | <span>\{escape post.num_comments} comments</span>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user