diff options
| author | 2023-07-04 14:55:24 +0200 | |
|---|---|---|
| committer | 2023-07-04 14:55:24 +0200 | |
| commit | 339fe5edc52e90e6a0744c7b96eea5f2071ae39b (patch) | |
| tree | 7f4a6c26a3c1c9cf8c956ddbbc498f77bac78427 | |
| parent | The sensitive content can have a description. (diff) | |
| download | snac2-339fe5edc52e90e6a0744c7b96eea5f2071ae39b.tar.gz snac2-339fe5edc52e90e6a0744c7b96eea5f2071ae39b.tar.xz snac2-339fe5edc52e90e6a0744c7b96eea5f2071ae39b.zip | |
Also fill the sensitive content fields in the edit dialog.
| -rw-r--r-- | html.c | 8 |
1 files changed, 6 insertions, 2 deletions
| @@ -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, "<", "<"); | 690 | xs *prev_src = xs_replace(prev_src1, "<", "<"); |
| 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"), |