@@ -10,17 +10,35 @@ def initialize(consent, change_links: {})
10
10
11
11
def call
12
12
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?
14
24
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 ) }
27
+ end
28
+ end
29
+
30
+ summary_list . with_row do |row |
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 :)
17
35
end
18
36
end
19
37
20
38
summary_list . with_row do |row |
21
39
row . with_key { "Decision" }
22
- row . with_value { helpers . consent_status_tag ( @ consent) }
23
- if ( href = @ change_links[ :response ] )
40
+ row . with_value { helpers . consent_status_tag ( consent ) }
41
+ if ( href = change_links [ :response ] )
24
42
row . with_action (
25
43
text : "Change" ,
26
44
visually_hidden_text : "decision" ,
@@ -29,38 +47,32 @@ def call
29
47
end
30
48
end
31
49
32
- 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 ] )
38
- row . with_action (
39
- text : "Change" ,
40
- visually_hidden_text : "response method" ,
41
- href :
42
- )
50
+ if consent . vaccine_method_nasal?
51
+ summary_list . with_row do |row |
52
+ row . with_key { "Consent also given for injected vaccine?" }
53
+ row . with_value { consent . vaccine_method_injection? ? "Yes" : "No" }
43
54
end
44
55
end
45
56
46
- if @ consent. reason_for_refusal . present?
57
+ if consent . reason_for_refusal . present?
47
58
summary_list . with_row do |row |
48
59
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
60
+ row . with_value { consent . human_enum_name ( :reason_for_refusal ) }
55
61
end
56
62
end
57
63
58
- if @ consent. notes . present?
64
+ if consent . notes . present?
59
65
summary_list . with_row do |row |
60
66
row . with_key { "Notes" }
61
- row . with_value { @ consent. notes }
67
+ row . with_value { consent . notes }
62
68
end
63
69
end
64
70
end
65
71
end
72
+
73
+ private
74
+
75
+ attr_reader :consent , :change_links
76
+
77
+ delegate :programme , to : :consent
66
78
end
0 commit comments