File tree Expand file tree Collapse file tree
NHSUKViewComponents.Web/Views/Shared/Components/ErrorSummary Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11@using NHSUKViewComponents .Web .ViewModels
22@model ErrorSummaryViewModel
33
4- <div class =" nhsuk-error-summary @(Model.Errors.Any() ? " " : " validation-summary-errors validation-summary-valid " )" data-valmsg-summary =" @(Model.Errors.Any() ? " false " : " true " )" aria-labelledby =" error-summary-title" role =" alert" tabindex =" -1" >
5- <h2 class =" nhsuk-error-summary__title" id =" error-summary-title" >
4+ @if (Model .Errors .Any ())
5+ {
6+ <div class =" nhsuk-error-summary" aria-labelledby =" error-summary-title" role =" alert" tabindex =" -1" >
7+ <h2 class =" nhsuk-error-summary__title" id =" error-summary-title" >
68 There is a problem
7- </h2 >
8- <div class =" nhsuk-error-summary__body" >
9+ </h2 >
10+ <div class = " nhsuk-error-summary__body" >
911 < ul class = " nhsuk-list nhsuk-error-summary__list" >
10- @foreach ( var item in Model .Errors )
11- {
12- <li >
13- <a href =" #@item.Key" >@item.ErrorMessage </a >
14- </li >
15- }
12+ @foreach (var item in Model .Errors )
13+ {
14+ < li >
15+ < a href = " #@item.Key" > @item .ErrorMessage < / a >
16+ < / li >
17+ }
1618 < / ul >
19+ < / div >
1720 < / div >
18- </ div >
19-
20-
21- @* <div class="nhsuk-error-summary validation-summary-errors validation-summary-valid" data-valmsg-summary="true" aria-labelledby="error-summary-title" role="alert" tabindex="-1">
21+ }
22+ else
23+ {
24+ <div class =" nhsuk-error-summary validation-summary-errors validation-summary-valid" data-valmsg-summary =" true" aria-labelledby =" error-summary-title" role =" alert" tabindex =" -1" >
2225 <h2 class =" nhsuk-error-summary__title" id =" error-summary-title" >
2326 There is a problem
2427 </h2 >
2730 < / ul >
2831 < / div >
2932 < / div >
30- *@
33+ }
You can’t perform that action at this time.
0 commit comments