diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss
index 630564f6d8..55dfe87edb 100644
--- a/app/assets/stylesheets/application.sass.scss
+++ b/app/assets/stylesheets/application.sass.scss
@@ -5,3 +5,73 @@ $govuk-assets-path: "";
@import "govuk-frontend/dist/govuk/all";
@import "components/all";
@import "accessible-autocomplete/dist/accessible-autocomplete.min";
+
+
+.app-primary-navigation {
+ background-color: govuk-colour("light-grey");
+}
+
+.app-primary-navigation--justify-between {
+ display: flex;
+ justify-content: space-between;
+}
+
+.app-primary-navigation__list {
+ @include govuk-clearfix;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+.app-primary-navigation__item {
+ @include govuk-font($size: 19);
+ float: left;
+ margin-right: govuk-spacing(3);
+ margin-top: 0;
+
+ &:last-child {
+ margin-right: 0;
+ }
+
+ @include govuk-media-query($from: tablet) {
+ margin-right: govuk-spacing(4);
+ }
+}
+
+.app-primary-navigation__item--align-right {
+ @include govuk-media-query($from: tablet) {
+ float: right;
+ }
+}
+
+.app-primary-navigation__link {
+ @include govuk-link-common;
+ @include govuk-link-style-no-visited-state;
+ display: block;
+ font-weight: bold;
+ padding-bottom: govuk-spacing(3);
+ padding-top: govuk-spacing(3);
+ text-decoration: none;
+
+ &:focus {
+ background-color: $govuk-focus-colour;
+ box-shadow: inset 0 -5px 0 0 $govuk-focus-text-colour;
+ color: $govuk-focus-text-colour;
+ outline: $govuk-focus-width solid transparent;
+ }
+
+ &[aria-current] {
+ box-shadow: inset 0 -5px 0 0 $govuk-link-colour;
+ color: $govuk-link-colour;
+
+ &:hover {
+ box-shadow: inset 0 -5px 0 0 $govuk-link-hover-colour;
+ color: $govuk-link-hover-colour;
+ }
+
+ &:focus {
+ box-shadow: inset 0 -7px 0 0 $govuk-focus-text-colour;
+ color: $govuk-focus-text-colour;
+ }
+ }
+}
\ No newline at end of file
diff --git a/app/components/application_component.rb b/app/components/application_component.rb
new file mode 100644
index 0000000000..6eb1b59f12
--- /dev/null
+++ b/app/components/application_component.rb
@@ -0,0 +1,13 @@
+# frozen_string_literal: true
+
+class ApplicationComponent < GovukComponent::Base
+ def initialize(classes: [], html_attributes: {})
+ super(classes:, html_attributes:)
+ end
+
+ private
+
+ def default_attributes
+ {}
+ end
+end
diff --git a/app/components/navigation_bar.html.erb b/app/components/navigation_bar.html.erb
new file mode 100644
index 0000000000..71cc52adee
--- /dev/null
+++ b/app/components/navigation_bar.html.erb
@@ -0,0 +1,22 @@
+
-
-
It works! 🎉
+<%= render(NavigationBar.new(
+ items: navigation_items(@provider),
+ current_path: request.path,
+ current_user: User.first
+ )) %>
+
+
+
+
<%= t("organisation_details") %>
+ <%= govuk_summary_list do |summary_list|
+ summary_list.with_row do |row|
+ row.with_key(text: t("organisation_name"))
+ row.with_value(text: @school.name)
+ end;summary_list.with_row do |row|
+ row.with_key(text: t("uk_provider_reference_number"))
+ row.with_value(text: @school.ukprn)
+ end;summary_list.with_row do |row|
+ row.with_key(text: t("unique_reference_number"))
+ row.with_value(text: @school.urn)
+ end;end %>
-
- Your application is ready - so long as this page rendered without any errors you're good to go.
-
-
- <%= govuk_summary_list(
- rows: [
- { key: { text: "Service" }, value: { text: "Claims" } },
- { key: { text: "Rails version" }, value: { text: Rails.version } },
- { key: { text: "Ruby version" }, value: { text: RUBY_VERSION } },
- {
- key: {
- text: "GOV.UK Frontend",
- },
- value: {
- text: JSON
- .parse(File.read(Rails.root.join("package.json")))
- .dig("dependencies", "govuk-frontend")
- .tr("^", ""),
- },
- },
- ],
- ) %>
-
-
+
Contact details
+ <%= govuk_summary_list do |summary_list|
+ summary_list.with_row do |row|
+ row.with_key(text: t("email_address"))
+ row.with_value do %>
+
contact@example.com
+ <% end;row.with_action(text: t('change'), visually_hidden_text: t("email_address"), href: '/contact-details')
+ end;summary_list.with_row do |row|
+ row.with_key(text: 'Telephone number')
+ row.with_value(text: @school.telephone)
+ row.with_action(text: t('change'), visually_hidden_text: t("email_address"), href: '/contact-details')
+ end;summary_list.with_row do |row|
+ row.with_key(text: 'Website')
+ row.with_value do %>
+
<%= @school.website %>
+ <% end;row.with_action(text: t('change'), visually_hidden_text: t('email_address'), href: '/contact-details')
+ end;summary_list.with_row do |row|
+ row.with_key(text: t('address'))
+ row.with_value do %>
+
+ <%= @school.address1 %>
+ <%= @school.address2 %>
+ <%= @school.address3 %>
+
+ <% end;row.with_action(text: t('change'), visually_hidden_text: t('email_address'), href: '/contact-details')
+ end;end %>
+
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 6f8c519366..77d9131716 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -25,7 +25,9 @@
<%= govuk_skip_link %>
- <%= govuk_header(homepage_url: "https://www.gov.uk", service_name: t(".#{current_service}.header.service_name"), service_url: "/") %>
+ <%= govuk_header(homepage_url: "https://www.gov.uk") do |header| %>
+ <%= header.with_product_name(name: t(".#{current_service}.header.service_name")) %>
+ <% end %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index e18065f51c..707a221ebb 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -55,3 +55,16 @@ en:
placements:
heading: Placements news and updates
contents: Contents
+ navigation_bar:
+ organisation_details: Organisation details
+ users: Users
+ claims: Claims
+ organisation_details: organisation details
+ organisation_name: Organisation name
+ uk_provider_reference_number: UK provider reference number (UKPRN)
+ unique_reference_number: Unique reference number (URN)
+ email_address: email address
+ change: Change
+ address: address
+
+
diff --git a/spec/factories/gias_schools.rb b/spec/factories/gias_schools.rb
index 6fee982692..f887833f46 100644
--- a/spec/factories/gias_schools.rb
+++ b/spec/factories/gias_schools.rb
@@ -24,5 +24,11 @@
factory :gias_school do
sequence(:urn) { _1 }
name { "Hogwarts" }
+ sequence(:ukprn) {|n| "fake_uprn_#{n}" }
+ telephone { "0123456789" }
+ website { "www.hogwarts.com" }
+ address1 { "Hogwarts Castle" }
+ address2 { "Scotland" }
+ address3 { "United Kingdom" }
end
end
diff --git a/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb b/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb
index b8626302bf..aa6ddc93be 100644
--- a/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb
+++ b/spec/features/personas/sign_in_as_a_claims_user_persona_spec.rb
@@ -9,6 +9,7 @@
scenario "I sign in as persona Anne" do
given_there_is_an_existing_claims_persona_for("Anne")
+ and_given_i_have_a_school
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Anne")
when_i_click_sign_in_as("Anne")
@@ -18,6 +19,7 @@
scenario "I sign in as persona Patricia" do
given_there_is_an_existing_claims_persona_for("Patricia")
+ and_given_i_have_a_school
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Patricia")
when_i_click_sign_in_as("Patricia")
@@ -27,6 +29,7 @@
scenario "I sign in as persona Mary" do
given_there_is_an_existing_claims_persona_for("Mary")
+ and_given_i_have_a_school
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Mary")
when_i_click_sign_in_as("Mary")
@@ -36,6 +39,7 @@
scenario "I sign in as persona colin" do
given_there_is_an_existing_claims_persona_for("Colin")
+ and_given_i_have_a_school
when_i_visit_the_claims_personas_page
then_i_see_the_claims_persona_for("Colin")
when_i_click_sign_in_as("Colin")
@@ -50,6 +54,10 @@ def given_there_is_an_existing_claims_persona_for(persona_name)
create(:persona, persona_name.downcase.to_sym, service: "claims")
end
+def and_given_i_have_a_school
+ create(:gias_school)
+end
+
def when_i_visit_the_claims_personas_page
visit personas_path
end
diff --git a/spec/system/claims/pages/home_spec.rb b/spec/system/claims/pages/home_spec.rb
new file mode 100644
index 0000000000..b95f43623d
--- /dev/null
+++ b/spec/system/claims/pages/home_spec.rb
@@ -0,0 +1,46 @@
+require "rails_helper"
+
+RSpec.feature "Home Page" do
+ after { Capybara.app_host = nil }
+
+ scenario "User visits the claims homepage" do
+ given_there_is_an_existing_persona_for("Mary")
+ given_i_am_on_the_claims_site
+
+ when_i_visit_home_page
+ i_can_see_organisation_details
+ i_can_see_contact_details
+
+ end
+
+ private
+
+ def given_i_am_on_the_claims_site
+ Capybara.app_host = "http://#{ENV["CLAIMS_HOST"]}"
+ end
+
+ def when_i_visit_home_page
+ visit "/"
+ end
+
+ def given_there_is_an_existing_persona_for(persona_name)
+ user = create(:persona, persona_name.downcase.to_sym,service:"claims")
+ create(:gias_school)
+ DfESignInUser.load_from_session({"dfe_sign_in_user"=>{"email"=>user.email},"service" =>:claims})
+ end
+
+ def i_can_see_organisation_details
+ expect(page).to have_css(".govuk-summary-list__value", text: "Hogwarts")
+ expect(page).to have_css(".govuk-summary-list__value", text: "fake_uprn")
+ expect(page).to have_css(".govuk-summary-list__value", text: 1)
+ end
+
+ def i_can_see_contact_details
+ expect(page).to have_css(".govuk-summary-list__value", text: "contact@example.com")
+ expect(page).to have_css(".govuk-summary-list__value", text: "0123456789")
+ expect(page).to have_css(".govuk-summary-list__value", text: "www.hogwarts.com")
+ expect(page).to have_css(".govuk-summary-list__value", text: "Hogwarts Castle")
+ expect(page).to have_css(".govuk-summary-list__value", text: "Scotland")
+ expect(page).to have_css(".govuk-summary-list__value", text: "United Kingdom")
+ end
+end
diff --git a/spec/system/home_page_spec.rb b/spec/system/home_page_spec.rb
index ccfddcd2c5..f3ced58cfa 100644
--- a/spec/system/home_page_spec.rb
+++ b/spec/system/home_page_spec.rb
@@ -5,6 +5,7 @@
scenario "User visits the claims homepage" do
given_i_am_on_the_claims_site
+ and_given_i_have_a_school
and_i_am_on_the_start_page
i_can_see_the_claims_service_name_in_the_header
and_i_can_see_the_claims_service_value_in_the_page
@@ -27,6 +28,10 @@ def given_i_am_on_the_placements_site
Capybara.app_host = "http://#{ENV["PLACEMENTS_HOST"]}"
end
+ def and_given_i_have_a_school
+ create(:gias_school)
+ end
+
def and_i_am_on_the_start_page
visit "/"
end
@@ -44,7 +49,7 @@ def i_can_see_the_placements_service_name_in_the_header
end
def and_i_can_see_the_claims_service_value_in_the_page
- expect(page).to have_css(".govuk-summary-list__value", text: "Claims")
+ expect(page).to have_css(".app-primary-navigation__link", text: "Claims")
end
def and_i_can_see_the_placements_service_value_in_the_page