diff --git a/app/views/branded/phases/_guidances_notes.html.erb b/app/views/branded/phases/_guidances_notes.html.erb new file mode 100644 index 0000000..e5cac31 --- /dev/null +++ b/app/views/branded/phases/_guidances_notes.html.erb @@ -0,0 +1,95 @@ +<%# locals: { plan, template, question, answer, question_guidance, guidance_groups } %> +<% annotations = question.annotations.where(type: Annotation.types[:guidance]) %> +<% guidance_set = question_guidance[question.id] || {} %> +<% guidances_active = (annotations.present? || guidance_set.length > 0) %> +
+ + +
+
+ +
+ <% if annotations.present? %> +
+
+
+ + <% num_annotations = 0 %> + <% i = 0 %> + <% annotations.each do |annotation| %> + <%= render partial: 'org_admin/annotations/show', + locals: { + template: template, + example_answer: (annotation.example_answer? ? annotation : nil), + guidance: (annotation.guidance? ? annotation : nil), + for_plan: true + } %> + <% num_annotations += 1%> + <% i += 1 %> + <% end %> +
+
+
+ <% end %> + <% guidance_accordion_id = 0 %> + <% guidance_set.keys.each_with_index do |group, i| %> + <% obj = guidance_groups.select{ |gg| gg.name == group }.first %> + <% if obj.present? %> + <% accordion_id = "#{question.id}-#{obj.id}" %> +
+
+
+ <%= render partial: 'guidance_groups/show', + locals: { group: guidance_set[group], question: question, guidance_accordion_id: "#{accordion_id}-#{i}" } %> +
+
+
+ <% end %> + <% end %> +
+
+ + <% if plan.present? %> +
+ <%= render partial: '/notes/layout', locals: { plan: plan, question: question, answer: answer } %> +
+ <% end %> +
+
\ No newline at end of file