From e776bf7e2c81d2cd03efda14e06d375bf80f890b Mon Sep 17 00:00:00 2001 From: Yonle Date: Mon, 24 Jul 2023 20:36:35 +0700 Subject: [PATCH] html.c: Rollback to e9adaa1f7a, Put "User Settings..." outside of "Operations..."'s
element Signed-off-by: Yonle --- html.c | 44 +++++++++++--------------------------------- 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/html.c b/html.c index 198269f..725c064 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* snac - A simple, minimalistic ActivityPub instance */ + /* snac - A simple, minimalistic ActivityPub instance */ /* copyright (c) 2022 - 2023 grunfink / MIT license */ #include "xs.h" @@ -343,14 +343,11 @@ d_char *html_user_header(snac *snac, d_char *s, int local) "%s - " "%s - " "%s%s - " - "%s\n" - "%s" - "", + "%s\n", snac->uid, L("public"), L("private"), L("notifications"), n_str, - L("people"), - L("settings")); + L("people")); } s = xs_str_cat(s, s1); @@ -388,13 +385,13 @@ d_char *html_user_header(snac *snac, d_char *s, int local) } -xs_str *html_top_controls(snac *snac, xs_str *s, int settings) +d_char *html_top_controls(snac *snac, d_char *s) /* generates the top controls */ { char *_tmpl = "
\n" - "
\n" + "
\n" "
%s\n" "
\n" @@ -431,8 +428,8 @@ xs_str *html_top_controls(snac *snac, xs_str *s, int settings) "
\n" "
\n" - "
\n" - "

%s\n" + "
\n" + "
%s\n" "\n" /** follow **/ "\n" @@ -444,11 +441,8 @@ xs_str *html_top_controls(snac *snac, xs_str *s, int settings) " %s\n" "

\n" "

\n" - "
\n" - "
\n" - - "

%s

\n" + "
%s\n" "
\n" /** user setup **/ "
\n" "
\n" + "
\n" "
\n" "
\n"; @@ -535,7 +530,6 @@ xs_str *html_top_controls(snac *snac, xs_str *s, int settings) xs *es6 = encode_html(purge_days); xs *s1 = xs_fmt(_tmpl, - settings ? "style=\"display: none\"" : "", L("New Post..."), L("Sensitive content"), L("Sensitive content description"), @@ -555,15 +549,11 @@ xs_str *html_top_controls(snac *snac, xs_str *s, int settings) L("Post"), - settings ? "style=\"display: none\"" : "", L("Operations..."), - L("Follow"), L("(by URL or user@host)"), L("Boost"), L("(by URL)"), - !settings ? "style=\"display: none\"" : "", - - L("User Settings"), + L("User Settings..."), L("Display name"), es1, L("Avatar"), @@ -1380,7 +1370,7 @@ xs_str *html_timeline(snac *snac, const xs_list *list, int local, int skip, int s = html_user_header(snac, s, local); if (!local) - s = html_top_controls(snac, s, list == NULL ? 1 : 0); + s = html_top_controls(snac, s); s = xs_str_cat(s, "\n"); s = xs_str_cat(s, "
\n"); @@ -1817,18 +1807,6 @@ int html_get_handler(const xs_dict *req, const char *q_path, } } else - if (strcmp(p_path, "settings") == 0) { /** user settings **/ - if (!login(&snac, req)) { - *body = xs_dup(uid); - status = 401; - } - else { - *body = html_timeline(&snac, NULL, 0, 0, 0, 0); - *b_size = strlen(*body); - status = 200; - } - } - else if (strcmp(p_path, "notifications") == 0) { /** the list of notifications **/ if (!login(&snac, req)) { *body = xs_dup(uid);