diff options
| author | 2023-06-29 18:06:42 +0200 | |
|---|---|---|
| committer | 2023-06-29 18:06:42 +0200 | |
| commit | f4c7f4b9d79d8430e4d95c9c46a8ab402096d5a3 (patch) | |
| tree | dee23588c5b9eca8a2d474808e55fe7320a743b8 /html.c | |
| parent | New file doc/susie-qr.png. (diff) | |
| download | snac2-f4c7f4b9d79d8430e4d95c9c46a8ab402096d5a3.tar.gz snac2-f4c7f4b9d79d8430e4d95c9c46a8ab402096d5a3.tar.xz snac2-f4c7f4b9d79d8430e4d95c9c46a8ab402096d5a3.zip | |
Added a new snac-post-header CSS class.
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 22 |
1 files changed, 10 insertions, 12 deletions
| @@ -81,7 +81,7 @@ xs_str *actor_name(xs_dict *actor) | |||
| 81 | xs_str *html_actor_icon(xs_str *os, char *actor, | 81 | xs_str *html_actor_icon(xs_str *os, char *actor, |
| 82 | const char *date, const char *udate, const char *url, int priv) | 82 | const char *date, const char *udate, const char *url, int priv) |
| 83 | { | 83 | { |
| 84 | xs *s = xs_str_new("<div class=\"snac-post-header\">\n"); | 84 | xs *s = xs_str_new(NULL); |
| 85 | 85 | ||
| 86 | xs *avatar = NULL; | 86 | xs *avatar = NULL; |
| 87 | char *v; | 87 | char *v; |
| @@ -169,8 +169,6 @@ xs_str *html_actor_icon(xs_str *os, char *actor, | |||
| 169 | s = xs_str_cat(s, s1); | 169 | s = xs_str_cat(s, s1); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | s = xs_str_cat(s, "</div>\n"); | ||
| 173 | |||
| 174 | return xs_str_cat(os, s); | 172 | return xs_str_cat(os, s); |
| 175 | } | 173 | } |
| 176 | 174 | ||
| @@ -807,14 +805,14 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, | |||
| 807 | } | 805 | } |
| 808 | 806 | ||
| 809 | if (strcmp(type, "Follow") == 0) { | 807 | if (strcmp(type, "Follow") == 0) { |
| 810 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); | 808 | s = xs_str_cat(s, "<div class=\"snac-post\">\n<div class=\"snac-post-header\">\n"); |
| 811 | 809 | ||
| 812 | xs *s1 = xs_fmt("<div class=\"snac-origin\">%s</div>\n", L("follows you")); | 810 | xs *s1 = xs_fmt("<div class=\"snac-origin\">%s</div>\n", L("follows you")); |
| 813 | s = xs_str_cat(s, s1); | 811 | s = xs_str_cat(s, s1); |
| 814 | 812 | ||
| 815 | s = html_msg_icon(snac, s, msg); | 813 | s = html_msg_icon(snac, s, msg); |
| 816 | 814 | ||
| 817 | s = xs_str_cat(s, "</div>\n"); | 815 | s = xs_str_cat(s, "</div>\n</div>\n"); |
| 818 | 816 | ||
| 819 | return xs_str_cat(os, s); | 817 | return xs_str_cat(os, s); |
| 820 | } | 818 | } |
| @@ -839,7 +837,12 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, | |||
| 839 | if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) | 837 | if (strcmp(actor, snac->actor) != 0 && !valid_status(actor_get(snac, actor, NULL))) |
| 840 | return os; | 838 | return os; |
| 841 | 839 | ||
| 842 | s = xs_str_cat(s, "<div class=\"snac-score\">"); /** **/ | 840 | if (level == 0) |
| 841 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); /** **/ | ||
| 842 | else | ||
| 843 | s = xs_str_cat(s, "<div class=\"snac-child\">\n"); /** **/ | ||
| 844 | |||
| 845 | s = xs_str_cat(s, "<div class=\"snac-post-header\">\n<div class=\"snac-score\">"); /** **/ | ||
| 843 | 846 | ||
| 844 | if (is_pinned(snac, id)) { | 847 | if (is_pinned(snac, id)) { |
| 845 | /* add a pin emoji */ | 848 | /* add a pin emoji */ |
| @@ -873,11 +876,6 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, | |||
| 873 | 876 | ||
| 874 | s = xs_str_cat(s, "</div>\n"); | 877 | s = xs_str_cat(s, "</div>\n"); |
| 875 | 878 | ||
| 876 | if (level == 0) | ||
| 877 | s = xs_str_cat(s, "<div class=\"snac-post\">\n"); /** **/ | ||
| 878 | else | ||
| 879 | s = xs_str_cat(s, "<div class=\"snac-child\">\n"); /** **/ | ||
| 880 | |||
| 881 | if (boosts == NULL) | 879 | if (boosts == NULL) |
| 882 | boosts = object_announces(id); | 880 | boosts = object_announces(id); |
| 883 | 881 | ||
| @@ -934,7 +932,7 @@ xs_str *html_entry(snac *snac, xs_str *os, const xs_dict *msg, int local, | |||
| 934 | s = html_msg_icon(snac, s, msg); | 932 | s = html_msg_icon(snac, s, msg); |
| 935 | 933 | ||
| 936 | /* add the content */ | 934 | /* add the content */ |
| 937 | s = xs_str_cat(s, "<div class=\"e-content snac-content\">\n"); /** **/ | 935 | s = xs_str_cat(s, "</div>\n<div class=\"e-content snac-content\">\n"); /** **/ |
| 938 | 936 | ||
| 939 | /* is it sensitive? */ | 937 | /* is it sensitive? */ |
| 940 | if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) { | 938 | if (!xs_is_null(v = xs_dict_get(msg, "sensitive")) && xs_type(v) == XSTYPE_TRUE) { |