summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-05-18 08:23:48 +0200
committerGravatar grunfink2025-05-18 08:23:48 +0200
commitee84140ecceb07dad8ea36cc5aa29b91bbb48a56 (patch)
tree077e8defca025ed364741a10b7557c02c554ab0f /html.c
parentmastoapi: Also process the types[] argument in notifications. (diff)
downloadsnac2-ee84140ecceb07dad8ea36cc5aa29b91bbb48a56.tar.gz
snac2-ee84140ecceb07dad8ea36cc5aa29b91bbb48a56.tar.xz
snac2-ee84140ecceb07dad8ea36cc5aa29b91bbb48a56.zip
Added a pending follow request count next to the "people" link.
Diffstat (limited to 'html.c')
-rw-r--r--html.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/html.c b/html.c
index aec7d0a..6c7af51 100644
--- a/html.c
+++ b/html.c
@@ -923,7 +923,9 @@ static xs_html *html_user_body(snac *user, int read_only)
923 } 923 }
924 else { 924 else {
925 int n_len = notify_new_num(user); 925 int n_len = notify_new_num(user);
926 int p_len = pending_count(user);
926 xs_html *notify_count = NULL; 927 xs_html *notify_count = NULL;
928 xs_html *pending_follow_count = NULL;
927 929
928 /* show the number of new notifications, if there are any */ 930 /* show the number of new notifications, if there are any */
929 if (n_len) { 931 if (n_len) {
@@ -935,6 +937,15 @@ static xs_html *html_user_body(snac *user, int read_only)
935 else 937 else
936 notify_count = xs_html_text(""); 938 notify_count = xs_html_text("");
937 939
940 if (p_len) {
941 xs *s = xs_fmt(" %d ", p_len);
942 pending_follow_count = xs_html_tag("sup",
943 xs_html_attr("style", "background-color: red; color: white;"),
944 xs_html_text(s));
945 }
946 else
947 pending_follow_count = xs_html_text("");
948
938 xs *admin_url = xs_fmt("%s/admin", user->actor); 949 xs *admin_url = xs_fmt("%s/admin", user->actor);
939 xs *notify_url = xs_fmt("%s/notifications", user->actor); 950 xs *notify_url = xs_fmt("%s/notifications", user->actor);
940 xs *people_url = xs_fmt("%s/people", user->actor); 951 xs *people_url = xs_fmt("%s/people", user->actor);
@@ -957,6 +968,7 @@ static xs_html *html_user_body(snac *user, int read_only)
957 xs_html_tag("a", 968 xs_html_tag("a",
958 xs_html_attr("href", people_url), 969 xs_html_attr("href", people_url),
959 xs_html_text(L("people"))), 970 xs_html_text(L("people"))),
971 pending_follow_count,
960 xs_html_text(" - "), 972 xs_html_text(" - "),
961 xs_html_tag("a", 973 xs_html_tag("a",
962 xs_html_attr("href", instance_url), 974 xs_html_attr("href", instance_url),