diff --git a/app/assets/stylesheets/application.sass.scss b/app/assets/stylesheets/application.sass.scss index 312cf6e614..7f043c5602 100644 --- a/app/assets/stylesheets/application.sass.scss +++ b/app/assets/stylesheets/application.sass.scss @@ -3,5 +3,86 @@ $govuk-new-link-styles: true; $govuk-assets-path: ""; @import "govuk-frontend/dist/govuk/all"; - @import "components/all"; +// // @import "govuk-frontend/govuk/base"; +// @import "govuk-frontend/dist/govuk/base"; +// @import "@ministryofjustice/frontend/moj/settings/all"; +// @import "@ministryofjustice/frontend/moj/helpers/all"; +// @import "@ministryofjustice/frontend/moj/objects/all"; + +// @import "@ministryofjustice/frontend/moj/components/primary-navigation/primary-navigation"; +// // @import "@ministryofjustice/frontend/moj/all"; +// $moj-images-path: "@ministryofjustice/frontend/moj/assets/images/"; +// $mobile-small-start: 400px; +// $mobile-small-end: 401px; +// $mobile-big-start: 500px; +// $mobile-big-end: 501px; +// $git-brand-colour: #159964; +.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; + } + } +} 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..786cf53ec8 --- /dev/null +++ b/app/components/navigation_bar.html.erb @@ -0,0 +1,22 @@ +
diff --git a/app/components/navigation_bar.rb b/app/components/navigation_bar.rb new file mode 100644 index 0000000000..6046693aac --- /dev/null +++ b/app/components/navigation_bar.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class NavigationBar < ApplicationComponent + attr_reader :items, :current_path + + def initialize( + items:, + current_path:, + current_user: {}, + classes: [], + html_attributes: {} + ) + super(classes:, html_attributes:) + @items = items + @current_path = current_path + @current_user = current_user + end + + def item_link(item) + link_params.merge!(aria: { current: "page" }) if show_current_link?(item) + govuk_link_to(item[:name], item[:url], no_underline: true) + end + + def user_signed_in? + @current_user.present? + end + + private + + def show_current_link?(item) + item.fetch(:current, false) || + [item.fetch(:url), item[:additional_url]].compact.any? do |url| + current_path.include?(url) + end + end +end diff --git a/app/controllers/claims/pages_controller.rb b/app/controllers/claims/pages_controller.rb index 48810ac803..ce1d48e44d 100644 --- a/app/controllers/claims/pages_controller.rb +++ b/app/controllers/claims/pages_controller.rb @@ -1,2 +1,5 @@ class Claims::PagesController < ApplicationController + def index + @school = GiasSchool.first + end end diff --git a/app/helpers/navigation_bar_helper.rb b/app/helpers/navigation_bar_helper.rb new file mode 100644 index 0000000000..13533236fb --- /dev/null +++ b/app/helpers/navigation_bar_helper.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +module NavigationBarHelper + def render_navigation_bar?(provider) + request.path.exclude?("support") && provider && !current_page?(root_path) && + !current_page?(publish_provider_path(provider.provider_code)) && + provider.recruitment_cycle + end + + def navigation_items(_provider) + [ + { + name: t("navigation_bar.users"), + url: "#", + additional_url: + "request_access_publish_provider_path(provider.provider_code)" + }, + name: t("navigation_bar.organisation_details"), + url: root_path, + active: request.path == root_path + ] + end +end diff --git a/app/views/claims/pages/index.html.erb b/app/views/claims/pages/index.html.erb index 5e1edfae85..49d57d2cd0 100644 --- a/app/views/claims/pages/index.html.erb +++ b/app/views/claims/pages/index.html.erb @@ -1,26 +1,49 @@ -- 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("^", "") - } - } - ] - ) %> -
+ <%= @school.address1 %>
+ <%= @school.address2 %>
+ <%= @school.address3 %>
+