diff --git a/app/views/YesNoPageView.scala.html b/app/views/YesNoPageView.scala.html
index 3d0f14ba5..5faa2675f 100644
--- a/app/views/YesNoPageView.scala.html
+++ b/app/views/YesNoPageView.scala.html
@@ -36,7 +36,7 @@
@govukErrorSummary(ErrorSummaryViewModel(form))
}
- @if(viewModel.page.legend.nonEmpty) {
+ @if(viewModel.page.legend.nonEmpty || viewModel.description.nonEmpty) {
@renderMessage(viewModel.heading)
}
@@ -46,18 +46,33 @@ @renderMessage(viewModel.heading)
@govukDetails(DetailsViewModel(renderMessage(detail.title), renderMessage(detail.contents)))
}
- @govukRadios(
- RadiosViewModel.yesNo(
- field = form("value"),
- legend = viewModel.page.legend
- .map(legend => Some(LegendViewModel(renderMessage(legend))
- .withSize(LegendSize.Medium)))
- .getOrElse(Some(LegendViewModel(renderMessage(viewModel.heading))
- .asPageHeading(LegendSize.Large))),
- yes = viewModel.page.yes.map(renderMessage(_)),
- no = viewModel.page.no.map(renderMessage(_))
- )
- )
+ @if(viewModel.description.isEmpty) {
+ @govukRadios(
+ RadiosViewModel.yesNo(
+ field = form("value"),
+ legend = viewModel.page.legend
+ .map(legend => Some(LegendViewModel(renderMessage(legend))
+ .withSize(LegendSize.Medium)))
+ .getOrElse(Some(LegendViewModel(renderMessage(viewModel.heading))
+ .asPageHeading(LegendSize.Large))),
+ yes = viewModel.page.yes.map(renderMessage(_)),
+ no = viewModel.page.no.map(renderMessage(_))
+ )
+ )
+ } else {
+ @govukRadios(
+ RadiosViewModel.yesNo(
+ field = form("value"),
+ legend = viewModel.page.legend
+ .map(legend => Some(LegendViewModel(renderMessage(legend))
+ .withSize(LegendSize.Medium)))
+ .getOrElse(Some(LegendViewModel(renderMessage(viewModel.heading))
+ .withCssClass("govuk-visually-hidden"))),
+ yes = viewModel.page.yes.map(renderMessage(_)),
+ no = viewModel.page.no.map(renderMessage(_))
+ )
+ )
+ }
@viewModel.page.details.map { detail =>
@govukDetails(DetailsViewModel(renderMessage(detail.title), renderMessage(detail.contents)))