aboutsummaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-04-01 09:02:35 +0200
committerdefault <nobody@localhost>2025-04-01 09:02:35 +0200
commitdde907f55a6c63f7d1bb8345f7850b51cd028a7b (patch)
tree0d1dfc19a239b1cb7ab8af3869f08fbc252c054b /html.c
parent9b2d0381ba734102c20d2111f0a2b64a3c438ef7 (diff)
Only show date edition controls if it's new, drafted or scheduled.
Diffstat (limited to 'html.c')
-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,
}
}
- xs_html_add(form,
- xs_html_tag("p",
- xs_html_text(L("Post date and time (empty, right now; in the future, schedule for later):")),
- xs_html_sctag("br", NULL),
- xs_html_sctag("input",
- xs_html_attr("type", "date"),
- xs_html_attr("value", post_date ? post_date : ""),
- xs_html_attr("name", "post_date")),
- xs_html_text(" "),
- xs_html_sctag("input",
- xs_html_attr("type", "time"),
- xs_html_attr("value", post_time ? post_time : ""),
- xs_html_attr("step", "1"),
- xs_html_attr("name", "post_time"))));
+ if (edit_id == NULL || is_draft || is_scheduled(user, edit_id)) {
+ xs_html_add(form,
+ xs_html_tag("p",
+ xs_html_text(L("Post date and time (empty, right now; in the future, schedule for later):")),
+ xs_html_sctag("br", NULL),
+ xs_html_sctag("input",
+ xs_html_attr("type", "date"),
+ xs_html_attr("value", post_date ? post_date : ""),
+ xs_html_attr("name", "post_date")),
+ xs_html_text(" "),
+ xs_html_sctag("input",
+ xs_html_attr("type", "time"),
+ xs_html_attr("value", post_time ? post_time : ""),
+ xs_html_attr("step", "1"),
+ xs_html_attr("name", "post_time"))));
+ }
if (edit_id)
xs_html_add(form,