diff options
| author | roerick <roerick@wyo.town> | 2025-10-17 15:32:19 -0600 |
|---|---|---|
| committer | roerick <roerick@wyo.town> | 2025-10-17 15:32:19 -0600 |
| commit | ce61d3db96e0539c8df1886ac635e7e85dbde31f (patch) | |
| tree | 8af7c0eda03b91273ebffbde5799e4436b04cac6 /templates | |
initial commit, models not working
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/blog.html | 24 | ||||
| -rw-r--r-- | templates/create_blog.html | 17 |
2 files changed, 41 insertions, 0 deletions
diff --git a/templates/blog.html b/templates/blog.html new file mode 100644 index 0000000..0fc0035 --- /dev/null +++ b/templates/blog.html @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html> +<head> + <title>{{.Title}}</title> +</head> +<body> + <h1>{{.Title}}</h1> + <p>{{.Content}}</p> + <hr> + <h2>Edit Blog</h2> + <form method="POST" action="/blogs/{{.ID}}"> + <input type="hidden" name="_method" value="PUT"> + <label>Title:</label><br> + <input type="text" name="title" value="{{.Title}}"><br> + <label>Content:</label><br> + <textarea name="content">{{.Content}}</textarea><br> + <input type="submit" value="Update"> + </form> + <form method="POST" action="/blogs/{{.ID}}"> + <input type="hidden" name="_method" value="DELETE"> + <input type="submit" value="Delete"> + </form> +</body> +</html> diff --git a/templates/create_blog.html b/templates/create_blog.html new file mode 100644 index 0000000..6912216 --- /dev/null +++ b/templates/create_blog.html @@ -0,0 +1,17 @@ +<!DOCTYPE html> +<html> +<head> + <title>Create Blog</title> +</head> +<body> + <h1>Create Blog</h1> + <form method="POST" action="/blogs"> + <label>Title:</label><br> + <input type="text" name="title"><br> + <label>Content:</label><br> + <textarea name="content"></textarea><br> + <input type="submit" value="Create"> + </form> +</body> +</html> + |
