Make a big amalgamation of HTTP, WL, sqlite alongside cweb
This commit is contained in:
+1
-1
@@ -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")
|
||||
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
include "pages/page.wl"
|
||||
include "pages/login_and_signup_style.wl"
|
||||
include "page.wl"
|
||||
include "login_and_signup_style.wl"
|
||||
|
||||
let main =
|
||||
<main>
|
||||
@@ -7,7 +7,7 @@ let main =
|
||||
|
||||
<div id="response"></div>
|
||||
|
||||
<form hx-post="/api/login" hx-target="#response">
|
||||
<form action="/api/login" method="POST">
|
||||
<input type="text" name="username" placeholder="username" />
|
||||
<input type="password" name="password" placeholder="password" />
|
||||
<input type="submit" value="Log-In" />
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include "pages/page.wl"
|
||||
include "page.wl"
|
||||
|
||||
let style =
|
||||
<style>
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
include "pages/page.wl"
|
||||
include "page.wl"
|
||||
|
||||
let posts = $query("SELECT U.username, P.title, P.content FROM Posts as P, Users as U WHERE P.id=? AND U.id=P.author", $post_id)
|
||||
let comments = $query("SELECT C.id, U.username, C.content, C.parent_post, C.parent_comment FROM Comments as C, Users as U WHERE C.parent_post=? AND U.id=C.author", $post_id)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
include "pages/page.wl"
|
||||
include "page.wl"
|
||||
|
||||
let posts = $query("SELECT title, content FROM Posts WHERE id=?", $post_id)
|
||||
let comments = $query("SELECT C.id, U.username, C.content, C.parent_post, C.parent_comment FROM Comments as C, Users as U WHERE C.parent_post=? AND U.id == C.author", $post_id)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
include "pages/page.wl"
|
||||
include "pages/login_and_signup_style.wl"
|
||||
include "page.wl"
|
||||
include "login_and_signup_style.wl"
|
||||
|
||||
let main =
|
||||
<main>
|
||||
@@ -7,7 +7,7 @@ let main =
|
||||
|
||||
<div id="response"></div>
|
||||
|
||||
<form hx-post="/api/signup" hx-target="#response">
|
||||
<form action="/api/signup" method="POST">
|
||||
<input type="text" name="username" placeholder="username" />
|
||||
<input type="email" name="email" placeholder="email" />
|
||||
<input type="password" name="password1" placeholder="password" />
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
include "pages/page.wl"
|
||||
include "page.wl"
|
||||
|
||||
let style =
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user