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