@@ -10,57 +10,74 @@ def initialize(consent, change_links: {})
1010
1111 def call
1212 govuk_summary_list ( actions : @change_links . present? ) do |summary_list |
13- if @consent . responded_at . present?
13+ summary_list . with_row do |row |
14+ row . with_key { "Programme" }
15+ row . with_value do
16+ tag . strong (
17+ programme . name ,
18+ class : "nhsuk-tag app-tag--attached nhsuk-tag--white"
19+ )
20+ end
21+ end
22+
23+ if consent . responded_at . present?
1424 summary_list . with_row do |row |
15- row . with_key { "Response date " }
16- row . with_value { @ consent. responded_at . to_fs ( :long ) }
25+ row . with_key { "Date " }
26+ row . with_value { consent . responded_at . to_fs ( :long ) }
1727 end
1828 end
1929
2030 summary_list . with_row do |row |
21- row . with_key { "Decision" }
22- row . with_value { helpers . consent_status_tag ( @consent ) }
23- if ( href = @change_links [ :response ] )
24- row . with_action (
25- text : "Change" ,
26- visually_hidden_text : "decision" ,
27- href :
28- )
31+ row . with_key { "Method" }
32+ row . with_value { consent . human_enum_name ( :route ) . humanize }
33+ if ( href = change_links [ :route ] )
34+ row . with_action ( text : "Change" , visually_hidden_text : "method" , href :)
2935 end
3036 end
3137
3238 summary_list . with_row do |row |
33- row . with_key { "Response method" }
34- row . with_value do
35- Consent . human_enum_name ( :route , @consent . route ) . humanize
36- end
37- if ( href = @change_links [ :route ] )
39+ row . with_key { "Decision" }
40+ row . with_value { helpers . consent_status_tag ( consent ) }
41+ if ( href = change_links [ :response ] )
3842 row . with_action (
3943 text : "Change" ,
40- visually_hidden_text : "response method " ,
44+ visually_hidden_text : "decision " ,
4145 href :
4246 )
4347 end
4448 end
4549
46- if @consent . reason_for_refusal . present?
50+ consent
51+ . vaccine_methods
52+ . drop ( 1 )
53+ . each do |vaccine_method |
54+ method_name = Vaccine . human_enum_name ( :method_prefix , vaccine_method )
55+
56+ summary_list . with_row do |row |
57+ row . with_key { "Consent also given for #{ method_name } vaccine?" }
58+ row . with_value { "Yes" }
59+ end
60+ end
61+
62+ if consent . reason_for_refusal . present?
4763 summary_list . with_row do |row |
4864 row . with_key { "Reason for refusal" }
49- row . with_value do
50- Consent . human_enum_name (
51- :reason_for_refusal ,
52- @consent . reason_for_refusal
53- )
54- end
65+ row . with_value { consent . human_enum_name ( :reason_for_refusal ) }
5566 end
5667 end
5768
58- if @ consent. notes . present?
69+ if consent . notes . present?
5970 summary_list . with_row do |row |
6071 row . with_key { "Notes" }
61- row . with_value { @ consent. notes }
72+ row . with_value { consent . notes }
6273 end
6374 end
6475 end
6576 end
77+
78+ private
79+
80+ attr_reader :consent , :change_links
81+
82+ delegate :programme , to : :consent
6683end
0 commit comments