Browse Source

Update header to show product name and use end navigation

pull/477/head
Paul Robert Lloyd 3 years ago
parent
commit
e2c3aa36aa
  1. 23
      app/frontend/styles/_header.scss
  2. 9
      app/frontend/styles/application.scss
  3. 7
      app/views/layouts/application.html.erb
  4. 2
      db/schema.rb

23
app/frontend/styles/_header.scss

@ -0,0 +1,23 @@
.app-header {
border-bottom: govuk-spacing(2) solid $govuk-brand-colour;
.govuk-header__logo {
@include govuk-media-query($from: desktop) {
width: 60%;
}
@include govuk-media-query($from: 860px) {
width: 75%;
}
}
.govuk-header__content {
@include govuk-media-query($from: desktop) {
width: 40%;
}
@include govuk-media-query($from: 860px) {
width: 25%;
}
}
}

9
app/frontend/styles/application.scss

@ -20,6 +20,7 @@ $govuk-new-link-styles: true;
@import "figure";
@import "filter";
@import "filter-layout";
@import "header";
@import "input";
@import "related-navigation";
@import "section-skip-link";
@ -53,11 +54,3 @@ $govuk-new-link-styles: true;
width: 100%;
}
}
.govuk-header__logo {
width: 80%;
}
.govuk-header__content {
width: 20%;
}

7
app/views/layouts/application.html.erb

@ -43,15 +43,14 @@
<%= govuk_skip_link %>
<%= govuk_header(
logotype: "GOV.UK",
service_name: t("service_name"),
classes: "app-header",
service_url: current_user.nil? ? "/" : "/logs",
navigation_classes: "govuk-header__navigation--end"
) do |component|
component.product_name(name: t("service_name"))
if current_user.nil?
component.navigation_item(text: "Sign in", href: user_session_path)
else
component.navigation_item(text: "Logs", href: case_logs_path)
component.navigation_item(text: "Your organisation", href: "/organisations/#{current_user.organisation.id}")
component.navigation_item(text: "Your account", href: account_path)
component.navigation_item(text: "Sign out", href: destroy_user_session_path)
end

2
db/schema.rb

@ -305,12 +305,12 @@ ActiveRecord::Schema[7.0].define(version: 2022_04_11_092231) do
t.string "last_sign_in_ip"
t.integer "role"
t.string "old_user_id"
t.string "phone"
t.integer "failed_attempts", default: 0
t.string "unlock_token"
t.datetime "locked_at", precision: nil
t.boolean "is_dpo", default: false
t.boolean "is_key_contact", default: false
t.string "phone"
t.integer "second_factor_attempts_count", default: 0
t.string "encrypted_otp_secret_key"
t.string "encrypted_otp_secret_key_iv"

Loading…
Cancel
Save