lila/app/templating/TeamHelper.scala
Andrew Mazur e4db7c25e6
Icons private use area (#9136)
* move all glyphs to private area

* replace exclamation mark icon

* replace quotation mark icon

* replace rapid icon

* replace share icon

* replace patron icon

* replace gear icon

* replace phone icon

* replace streak icon

* replace die-six and ograve icons

* replace flag icon

* replace flame icon

* replace feather icon

* replace turtle icon

* replace nuclear icon

* replace arrow-streamline-target icon

* replace buffer icon

* replace upload-cloud icon

* replace number and some special characters icons

* replace upper case alphabet characters icons

* replace alphabet characters icons and a few special characters icons

* fixing some missing icons

* notifications icons fix

* a few more icons found

* changing a few more icons
2021-06-14 09:13:27 +02:00

30 lines
777 B
Scala

package lila.app
package templating
import scalatags.Text.all.Tag
import controllers.routes
import lila.api.Context
import lila.app.ui.ScalatagsTemplate._
trait TeamHelper { self: HasEnv =>
def myTeam(teamId: String)(implicit ctx: Context): Boolean =
ctx.userId.?? { env.team.api.syncBelongsTo(teamId, _) }
def teamIdToName(id: String): String = env.team.getTeamName(id).getOrElse(id)
def teamLink(id: String, withIcon: Boolean = true): Tag =
teamLink(id, teamIdToName(id), withIcon)
def teamLink(id: String, name: Frag, withIcon: Boolean): Tag =
a(
href := routes.Team.show(id),
dataIcon := withIcon.option(""),
cls := withIcon option "text"
)(name)
def teamForumUrl(id: String) = routes.ForumCateg.show("team-" + id)
}