| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0e6d28b commit cb87318
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,10 +1,18 @@ | |||
| 1 | 1 | @import com.gu.identity.model.Consent | |
| 2 | + @import com.gu.identity.model.ConsentWording | ||
| 2 | 3 | @import _root_.form.IdFormHelpers.nonInputFields | |
| 3 | 4 | @import views.support.fragment.Switch._ | |
| 4 | 5 | ||
| 5 | 6 | @* Product consent switch/checkbox *@ | |
| 6 | 7 | ||
| 7 | - @(consentField: Field, highlighted: Boolean = false, skin: Option[String] = None, boldTitle: Boolean = true)(messages: play.api.i18n.Messages) | ||
| 8 | + @( | ||
| 9 | + consentField: Field, | ||
| 10 | + highlighted: Boolean = false, | ||
| 11 | + skin: Option[String] = None, | ||
| 12 | + boldTitle: Boolean = true, | ||
| 13 | + titleProvider: ConsentWording => String = w => w.wording, | ||
| 14 | + descriptionProvider: ConsentWording => Option[String] = w => w.description | ||
| 15 | + )(messages: play.api.i18n.Messages) | ||
| 8 | 16 | ||
| 9 | 17 | @getConsentText(consentField: Field) = @{ | |
| 10 | 18 | Consent.wording( | |
@@ -19,9 +27,9 @@ | |||
| 19 | 27 | } | |
| 20 | 28 | ||
| 21 | 29 | @fragments.form.switch( | |
| 22 | - title = getConsentText(consentField).wording, | ||
| 30 | + title = titleProvider(getConsentText(consentField)), | ||
| 23 | 31 | subheading = None, | |
| 24 | - description = getConsentText(consentField).description, | ||
| 32 | + description = descriptionProvider(getConsentText(consentField)), | ||
| 25 | 33 | behaviour = ConsentSwitch, | |
| 26 | 34 | field = consentField("consented"), | |
| 27 | 35 | extraFields = consentHiddenFormFields, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,12 @@ | |||
| 19 | 19 | @helper.repeatWithIndex(privacyForm("consents"), min=1){ (consentField, index) => | |
| 20 | 20 | @if(isOptOutChannel(consentField, user)) { | |
| 21 | 21 | <li> | |
| 22 | - @fragments.consentSwitch(consentField, boldTitle = false)(messages) | ||
| 22 | + @fragments.consentSwitch( | ||
| 23 | + consentField, | ||
| 24 | + boldTitle = false, | ||
| 25 | + titleProvider = wording => wording.description.getOrElse(""), | ||
| 26 | + descriptionProvider = _ => None | ||
| 27 | + )(messages) | ||
| 23 | 28 | </li> | |
| 24 | 29 | } | |
| 25 | 30 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ package com.gu | |||
| 3 | 3 | import sbt._ | |
| 4 | 4 | ||
| 5 | 5 | object Dependencies { | |
| 6 | - val identityLibVersion = "3.139" | ||
| 6 | + val identityLibVersion = "3.141" | ||
| 7 | 7 | val awsVersion = "1.11.240" | |
| 8 | 8 | val capiVersion = "12.0" | |
| 9 | 9 | val faciaVersion = "2.6.0" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments