commit dde907f

default  ·  2025-04-01 07:02:35 +0000 UTC
parent 9b2d038
Only show date edition controls if it's new, drafted or scheduled.
1 files changed,  +16, -14
M html.c
M html.c
+16, -14
 1@@ -453,20 +453,22 @@ xs_html *html_note(snac *user, const char *summary,
 2         }
 3     }
 4 
 5-    xs_html_add(form,
 6-        xs_html_tag("p",
 7-            xs_html_text(L("Post date and time (empty, right now; in the future, schedule for later):")),
 8-            xs_html_sctag("br", NULL),
 9-            xs_html_sctag("input",
10-                xs_html_attr("type",  "date"),
11-                xs_html_attr("value", post_date ? post_date : ""),
12-                xs_html_attr("name",  "post_date")),
13-            xs_html_text(" "),
14-            xs_html_sctag("input",
15-                xs_html_attr("type",  "time"),
16-                xs_html_attr("value", post_time ? post_time : ""),
17-                xs_html_attr("step",  "1"),
18-                xs_html_attr("name",  "post_time"))));
19+    if (edit_id == NULL || is_draft || is_scheduled(user, edit_id)) {
20+        xs_html_add(form,
21+            xs_html_tag("p",
22+                xs_html_text(L("Post date and time (empty, right now; in the future, schedule for later):")),
23+                xs_html_sctag("br", NULL),
24+                xs_html_sctag("input",
25+                    xs_html_attr("type",  "date"),
26+                    xs_html_attr("value", post_date ? post_date : ""),
27+                    xs_html_attr("name",  "post_date")),
28+                xs_html_text(" "),
29+                xs_html_sctag("input",
30+                    xs_html_attr("type",  "time"),
31+                    xs_html_attr("value", post_time ? post_time : ""),
32+                    xs_html_attr("step",  "1"),
33+                    xs_html_attr("name",  "post_time"))));
34+    }
35 
36     if (edit_id)
37         xs_html_add(form,