|
15 | 15 | *@ |
16 | 16 |
|
17 | 17 | @import uk.gov.hmrc.agentregistration.shared.AgentApplication |
| 18 | +@import uk.gov.hmrc.agentregistration.shared.AgentApplicationLimitedCompany |
| 19 | +@import uk.gov.hmrc.agentregistration.shared.AgentApplicationLimitedPartnership |
| 20 | +@import uk.gov.hmrc.agentregistration.shared.AgentApplicationLlp |
| 21 | +@import uk.gov.hmrc.agentregistration.shared.AgentApplicationScottishLimitedPartnership |
18 | 22 | @import uk.gov.hmrc.agentregistrationfrontend.views.html.applicant.partials.ContinueOrSaveForLaterLinks |
19 | 23 | @import uk.gov.hmrc.agentregistrationfrontend.views.html.Layout |
20 | 24 | @import uk.gov.hmrc.govukfrontend.views.html.components.* |
|
39 | 43 | "listDetailsCheckYourAnswers" |
40 | 44 | } |
41 | 45 |
|
| 46 | +@businessTypeKey = @{ |
| 47 | + agentApplication match { |
| 48 | + case _: AgentApplicationLlp => "LimitedLiabilityPartnership" |
| 49 | + case _: AgentApplicationLimitedCompany => "LimitedCompany" |
| 50 | + case _: AgentApplicationLimitedPartnership => "LimitedPartnership" |
| 51 | + case _: AgentApplicationScottishLimitedPartnership => "ScottishLimitedPartnership" |
| 52 | + case _ => "Partnership" |
| 53 | + } |
| 54 | +} |
| 55 | + |
| 56 | +@isIncorporated = @{ |
| 57 | + agentApplication match { |
| 58 | + case _: AgentApplicationLlp | _: AgentApplicationLimitedCompany | _: AgentApplicationLimitedPartnership | _: AgentApplicationScottishLimitedPartnership => true |
| 59 | + case _ => false |
| 60 | + } |
| 61 | +} |
| 62 | + |
42 | 63 | @title = @{ |
43 | 64 | messages(s"$key.title") |
44 | 65 | } |
| 66 | + |
| 67 | +@changeNumberHref = @{ |
| 68 | + if (isIncorporated) AppRoutes.apply.listdetails.incoporated.CompaniesHouseOfficersController.show.url |
| 69 | + else AppRoutes.apply.listdetails.nonincorporated.NumberOfKeyIndividualsController.show.url |
| 70 | +} |
| 71 | + |
| 72 | +@changeNamesHref = @{ |
| 73 | + if (isIncorporated) AppRoutes.apply.listdetails.incoporated.CheckYourAnswersController.show.url |
| 74 | + else AppRoutes.apply.listdetails.nonincorporated.CheckYourAnswersController.show.url |
| 75 | +} |
| 76 | + |
45 | 77 | @keyNumberRow = @{ |
46 | 78 | Seq( |
47 | 79 | SummaryListRow( |
48 | | - key = Key(content = Text(messages(s"$key.numberOfPartners.label"))), |
| 80 | + key = Key(content = Text(messages(s"$key.numberOfPartners.$businessTypeKey.label"))), |
49 | 81 | value = Value(content = Text(nonIncorporatedIndividualsList.size.toString)), |
50 | 82 | actions = Some(Actions(items = Seq( |
51 | 83 | ActionItem( |
52 | | - href = AppRoutes.apply.listdetails.nonincorporated.NumberOfKeyIndividualsController.show.url, |
| 84 | + href = changeNumberHref, |
53 | 85 | content = Text(messages("common.change")), |
54 | | - visuallyHiddenText = Some(messages(s"$key.numberOfPartners.label")) |
| 86 | + visuallyHiddenText = Some(messages(s"$key.numberOfPartners.$businessTypeKey.label")) |
55 | 87 | ) |
56 | 88 | ))) |
57 | 89 | ) |
58 | | - ) |
| 90 | + ) |
59 | 91 | } |
60 | 92 | @keyNamesList = { |
61 | 93 | <ul class="govuk-list"> |
62 | 94 | @{nonIncorporatedIndividualsList.map { partner => <li>{partner.individualName.value}</li>}} |
63 | 95 | </ul> |
64 | 96 | } |
65 | 97 | @keyNamesRow = @{ |
66 | | - if (nonIncorporatedIndividualsList.nonEmpty) |
67 | | - Seq( |
68 | | - SummaryListRow( |
69 | | - key = Key(content = Text(messages(s"$key.partnerNames.label"))), |
70 | | - value = Value(content = HtmlContent(keyNamesList)), |
71 | | - actions = Some(Actions(items = Seq( |
72 | | - ActionItem( |
73 | | - href = AppRoutes.apply.listdetails.nonincorporated.CheckYourAnswersController.show.url, |
74 | | - content = Text(messages("common.change")), |
75 | | - visuallyHiddenText = Some(messages(s"$key.partnerNames.label")) |
76 | | - ) |
77 | | - ))) |
| 98 | + if (nonIncorporatedIndividualsList.nonEmpty) |
| 99 | + Seq( |
| 100 | + SummaryListRow( |
| 101 | + key = Key(content = Text(messages(s"$key.partnerNames.$businessTypeKey.label"))), |
| 102 | + value = Value(content = HtmlContent(keyNamesList)), |
| 103 | + actions = Some(Actions(items = Seq( |
| 104 | + ActionItem( |
| 105 | + href = changeNamesHref, |
| 106 | + content = Text(messages("common.change")), |
| 107 | + visuallyHiddenText = Some(messages(s"$key.partnerNames.$businessTypeKey.label")) |
| 108 | + ) |
| 109 | + ))) |
| 110 | + ) |
78 | 111 | ) |
79 | | - ) |
80 | | - else Seq.empty |
| 112 | + else Seq.empty |
81 | 113 | } |
82 | 114 | @otherNamesList = { |
83 | 115 | <ul class="govuk-list"> |
84 | | - @{otherRelevantIndividualsList.map { individual => <li>{individual.individualName.value}</li>}} |
| 116 | + @{otherRelevantIndividualsList.map { individual => <li>{individual.individualName.value}</li>}} |
85 | 117 | </ul> |
86 | 118 | } |
87 | 119 | @hasOthersRow = @{ |
88 | | - Seq( |
89 | | - SummaryListRow( |
90 | | - key = Key(content = Text(messages(s"$key.hasOtherRelevantIndividuals.label"))), |
91 | | - value = Value(content = Text(agentApplication.hasOtherRelevantIndividuals match { |
92 | | - case Some(true) => messages("common.yes") |
93 | | - case Some(false) => messages("common.no") |
94 | | - case None => "" |
95 | | - })), |
96 | | - actions = Some(Actions(items = Seq( |
97 | | - ActionItem( |
98 | | - href = AppRoutes.apply.listdetails.otherrelevantindividuals.ConfirmOtherRelevantIndividualsController.show.url, |
99 | | - content = Text(messages("common.change")), |
100 | | - visuallyHiddenText = Some(messages(s"$key.hasOtherRelevantIndividuals.label")) |
101 | | - ) |
102 | | - ))) |
103 | | - ) |
104 | | - ) |
105 | | -} |
106 | | -@otherNamesRow = @{ |
107 | | - if (agentApplication.hasOtherRelevantIndividuals.contains(true) && otherRelevantIndividualsList.nonEmpty) |
108 | 120 | Seq( |
109 | 121 | SummaryListRow( |
110 | | - key = Key(content = Text(messages(s"$key.otherRelevantIndividualsNames.label"))), |
111 | | - value = Value(content = HtmlContent(otherNamesList)), |
| 122 | + key = Key(content = Text(messages(s"$key.hasOtherRelevantIndividuals.label"))), |
| 123 | + value = Value(content = Text(agentApplication.hasOtherRelevantIndividuals match { |
| 124 | + case Some(true) => messages("common.yes") |
| 125 | + case Some(false) => messages("common.no") |
| 126 | + case None => "" |
| 127 | + })), |
112 | 128 | actions = Some(Actions(items = Seq( |
113 | 129 | ActionItem( |
114 | | - href = AppRoutes.apply.listdetails.otherrelevantindividuals.CheckYourAnswersController.show.url, |
| 130 | + href = AppRoutes.apply.listdetails.otherrelevantindividuals.ConfirmOtherRelevantIndividualsController.show.url, |
115 | 131 | content = Text(messages("common.change")), |
116 | | - visuallyHiddenText = Some(messages(s"$key.otherRelevantIndividualsNames.label")) |
| 132 | + visuallyHiddenText = Some(messages(s"$key.hasOtherRelevantIndividuals.label")) |
117 | 133 | ) |
118 | 134 | ))) |
119 | 135 | ) |
120 | 136 | ) |
121 | | - else Seq.empty |
| 137 | +} |
| 138 | +@otherNamesRow = @{ |
| 139 | + if (agentApplication.hasOtherRelevantIndividuals.contains(true) && otherRelevantIndividualsList.nonEmpty) |
| 140 | + Seq( |
| 141 | + SummaryListRow( |
| 142 | + key = Key(content = Text(messages(s"$key.otherRelevantIndividualsNames.label"))), |
| 143 | + value = Value(content = HtmlContent(otherNamesList)), |
| 144 | + actions = Some(Actions(items = Seq( |
| 145 | + ActionItem( |
| 146 | + href = AppRoutes.apply.listdetails.otherrelevantindividuals.CheckYourAnswersController.show.url, |
| 147 | + content = Text(messages("common.change")), |
| 148 | + visuallyHiddenText = Some(messages(s"$key.otherRelevantIndividualsNames.label")) |
| 149 | + ) |
| 150 | + ))) |
| 151 | + ) |
| 152 | + ) |
| 153 | + else Seq.empty |
122 | 154 | } |
123 | 155 |
|
124 | 156 | @rows = @{keyNumberRow ++ keyNamesRow ++ hasOthersRow ++ otherNamesRow} |
125 | 157 |
|
126 | 158 | @layout(pageTitle = title) { |
127 | | - <h2 class="govuk-caption-l">@messages("lists.caption.title.Partnership")</h2> |
| 159 | + <h2 class="govuk-caption-l">@messages(s"lists.caption.title.$businessTypeKey")</h2> |
128 | 160 | <h1 class="govuk-heading-l">@title</h1> |
129 | 161 |
|
130 | 162 | @govukSummaryList( |
131 | 163 | SummaryList(rows = rows) |
132 | 164 | ) |
133 | 165 |
|
134 | 166 | <p class="govuk-body"> |
135 | | - @continueOrSaveForLaterLinks( |
136 | | - continueHref = AppRoutes.apply.TaskListController.show.url, |
137 | | - continueLabel = Some(messages("common.confirmAndContinue")) |
138 | | - ) |
| 167 | + @continueOrSaveForLaterLinks( |
| 168 | + continueHref = AppRoutes.apply.TaskListController.show.url, |
| 169 | + continueLabel = Some(messages("common.confirmAndContinue")) |
| 170 | + ) |
139 | 171 | </p> |
140 | 172 | } |
0 commit comments