add reusable babycode editor

This commit is contained in:
2025-05-24 02:45:54 +03:00
parent ec3f144b4e
commit 66318698e5
10 changed files with 116 additions and 33 deletions

View File

@ -54,13 +54,11 @@
<% if not edit then %>
<%- post.content %>
<% else %>
<form class="post-edit-form" method="post">
<textarea name="new_content" required><%- post.original_markup %></textarea>
<span>
<input type=submit value="Save">
<a class="linkbutton warn" href="<%= url_for("thread", {slug = thread.slug}, {page = page}) .. "#post-" .. post.id %>">Cancel</a>
</span>
</form>
<% render("views.common.babycode-editor", {
cancel_url = url_for("thread", {slug = thread.slug}, {page = page}) .. "#post-" .. post.id,
prefill = post.original_markup,
ta_name = "new_content"
}) %>
<% end %>
</div>
</div>