@(u: User, info: lila.app.mashup.UserInfo, angle: lila.app.mashup.UserInfo.Angle, social: lila.app.mashup.UserInfo.Social)(implicit ctx: Context) @import lila.app.mashup.UserInfo.Angle @import social._

@if(u.isPatron) { @Html(patronIcon)@userSpan(u, withPowerTip = false, withOnline = false) } else { @userSpan(u, withPowerTip = false) }

@perfTrophies(u, info.ranks) @otherTrophies(u, info)
@if(u.plan.active) { @patronIconChar } @if(u.disabled) { CLOSED }
@if(ctx is u) { } @if(isGranted(_.UserSpy)) { } @if(ctx.isAuth && !ctx.is(u)) { @views.html.relation.actions(u.id, relation = relation, followable = followable, blocked = blocked) @NotForKids { } } @if(ctx is u) { }
@NotForKids { @if(!(ctx is u)) {
@if(isGranted(_.ModNote)) { } else { }
@if(notes.isEmpty) {
No note yet
} @notes.map { note =>

@userIdLink(note.from.some)
@momentFromNow(note.date)

@richText(note.text)

}
} } @if((ctx is u) && u.perfs.bestRating > 2400 && !u.hasTitle && !ctx.pref.hasSeenVerifyTitle ) { @claimTitle(u) }
@angle match { case Angle.Games(Some(searchForm)) => { @search.user(u, searchForm) } case _ => {
@info.ratingChart.ifTrue(!u.lame || ctx.is(u) || isGranted(_.UserSpy)).map { ratingChart =>
@base.spinner()
}.getOrElse { @if(ctx.is(u)) { @newPlayer(u) } } @defining(u.profileOrDefault) { profile =>
@if(!ctx.is(u)) { @if(u.engine) {
@trans.thisPlayerUsesChessComputerAssistance()
} @if(u.booster) {
@trans.thisPlayerArtificiallyIncreasesTheirRating()
} } else { @u.title.flatMap(lila.user.User.titlesMap.get).map { title =>

@title

} } @NotForKids { @profile.nonEmptyRealName.map { name => @name } @profile.nonEmptyBio.ifTrue(!u.troll || ctx.is(u)).map { bio =>

@richText(shorten(bio, 400), nl2br=false)

} }
@profile.officialRating.map { r =>
@r.name.toUpperCase rating: @r.rating
} @NotForKids { @profile.nonEmptyLocation.map { l => @l, } } @profile.countryInfo.map { c => @c.name }

@trans.memberSince() @showDate(u.createdAt)

@u.seenAt.map { seen =>

@trans.lastSeenActive(momentFromNow(seen))

} @info.completionRatePercent.map { c =>

@trans.gameCompletionRate(s"$c%")

} @if(ctx is u) { @trans.profileCompletion(s"${profile.completionPercent}%")
@trans.favoriteOpponents() } @info.playTime.map { playTime =>

@trans.tpTimeSpentPlaying(showPeriod(playTime.totalPeriod))

@playTime.nonEmptyTvPeriod.map { tvPeriod =>

@trans.tpTimeSpentOnTV(showPeriod(tvPeriod))

} }
@info.teamIds.sorted.map { t => @teamLink(t, withIcon = false) }
} @if(info.insightVisible) { Chess Insights Analytics from @if(ctx.is(u)){your}else{@u.username's} games }
} }
@trans.activity.activity() @defining(lila.app.mashup.GameFilter.All) { f => @trans.nbGames.plural(info.user.count.game, info.user.count.game.localize) @if(info.nbs.playing > 0) { @info.nbs.playing } }