Add "View on original instance" link
This commit is contained in:
parent
452ac756e6
commit
8b443062eb
|
@ -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 */
|
||||
|
|
|
@ -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"),
|
||||
|
|
Loading…
Reference in New Issue