@@ -42,82 +42,106 @@ def call
42
42
end
43
43
end
44
44
45
- if @vaccine . present ?
45
+ if @vaccination_record . administered ?
46
46
summary_list . with_row do |row |
47
47
row . with_key { "Vaccine" }
48
- row . with_value { vaccine_value }
49
-
50
- if ( href = @change_links [ :vaccine ] )
51
- row . with_action (
52
- text : "Change" ,
53
- visually_hidden_text : "vaccine" ,
54
- href :
55
- )
48
+
49
+ if @vaccine
50
+ row . with_value { vaccine_value }
51
+
52
+ if ( href = @change_links [ :vaccine ] )
53
+ row . with_action (
54
+ text : "Change" ,
55
+ visually_hidden_text : "vaccine" ,
56
+ href :
57
+ )
58
+ end
59
+ elsif ( href = @change_links [ :vaccine ] )
60
+ row . with_value { link_to "Add vaccine" , href }
61
+ else
62
+ row . with_value { "Not provided" }
56
63
end
57
64
end
58
- end
59
65
60
- if @batch . present?
61
66
summary_list . with_row do |row |
62
67
row . with_key { "Batch ID" }
63
- row . with_value ( classes : [ "app-u-monospace" ] ) { batch_id_value }
64
-
65
- if ( href = @change_links [ :batch ] )
66
- row . with_action (
67
- text : "Change" ,
68
- href :,
69
- visually_hidden_text : "batch"
70
- )
68
+
69
+ if @batch
70
+ row . with_value ( classes : [ "app-u-monospace" ] ) { batch_id_value }
71
+
72
+ if ( href = @change_links [ :batch ] )
73
+ row . with_action (
74
+ text : "Change" ,
75
+ href :,
76
+ visually_hidden_text : "batch"
77
+ )
78
+ end
79
+ elsif ( href = @change_links [ :batch ] )
80
+ row . with_value { link_to "Add batch" , href }
81
+ else
82
+ row . with_value { "Not provided" }
71
83
end
72
84
end
73
85
74
- summary_list . with_row do |row |
75
- row . with_key { "Batch expiry date" }
76
- row . with_value { batch_expiry_value }
86
+ if @batch
87
+ summary_list . with_row do |row |
88
+ row . with_key { "Batch expiry date" }
89
+ row . with_value { batch_expiry_value }
90
+ end
77
91
end
78
- end
79
92
80
- if @vaccination_record . delivery_method . present?
81
93
summary_list . with_row do |row |
82
94
row . with_key { "Method" }
83
- row . with_value { delivery_method_value }
84
-
85
- if ( href = @change_links [ :delivery_method ] )
86
- row . with_action (
87
- text : "Change" ,
88
- href :,
89
- visually_hidden_text : "method"
90
- )
95
+
96
+ if @vaccination_record . delivery_method . present?
97
+ row . with_value { delivery_method_value }
98
+
99
+ if ( href = @change_links [ :delivery_method ] )
100
+ row . with_action (
101
+ text : "Change" ,
102
+ href :,
103
+ visually_hidden_text : "method"
104
+ )
105
+ end
106
+ elsif ( href = @change_links [ :delivery_method ] )
107
+ row . with_value { link_to "Add method" , href }
108
+ else
109
+ row . with_value { "Not provided" }
91
110
end
92
111
end
93
- end
94
112
95
- if @vaccination_record . delivery_site . present?
96
113
summary_list . with_row do |row |
97
114
row . with_key { "Site" }
98
- row . with_value { delivery_site_value }
99
-
100
- if ( href = @change_links [ :delivery_site ] )
101
- row . with_action (
102
- text : "Change" ,
103
- href :,
104
- visually_hidden_text : "method"
105
- )
115
+
116
+ if @vaccination_record . delivery_site . present?
117
+ row . with_value { delivery_site_value }
118
+
119
+ if ( href = @change_links [ :delivery_site ] )
120
+ row . with_action (
121
+ text : "Change" ,
122
+ href :,
123
+ visually_hidden_text : "method"
124
+ )
125
+ end
126
+ elsif ( href = @change_links [ :delivery_site ] )
127
+ row . with_value { link_to "Add site" , href }
128
+ else
129
+ row . with_value { "Not provided" }
106
130
end
107
131
end
108
132
end
109
133
110
- if @vaccine . present ?
134
+ if @vaccination_record . administered ?
111
135
summary_list . with_row do |row |
112
136
row . with_key { "Dose volume" }
113
137
row . with_value { dose_volume_value }
114
138
end
115
- end
116
139
117
- if dose_number . present?
118
- summary_list . with_row do |row |
119
- row . with_key { "Dose number" }
120
- row . with_value { dose_number_value }
140
+ if dose_number . present?
141
+ summary_list . with_row do |row |
142
+ row . with_key { "Dose number" }
143
+ row . with_value { dose_number_value }
144
+ end
121
145
end
122
146
end
123
147
0 commit comments