diff --git a/routes/css.cpp b/routes/css.cpp index e9409e6..d061dc9 100644 --- a/routes/css.cpp +++ b/routes/css.cpp @@ -143,11 +143,11 @@ svg { .user_page-profile { width: 7.5em; height: 7.5em; + margin-right: 0.5em; } .user_page-main_header span { margin-top: auto; margin-bottom: auto; - margin-left: 0.5em; } /* https://stackoverflow.com/a/7354648 */ diff --git a/routes/user.cpp b/routes/user.cpp index 7dd8f7e..928f27b 100644 --- a/routes/user.cpp +++ b/routes/user.cpp @@ -93,6 +93,10 @@ static inline Element user_header(const httplib::Request& req, const std::string user_links.nodes.push_back(user_link_field(req, account, i)); } + Node view_on_original = !account.same_server + ? Element("span", {" (", Element("a", {{"href", get_origin(req) + '/' + account.server + "/@" + account.username}}, {"View on original instance"}), ")"}) + : Node(""); + Element header("header", { Element("a", {{"href", account.header}}, { Element("img", {{"class", "user_page-header"}, {"alt", "User header"}, {"src", account.header}}, {}), @@ -102,7 +106,7 @@ static inline Element user_header(const httplib::Request& req, const std::string Element("img", {{"class", "user_page-profile"}, {"alt", "User profile picture"}, {"src", account.avatar}}, {}), }), Element("span", { - Element("b", {preprocess_html(req, account.emojis, account.display_name)}), " (", account.acct(), ")", + Element("b", {preprocess_html(req, account.emojis, account.display_name)}), " (", account.acct(), ")", view_on_original, Element("br"), Element("br"), Element("b", {"Joined: "}), short_time(account.created_at), Element("br"),