diff options
| author | 2025-03-19 17:07:29 +0100 | |
|---|---|---|
| committer | 2025-03-19 17:07:29 +0100 | |
| commit | 6f310aff4f38679b2f85e1e7e55705e2710e8bcc (patch) | |
| tree | 0a44bc8b71fee6e0cbb49b5402d77f0569439149 | |
| parent | If a child post is from the same author, don't indent it. (diff) | |
| download | penes-snac2-6f310aff4f38679b2f85e1e7e55705e2710e8bcc.tar.gz penes-snac2-6f310aff4f38679b2f85e1e7e55705e2710e8bcc.tar.xz penes-snac2-6f310aff4f38679b2f85e1e7e55705e2710e8bcc.zip | |
Hide the first child container if it's empty.
| -rw-r--r-- | html.c | 6 |
1 files changed, 6 insertions, 0 deletions
| @@ -2609,6 +2609,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2609 | const char *cmd5; | 2609 | const char *cmd5; |
| 2610 | int cnt = 0; | 2610 | int cnt = 0; |
| 2611 | int o_cnt = 0; | 2611 | int o_cnt = 0; |
| 2612 | int f_cnt = 0; | ||
| 2612 | 2613 | ||
| 2613 | /* get the first child */ | 2614 | /* get the first child */ |
| 2614 | xs_list_next(children, &cmd5, &ctxt); | 2615 | xs_list_next(children, &cmd5, &ctxt); |
| @@ -2632,6 +2633,7 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2632 | html_entry(user, f_chd, read_only, level + 1, cmd5, hide_children)); | 2633 | html_entry(user, f_chd, read_only, level + 1, cmd5, hide_children)); |
| 2633 | 2634 | ||
| 2634 | cnt++; | 2635 | cnt++; |
| 2636 | f_cnt++; | ||
| 2635 | left--; | 2637 | left--; |
| 2636 | } | 2638 | } |
| 2637 | else | 2639 | else |
| @@ -2680,6 +2682,10 @@ xs_html *html_entry(snac *user, xs_dict *msg, int read_only, | |||
| 2680 | if (o_cnt == 0 && ch_older) | 2682 | if (o_cnt == 0 && ch_older) |
| 2681 | xs_html_add(ch_older, | 2683 | xs_html_add(ch_older, |
| 2682 | xs_html_attr("style", "display: none")); | 2684 | xs_html_attr("style", "display: none")); |
| 2685 | |||
| 2686 | if (f_cnt == 0) | ||
| 2687 | xs_html_add(fch_container, | ||
| 2688 | xs_html_attr("style", "display: none")); | ||
| 2683 | } | 2689 | } |
| 2684 | } | 2690 | } |
| 2685 | 2691 | ||