Back to Frontend

Block.Scala

identity/app/views/consentJourneyFragments/block.scala.html

latest1.0 KB
Original Source

@import conf.Static @import views.support.fragment.ConsentBlock._ @( block: ConsentBlock, isFirst: Boolean = false, isLast: Boolean = false ) @showAgeStep(display: Boolean = false) = @{ if(display){ List(ConsentStepHelpText("By continuing, you confirm that you are older than 13 years or that you have the consent of your parent or a person holding parental responsibility.")) } else { Nil } } @renderHelpText(help: List[ConsentStepHelpTextTrait]) = @{ help.map { case m: ConsentStepHelpLegalText => { Html(s"

${m.text}

") } case m: ConsentStepHelpText => { Html(s"

${m.text}

") } } } @showConsentStep(step: ConsentStep) = {

@step.title

@if(step.help || showAgeStep(display = isFirst)){ @renderHelpText(step.help ++ showAgeStep(display = isFirst)) } @step.content

} @showConsentCustomHtml(info: ConsentCustomHtml) = {

@info.content

} @{block match { case m: ConsentStep => showConsentStep(m) case m: ConsentCustomHtml => showConsentCustomHtml(m) case m: ConsentBanner => Html(s"

${m.title}

") }}