2018-12-06 18:54:16 +01:00
|
|
|
@use plume_models::users::User;
|
2020-01-21 07:02:03 +01:00
|
|
|
@use crate::template_utils::*;
|
|
|
|
@use crate::routes::*;
|
2018-12-06 18:54:16 +01:00
|
|
|
|
|
|
|
@(ctx: BaseContext, user: &User, follows: bool, is_remote: bool, instance_url: String)
|
|
|
|
|
2018-12-08 21:52:46 +01:00
|
|
|
<div class="h-card">
|
|
|
|
<div class="user">
|
|
|
|
<div class="flex wrap">
|
|
|
|
@avatar(ctx.0, &user, Size::Medium, false, ctx.1)
|
2018-12-06 18:54:16 +01:00
|
|
|
|
2018-12-08 21:52:46 +01:00
|
|
|
<h1 class="grow flex vertical">
|
2019-03-06 18:28:10 +01:00
|
|
|
<span class="p-name">@user.name()</span>
|
2019-03-19 14:37:56 +01:00
|
|
|
<small class="p-nickname">@user.fqn</small>
|
2018-12-08 21:52:46 +01:00
|
|
|
</h1>
|
2018-12-06 18:54:16 +01:00
|
|
|
|
2021-02-12 11:28:45 +01:00
|
|
|
<p class="grow">
|
2019-09-13 12:28:36 +02:00
|
|
|
@if user.is_admin() {
|
2018-12-08 21:52:46 +01:00
|
|
|
<span class="badge">@i18n!(ctx.1, "Admin")</span>
|
|
|
|
}
|
2018-12-06 18:54:16 +01:00
|
|
|
|
2018-12-08 21:52:46 +01:00
|
|
|
@if ctx.2.clone().map(|u| u.id == user.id).unwrap_or(false) {
|
|
|
|
<span class="badge">@i18n!(ctx.1, "It is you")</span>
|
|
|
|
<a href="@uri!(user::edit: name = &user.username)" class="button inline-block">@i18n!(ctx.1, "Edit your profile")</a>
|
|
|
|
}
|
|
|
|
</p>
|
|
|
|
</div>
|
2018-12-06 18:54:16 +01:00
|
|
|
|
2018-12-08 21:52:46 +01:00
|
|
|
@if is_remote {
|
|
|
|
<a class="inline-block u-url" href="@user.ap_url" rel="me" target="_blank">@i18n!(ctx.1, "Open on {0}"; instance_url)</a>
|
2018-12-06 18:54:16 +01:00
|
|
|
} else {
|
2018-12-08 21:52:46 +01:00
|
|
|
<a class="u-url" href="@user.ap_url"></a>
|
2018-12-06 18:54:16 +01:00
|
|
|
}
|
2018-12-08 21:52:46 +01:00
|
|
|
|
2019-04-17 22:09:07 +02:00
|
|
|
@if ctx.2.clone().map(|u| u.id != user.id).unwrap_or(true) {
|
2019-03-06 18:28:10 +01:00
|
|
|
<form class="inline" method="post" action="@uri!(user::follow: name = &user.fqn)">
|
2018-12-08 21:52:46 +01:00
|
|
|
@if follows {
|
2019-02-26 13:13:00 +01:00
|
|
|
<input type="submit" value="@i18n!(ctx.1, "Unsubscribe")">
|
2018-12-08 21:52:46 +01:00
|
|
|
} else {
|
2019-02-26 13:13:00 +01:00
|
|
|
<input type="submit" value="@i18n!(ctx.1, "Subscribe")">
|
2018-12-08 21:52:46 +01:00
|
|
|
}
|
|
|
|
</form>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
<div class="user-summary p-note">
|
2019-03-17 20:11:29 +01:00
|
|
|
@Html(user.summary_html.clone())
|
2018-12-08 21:52:46 +01:00
|
|
|
</div>
|
2018-12-06 18:54:16 +01:00
|
|
|
</div>
|