lichess donor trophy
parent
ffadda24a6
commit
c090851de6
|
@ -10,7 +10,7 @@ import lila.forum.PostApi
|
|||
import lila.game.{ GameRepo, Game, Crosstable, PlayTime }
|
||||
import lila.relation.RelationApi
|
||||
import lila.security.Granter
|
||||
import lila.user.{ User, Trophies, TrophyApi }
|
||||
import lila.user.{ User, Trophy, Trophies, TrophyApi }
|
||||
|
||||
case class UserInfo(
|
||||
user: User,
|
||||
|
@ -35,6 +35,13 @@ case class UserInfo(
|
|||
def nbWithMe = crosstable ?? (_.nbGames)
|
||||
|
||||
def percentRated: Int = math.round(nbRated / user.count.game.toFloat * 100)
|
||||
|
||||
def allTrophies = (donor ?? List(Trophy(
|
||||
_id = "",
|
||||
user = user.id,
|
||||
kind = Trophy.Kind.Donor,
|
||||
date = org.joda.time.DateTime.now)
|
||||
)) ::: trophies
|
||||
}
|
||||
|
||||
object UserInfo {
|
||||
|
|
|
@ -72,6 +72,20 @@ openGraph = Map(
|
|||
'description -> describeUser(u))) {
|
||||
<div class="content_box no_padding user_show">
|
||||
<div class="content_box_top">
|
||||
@info.allTrophies.map { trophy =>
|
||||
<a @trophy.kind.url.map { url =>
|
||||
href="@url"
|
||||
} class="trophy award @trophy.kind.key @trophy.kind.klass hint--left" data-hint="@trophy.kind.name">
|
||||
@trophy.kind match {
|
||||
case lila.user.Trophy.Kind.ZugMiracle => {
|
||||
<img src="@staticUrl("images/trophy/zug-trophy.png")" height=80 />
|
||||
}
|
||||
case _ => {
|
||||
<span data-icon="@trophy.kind.icon.map(Html.apply)"></span>
|
||||
}
|
||||
}
|
||||
</a>
|
||||
}
|
||||
@if(!u.lame) {
|
||||
@info.ranks.map {
|
||||
case (perf, rank) if rank == 1 => {
|
||||
|
@ -97,20 +111,6 @@ openGraph = Map(
|
|||
case _ => {}
|
||||
}
|
||||
}
|
||||
@info.trophies.map { trophy =>
|
||||
<a @trophy.kind.url.map { url =>
|
||||
href="@url"
|
||||
} class="trophy award @trophy.kind.key @trophy.kind.klass hint--left" data-hint="@trophy.kind.name">
|
||||
@trophy.kind match {
|
||||
case lila.user.Trophy.Kind.ZugMiracle => {
|
||||
<img src="@staticUrl("images/trophy/zug-trophy.png")" height=80 />
|
||||
}
|
||||
case _ => {
|
||||
<span data-icon="@trophy.kind.icon.map(Html.apply)"></span>
|
||||
}
|
||||
}
|
||||
</a>
|
||||
}
|
||||
<h1 class="lichess_title"><span@if(isOnline(u.id)) { class="connected" title="Online" } else { title="Offline" } data-icon="r"></span> @u.titleUsername</h1>
|
||||
@if(u.disabled) {
|
||||
<span class="staff">CLOSED</span>
|
||||
|
@ -203,9 +203,6 @@ openGraph = Map(
|
|||
<p data-icon="E" class="honorific title"> @title</p>
|
||||
}
|
||||
}
|
||||
@if(info.donor) {
|
||||
<a href="@routes.Donation.index" data-icon="t" class="honorific is-gold"> Lichess Donor</a>
|
||||
}
|
||||
@u.profile.map { p =>
|
||||
@NotForKids {
|
||||
@p.nonEmptyRealName.map { name =>
|
||||
|
|
|
@ -20,10 +20,8 @@ private[round] final class History(
|
|||
load: Fu[VersionedEvents],
|
||||
persist: VersionedEvents => Unit) {
|
||||
|
||||
// private var version = 0
|
||||
private var events: VersionedEvents = _
|
||||
|
||||
// TODO optimize
|
||||
def getVersion: Int = {
|
||||
waitForLoadedEvents
|
||||
events.headOption.??(_.version)
|
||||
|
|
|
@ -82,6 +82,13 @@ object Trophy {
|
|||
url = "http://lichess.org/report".some,
|
||||
"icon3d".some)
|
||||
|
||||
object Donor extends Kind(
|
||||
key = "donor",
|
||||
name = "Lichess donor",
|
||||
icon = "".some,
|
||||
url = "http://lichess.org/donate".some,
|
||||
"icon3d".some)
|
||||
|
||||
val all = List(
|
||||
ZugMiracle,
|
||||
WayOfBerserk,
|
||||
|
|
|
@ -515,6 +515,9 @@ body.dark .variant_icons span {
|
|||
0px 0px 10px #000,
|
||||
0px 0px 20px #000;
|
||||
}
|
||||
body.dark div.user_show .trophy.donor span:hover {
|
||||
color: rgba(255,255,255,0.7);
|
||||
}
|
||||
body.dark .fire_trophy.wayOfBerserk span {
|
||||
color: rgba(255,255,255,0.5);
|
||||
}
|
||||
|
|
|
@ -83,6 +83,19 @@ div.user_show .fire_trophy.bongcloudWarrior {
|
|||
filter: hue-rotate(70deg);
|
||||
-webkit-filter: hue-rotate(70deg);
|
||||
}
|
||||
div.user_show .trophy.donor span {
|
||||
color: #d59120;
|
||||
transition: 0.5s;
|
||||
}
|
||||
div.user_show .trophy.donor:hover {
|
||||
margin-top: -14px!important;
|
||||
}
|
||||
div.user_show .trophy.donor span:hover {
|
||||
animation: fire 1.25s ease-in-out infinite alternate;
|
||||
-moz-animation: fire 1.25s ease-in-out infinite alternate;
|
||||
-webkit-animation: fire 1.25s ease-in-out infinite alternate;
|
||||
-o-animation: fire 1.25s ease-in-out infinite alternate;
|
||||
}
|
||||
div.user_show .honorific {
|
||||
display: inline-block;
|
||||
margin-top: 1em;
|
||||
|
|
Loading…
Reference in New Issue