summaryrefslogtreecommitdiff
path: root/src/templates/admin/blog_edit.html
diff options
context:
space:
mode:
authorEmma Terzioglu <emreterzioglu49@gmail.com>2026-03-13 13:49:15 -0700
committerEmma Terzioglu <emreterzioglu49@gmail.com>2026-03-13 13:49:15 -0700
commit7a33856a527aebbd8d2a624c6d5937c25c9a1d90 (patch)
tree855c642394e7ba1de40b8bb8737be12bec0aedaf /src/templates/admin/blog_edit.html
initial commit
new website repo yay!!!
Diffstat (limited to 'src/templates/admin/blog_edit.html')
-rw-r--r--src/templates/admin/blog_edit.html42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/templates/admin/blog_edit.html b/src/templates/admin/blog_edit.html
new file mode 100644
index 0000000..99c3d9c
--- /dev/null
+++ b/src/templates/admin/blog_edit.html
@@ -0,0 +1,42 @@
+{% extends "base.html" %}
+
+{% block head %}
+{{ super() }}
+
+<link rel="stylesheet" href="/static/stylesheets/admin_blog.css">
+{% endblock %}
+
+{% block content %}
+
+<h1>edit a post!</h1>
+
+<button id="delete-post">delete</button>
+
+<form class="flex-col" method="post">
+ <div class="flex-col" style="margin-bottom: 12px;">
+ <label for="title">title:</label>
+ <input type="text" name="title" value="{{ post.title }}" />
+
+ <label for="description">description:</label>
+ <input type="text" name="description" value="{{ post.description or '' }}" />
+ </div>
+
+ <textarea placeholder="edit here" name="text">{{ post.original }}</textarea>
+
+ <div class="flex-row" style="margin: 12px 0; gap: 6px;">
+ <input type="checkbox" name="public" {{ "checked" if post.public else "" }} />
+ <label for="public">make public</label>
+ </div>
+
+ <input type="submit" value="edit" />
+</form>
+
+<script>
+document.getElementById("delete-post").onclick = async (e) => {
+ origin = window.location.origin
+ await fetch(`${origin}/admin/blog/{{ post.id }}`, { method: "DELETE" });
+ window.location.href = `${origin}/admin/blog`;
+};
+</script>
+
+{% endblock %}