mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-22 06:41:08 +00:00
Fix links to remote user profiles in edit history
This commit is contained in:
parent
758dd913cc
commit
d352a33c7a
2 changed files with 10 additions and 2 deletions
|
@ -129,7 +129,7 @@ impl DbPerson {
|
|||
.select(person::all_columns)
|
||||
.into_boxed();
|
||||
query = if let Some(domain) = domain {
|
||||
let domain_pattern = format!("{}://{domain}/%", http_protocol_str());
|
||||
let domain_pattern = format!("%://{domain}/%");
|
||||
query
|
||||
.filter(person::ap_id.ilike(domain_pattern))
|
||||
.filter(person::local.eq(false))
|
||||
|
|
|
@ -43,7 +43,15 @@ fn user_title(person: &DbPerson) -> String {
|
|||
}
|
||||
|
||||
fn user_link(person: &DbPerson) -> impl IntoView {
|
||||
let creator_path = format!("/user/{}", person.username);
|
||||
let creator_path = if person.local {
|
||||
format!("/user/{}", person.username)
|
||||
} else {
|
||||
format!(
|
||||
"/user/{}@{}",
|
||||
person.username,
|
||||
extract_domain(&person.ap_id)
|
||||
)
|
||||
};
|
||||
view! { <a href=creator_path>{user_title(person)}</a> }
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue