Inital commit

This commit is contained in:
2022-02-24 01:07:09 +13:00
commit 8bc3cee328
55 changed files with 2292 additions and 0 deletions

17
views/post/edit.gtpl Normal file
View File

@@ -0,0 +1,17 @@
{{define "content"}}
<form action="/user/new" method="post">
<fieldset>
<legend>New User</legend>
<div>Username</div>
<input type="text" name="username">
<div>Email</div>
<input type="email" name="email">
<div>Password</div>
<input type="password" name="password">
<div>Password Repeat</div>
<input type="password" name="password-repeat"><br>
<input type="submit" value="Submit">
</fieldset>
</form>
{{end}}

11
views/post/new.gtpl Normal file
View File

@@ -0,0 +1,11 @@
{{define "content"}}
<form action="/user/new" method="post">
<fieldset>
<legend>New Post</legend>
<div>Title</div>
<input type="text" name="title">
<input type="text" name="content">
<input type="submit" value="Submit">
</fieldset>
</form>
{{end}}

11
views/post/post.gtpl Normal file
View File

@@ -0,0 +1,11 @@
{{define "content"}}
<h1>{{.Post.Ttile}}</h1>
<h2>Username: {{.User.Username}}</h2>
<h2>Email: {{.User.Email}}</h2>
<h2>Password: {{.User.Password}}</h2>
<form action="/user/{{.User.Username}}/delete" method="post">
<button type="submit">Delete</button>
</form>
<h1>{{getId .User.ID}}</h1>
{{end}}

17
views/post/posts.gtpl Normal file
View File

@@ -0,0 +1,17 @@
{{define "content"}}
<h1>{{.Title}}</h1>
<ul>
{{range $i, $a := .Posts}}
<li>
<a href="/user/{{$a.ID}}">{{$a.ID}}</a>
</li>
{{end}}
</ul>
<form action="/user/new">
<button type="submit">New User</button>
</form>
{{end}}