diff --git a/src/routes/user.rs b/src/routes/user.rs index 49023c6a..7bb7b982 100644 --- a/src/routes/user.rs +++ b/src/routes/user.rs @@ -41,7 +41,9 @@ fn details(name: String, conn: DbConn, account: Option) -> Template { let n_followers = user.get_followers(&*conn).len(); Template::render("users/details", json!({ - "user": serde_json::to_value(user).unwrap(), + "user": serde_json::to_value(user.clone()).unwrap(), + "instance_url": user.get_instance(&*conn).public_domain, + "is_remote": user.instance_id != Instance::local_id(&*conn), "account": account, "recents": recents.into_iter().map(|p| { json!({ @@ -116,6 +118,8 @@ fn followers(name: String, conn: DbConn, account: Option) -> Template { Template::render("users/followers", json!({ "user": serde_json::to_value(user.clone()).unwrap(), + "instance_url": user.get_instance(&*conn).public_domain, + "is_remote": user.instance_id != Instance::local_id(&*conn), "followers": user.get_followers(&*conn).into_iter().map(|f| { let fqn = f.get_fqn(&*conn); let mut json = serde_json::to_value(f).unwrap(); diff --git a/templates/users/details.html.tera b/templates/users/details.html.tera index df9c9157..6bc5c2c9 100644 --- a/templates/users/details.html.tera +++ b/templates/users/details.html.tera @@ -27,6 +27,10 @@ {% if is_self %} Edit your profile {% endif %} + + {% if is_remote %} + Open on {{ instance_url }} + {% endif %}
diff --git a/templates/users/followers.html.tera b/templates/users/followers.html.tera index 9b0bdf28..e8af7cd6 100644 --- a/templates/users/followers.html.tera +++ b/templates/users/followers.html.tera @@ -22,6 +22,10 @@ It is you {% endif %} + + {% if is_remote %} + Open on {{ instance_url }} + {% endif %}

Followers

@@ -33,7 +37,7 @@ {% set follower_name = follower.username %} {% endif %}
-

{{ follower_name }} — @{{ follower.fqn }}

+

{{ follower_name }} — @{{ follower.fqn }}

{{ follower.summary | safe }}

{% endfor %}