Add Markdown checkbox to thread->create; use defined-or to catch false

This commit is contained in:
swagg boi 2025-04-04 20:03:40 -04:00
parent df870f682f
commit ce7ea8c755
3 changed files with 7 additions and 1 deletions

View File

@ -36,6 +36,8 @@ sub create($self) {
$self->session(author => $thread_author); $self->session(author => $thread_author);
print $self->dumper($v);
unless ($preview) { unless ($preview) {
my $new_thread_id = $self->thread->create( my $new_thread_id = $self->thread->create(
$thread_author, $thread_author,

View File

@ -13,7 +13,7 @@ sub create(
$author, $author,
$title, $title,
$body, $body,
$markdown = 0, $markdown //= 0,
$hidden = 0, $hidden = 0,
$flagged = 0 $flagged = 0
) )

View File

@ -57,6 +57,10 @@
rows => 6 rows => 6
) %> ) %>
</div> </div>
<div class="form-checkbox">
<%= check_box markdown => 1, id => 'markdown' %>
<%= label_for markdown => 'Markdown' %>
</div>
<div class="form-checkbox"> <div class="form-checkbox">
<%= check_box preview => 1, id => 'preview' %> <%= check_box preview => 1, id => 'preview' %>
<%= label_for preview => 'Preview' %> <%= label_for preview => 'Preview' %>