2018-12-06 18:54:16 +01:00
|
|
|
@use template_utils::*;
|
|
|
|
@use plume_models::users::User;
|
2018-12-07 12:05:01 +01:00
|
|
|
@use 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
|
|
|
|
2018-12-08 21:52:46 +01:00
|
|
|
<p>
|
|
|
|
@if user.is_admin {
|
|
|
|
<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>
|