diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index fe231d1..3a20fa0 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,6 +3,7 @@ class HomeController < ApplicationController if user_signed_in? if current_user.admin? @file = YAML.load_file(Rails.root.to_s + '/config/caf_text.yml') + @objectives = @file["objectives"] else end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index e4d77a8..2c060b4 100644 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -28,9 +28,17 @@ Not Signed in. <%= link_to "Add User" %>

- <% @file["objectives"].each do |key, value| %> -

<%= key%>:<%=value%>

- <% end %> + + <% @objectives.each do |objective| %> + <% objective_info = objective["objective"] %> +

<%= objective_info["name"] %>
<%= objective_info["description"] %>

+ <% principles = objective_info["principles"] %> + <% principles.each do |principle| %> + <% principle_info = principle["principle"] %> +

<%= principle_info["name"] %>
<%= principle_info["description"]%>

+ <% end %> + <% end %> + <% end %> <% if current_user.user? %> diff --git a/config/caf_text.yml b/config/caf_text.yml index 368e098..992357b 100644 --- a/config/caf_text.yml +++ b/config/caf_text.yml @@ -130,8 +130,11 @@ objectives: - Security deficiencies uncovered by assurance activities are assessed, prioritised and remedied when necessary in a timely and effective way. - The methods used for assurance are reviewed to ensure they are working as intended and remain the most appropriate method to use. - - objective: Objective B - Protecting against cyber attack - - - objective: Objective C - Detecting cyber security events - - - objective: Objective D - Minimising the impact of cyber security incidents + # - objective: + # name: Objective B - Protecting against cyber attack + # + # - objective: + # name: Objective C - Detecting cyber security events + # + # - objective: + # name: Objective D - Minimising the impact of cyber security incidents