@file:Suppress("ktlint") package gg.jte.generated.ondemand.partials import at.dokkae.homepage.templates.MessageTemplate import java.time.Instant import java.time.ZoneId import java.time.format.DateTimeFormatter import kotlin.math.absoluteValue @Suppress("UNCHECKED_CAST", "UNUSED_PARAMETER") class JteMessageGenerated { companion object { @JvmField val JTE_NAME = "partials/Message.kte" @JvmField val JTE_LINE_INFO = intArrayOf(0,0,0,1,2,3,4,6,6,6,6,6,8,8,8,9,9,10,10,14,15,15,15,15,18,21,21,21,24,24,24,24,24,24,28,30,30,30,34,34,34,6,6,6,6,6) @JvmStatic fun render(jteOutput:gg.jte.html.HtmlTemplateOutput, jteHtmlInterceptor:gg.jte.html.HtmlInterceptor?, model:MessageTemplate) { jteOutput.writeContent("\n") val dateFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy").withZone(ZoneId.systemDefault()) jteOutput.writeContent("\n") val timeFormatter: DateTimeFormatter = DateTimeFormatter.ofPattern("HH:mm").withZone(ZoneId.systemDefault()) jteOutput.writeContent("\n") val borderColors = listOf("red", "orange", "yellow", "green", "blue", "pink" ) jteOutput.writeContent("\n\n
\n
\n ") jteOutput.writeContent("\n
\n\n
\n ") jteOutput.writeContent("\n
\n \n ") jteOutput.setContext("span", null) jteOutput.writeUserContent(model.message.author) jteOutput.writeContent("\n \n \n ") jteOutput.setContext("span", null) jteOutput.writeUserContent(dateFormatter.format(model.message.createdAt)) jteOutput.writeContent(" • ") jteOutput.setContext("span", null) jteOutput.writeUserContent(timeFormatter.format(model.message.createdAt)) jteOutput.writeContent("\n \n
\n\n ") jteOutput.writeContent("\n
\n ") jteOutput.setContext("div", null) jteOutput.writeUserContent(model.message.content) jteOutput.writeContent("\n
\n
\n
\n
") } @JvmStatic fun renderMap(jteOutput:gg.jte.html.HtmlTemplateOutput, jteHtmlInterceptor:gg.jte.html.HtmlInterceptor?, params:Map) { val model = params["model"] as MessageTemplate render(jteOutput, jteHtmlInterceptor, model); } } }