summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2025-04-01 09:02:35 +0200
committerGravatar default2025-04-01 09:02:35 +0200
commitdde907f55a6c63f7d1bb8345f7850b51cd028a7b (patch)
tree0d1dfc19a239b1cb7ab8af3869f08fbc252c054b
parentMore scheduled post code. (diff)
downloadpenes-snac2-dde907f55a6c63f7d1bb8345f7850b51cd028a7b.tar.gz
penes-snac2-dde907f55a6c63f7d1bb8345f7850b51cd028a7b.tar.xz
penes-snac2-dde907f55a6c63f7d1bb8345f7850b51cd028a7b.zip
Only show date edition controls if it's new, drafted or scheduled.
-rw-r--r--html.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/html.c b/html.c
index bc8a645..008c05b 100644
--- a/html.c
+++ b/html.c
@@ -453,20 +453,22 @@ xs_html *html_note(snac *user, const char *summary,
453 } 453 }
454 } 454 }
455 455
456 xs_html_add(form, 456 if (edit_id == NULL || is_draft || is_scheduled(user, edit_id)) {
457 xs_html_tag("p", 457 xs_html_add(form,
458 xs_html_text(L("Post date and time (empty, right now; in the future, schedule for later):")), 458 xs_html_tag("p",
459 xs_html_sctag("br", NULL), 459 xs_html_text(L("Post date and time (empty, right now; in the future, schedule for later):")),
460 xs_html_sctag("input", 460 xs_html_sctag("br", NULL),
461 xs_html_attr("type", "date"), 461 xs_html_sctag("input",
462 xs_html_attr("value", post_date ? post_date : ""), 462 xs_html_attr("type", "date"),
463 xs_html_attr("name", "post_date")), 463 xs_html_attr("value", post_date ? post_date : ""),
464 xs_html_text(" "), 464 xs_html_attr("name", "post_date")),
465 xs_html_sctag("input", 465 xs_html_text(" "),
466 xs_html_attr("type", "time"), 466 xs_html_sctag("input",
467 xs_html_attr("value", post_time ? post_time : ""), 467 xs_html_attr("type", "time"),
468 xs_html_attr("step", "1"), 468 xs_html_attr("value", post_time ? post_time : ""),
469 xs_html_attr("name", "post_time")))); 469 xs_html_attr("step", "1"),
470 xs_html_attr("name", "post_time"))));
471 }
470 472
471 if (edit_id) 473 if (edit_id)
472 xs_html_add(form, 474 xs_html_add(form,