summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-07-04 14:55:24 +0200
committerGravatar default2023-07-04 14:55:24 +0200
commit339fe5edc52e90e6a0744c7b96eea5f2071ae39b (patch)
tree7f4a6c26a3c1c9cf8c956ddbbc498f77bac78427
parentThe sensitive content can have a description. (diff)
downloadsnac2-339fe5edc52e90e6a0744c7b96eea5f2071ae39b.tar.gz
snac2-339fe5edc52e90e6a0744c7b96eea5f2071ae39b.tar.xz
snac2-339fe5edc52e90e6a0744c7b96eea5f2071ae39b.zip
Also fill the sensitive content fields in the edit dialog.
-rw-r--r--html.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/html.c b/html.c
index b412f41..46ce5a5 100644
--- a/html.c
+++ b/html.c
@@ -688,6 +688,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
688 688
689 if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) { 689 if (!xs_is_null(prev_src1) && strcmp(actor, snac->actor) == 0) {
690 xs *prev_src = xs_replace(prev_src1, "<", "&lt;"); 690 xs *prev_src = xs_replace(prev_src1, "<", "&lt;");
691 const xs_val *sensitive = xs_dict_get(msg, "sensitive");
692 const char *summary = xs_dict_get(msg, "summary");
691 693
692 /* post can be edited */ 694 /* post can be edited */
693 xs *s1 = xs_fmt( 695 xs *s1 = xs_fmt(
@@ -699,8 +701,8 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
699 "rows=\"4\" wrap=\"virtual\" required=\"required\">%s</textarea>\n" 701 "rows=\"4\" wrap=\"virtual\" required=\"required\">%s</textarea>\n"
700 "<input type=\"hidden\" name=\"edit_id\" value=\"%s\">\n" 702 "<input type=\"hidden\" name=\"edit_id\" value=\"%s\">\n"
701 703
702 "<p>%s: <input type=\"checkbox\" name=\"sensitive\"> " 704 "<p>%s: <input type=\"checkbox\" name=\"sensitive\" %s> "
703 "<input type=\"text\" name=\"summary\" placeholder=\"%s\">\n" 705 "<input type=\"text\" name=\"summary\" placeholder=\"%s\" value=\"%s\">\n"
704 "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n" 706 "<p>%s: <input type=\"checkbox\" name=\"mentioned_only\">\n"
705 707
706 "<details><summary>%s</summary>\n" 708 "<details><summary>%s</summary>\n"
@@ -720,7 +722,9 @@ xs_str *html_entry_controls(snac *snac, xs_str *os, const xs_dict *msg, const ch
720 prev_src, 722 prev_src,
721 id, 723 id,
722 L("Sensitive content"), 724 L("Sensitive content"),
725 xs_type(sensitive) == XSTYPE_TRUE ? "checked" : "",
723 L("Sensitive content description"), 726 L("Sensitive content description"),
727 summary,
724 L("Only for mentioned people"), 728 L("Only for mentioned people"),
725 L("Attach..."), 729 L("Attach..."),
726 L("File"), 730 L("File"),