diff --git a/app/assets/stylesheets/admin.scss b/app/assets/stylesheets/admin.scss index a7b41fa6e7..78ec5b8310 100644 --- a/app/assets/stylesheets/admin.scss +++ b/app/assets/stylesheets/admin.scss @@ -22,3 +22,5 @@ @import "vendor/jquery.highlighttextarea"; @import "shared/helpers/magna-charta"; @import "admin/base"; + +@import "admin/govuk-design-system-overrides"; diff --git a/app/assets/stylesheets/admin/_govuk-design-system-overrides.scss b/app/assets/stylesheets/admin/_govuk-design-system-overrides.scss new file mode 100644 index 0000000000..71836cd9b6 --- /dev/null +++ b/app/assets/stylesheets/admin/_govuk-design-system-overrides.scss @@ -0,0 +1,16 @@ +.govuk-design-system-styling { + @import "govuk_publishing_components/all_components"; + + .app-width-container--full-width { + margin: 0 govuk-spacing(3); + } + + .govuk-phase-banner__content, + .govuk-tag { + font-size: 16px; + } + + .govuk-phase-banner { + margin-bottom: 10px; + } +} diff --git a/app/assets/stylesheets/admin/_layout.scss b/app/assets/stylesheets/admin/_layout.scss index 9efe5599f2..092515f69d 100644 --- a/app/assets/stylesheets/admin/_layout.scss +++ b/app/assets/stylesheets/admin/_layout.scss @@ -51,6 +51,7 @@ $collapse-tabs-width: 710px; .masthead { border-top-width: 5px; border-bottom-width: 0; + margin-bottom: 0; } .masthead .container-fluid .navbar-brand { diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 0cc3d5c0ea..80b7b5ef45 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,8 +1,12 @@ @import "govuk_publishing_components/all_components"; + @import "./components/miller-columns"; @import "./components/autocomplete"; + @import "./modules/unpublish-display-conditions"; +@import "./views/whats-new"; + .legacy-whitehall { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; diff --git a/app/assets/stylesheets/views/_whats-new.scss b/app/assets/stylesheets/views/_whats-new.scss new file mode 100644 index 0000000000..ed7cf99ea6 --- /dev/null +++ b/app/assets/stylesheets/views/_whats-new.scss @@ -0,0 +1,42 @@ +.app-view-whats-new__last-updated { + color: govuk-colour("dark-grey"); +} + +.app-view-whats-new__section { + @include govuk-responsive-padding(5, "top"); + @include govuk-responsive-padding(5, "bottom"); + + border-bottom: 1px solid $govuk-border-colour; +} + +.app-view-whats-new__section:last-child { + border-bottom: none; +} + +.app-view-whats-new__back-to-top-link { + @include govuk-responsive-margin(7, "top"); + @include govuk-responsive-margin(6, "bottom"); +} + +.app-view-whats-new__back-to-top-icon { + width: .75em; + height: .75em; +} + +.app-view-whats-new__update { + @include govuk-responsive-margin(6, "bottom"); +} + +.app-view-whats-new__update:last-child { + @include govuk-responsive-margin(0, "bottom"); +} + +.app-view-whats-new__update-date { + @include govuk-responsive-margin(5, "bottom"); + + color: govuk-colour("dark-grey"); +} + +.app-view-whats-new__update-type { + text-align: right; +} diff --git a/app/controllers/admin/whats_new_controller.rb b/app/controllers/admin/whats_new_controller.rb new file mode 100644 index 0000000000..9f4e15c67e --- /dev/null +++ b/app/controllers/admin/whats_new_controller.rb @@ -0,0 +1,5 @@ +class Admin::WhatsNewController < Admin::BaseController + layout "design_system" + + def index; end +end diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index d147f70e07..d660ecd6ee 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -24,6 +24,14 @@

Product development

diff --git a/app/views/admin/whats_new/_back_to_top.html.erb b/app/views/admin/whats_new/_back_to_top.html.erb new file mode 100644 index 0000000000..4c62135144 --- /dev/null +++ b/app/views/admin/whats_new/_back_to_top.html.erb @@ -0,0 +1,8 @@ + diff --git a/app/views/admin/whats_new/_section.html.erb b/app/views/admin/whats_new/_section.html.erb new file mode 100644 index 0000000000..41da12d080 --- /dev/null +++ b/app/views/admin/whats_new/_section.html.erb @@ -0,0 +1,11 @@ +
+ <%= render "govuk_publishing_components/components/heading", { + text: heading, + font_size: "m", + margin_bottom: 3, + } %> + + <%= render_govspeak(body_govspeak) if defined?(body_govspeak) %> + <%= render(partial: "admin/whats_new/updates", locals: { updates: updates }) if defined?(updates) %> + <%= render partial: "admin/whats_new/back_to_top" %> +
diff --git a/app/views/admin/whats_new/_type.html.erb b/app/views/admin/whats_new/_type.html.erb new file mode 100644 index 0000000000..c7bcc13b0c --- /dev/null +++ b/app/views/admin/whats_new/_type.html.erb @@ -0,0 +1,13 @@ +<% + case type.downcase + when "new" then type_class = "govuk-tag--green" + when "improved" then type_class = "govuk-tag--blue" + when "changed" then type_class = "govuk-tag--red" + when "fixed" then type_class = "govuk-tag--yellow" + else type_class = "" + end +%> + + + <%= type %> + diff --git a/app/views/admin/whats_new/_updates.html.erb b/app/views/admin/whats_new/_updates.html.erb new file mode 100644 index 0000000000..e4152e841d --- /dev/null +++ b/app/views/admin/whats_new/_updates.html.erb @@ -0,0 +1,24 @@ +<% updates.each do | update | %> +
+ <% if update[:area].present? %> + <%= update[:area] %> + <% end %> +
+
+ <%= render "govuk_publishing_components/components/heading", { + text: update[:heading], + heading_level: 3, + margin_bottom: 3, + font_size: "s", + } %> + +

<%= update[:date] %>

+ + <%= render_govspeak(update[:body_govspeak]) %> +
+
+ <%= render partial: "admin/whats_new/type", locals: { type: update[:type] } %> +
+
+
+<% end %> diff --git a/app/views/admin/whats_new/index.html.erb b/app/views/admin/whats_new/index.html.erb new file mode 100644 index 0000000000..a074730824 --- /dev/null +++ b/app/views/admin/whats_new/index.html.erb @@ -0,0 +1,34 @@ +<% content_for :page_title, t('whats_new.title') %> +<% content_for :title, t('whats_new.title') %> +<% content_for :title_margin_bottom, 0 %> + +<% + sections = [ + t('whats_new.introduction'), + t('whats_new.recent_changes'), + t('whats_new.guidance'), + ] +%> + +
+
+

<%= t('whats_new.summary') %>

+ +

<%= t('whats_new.last_updated') %>

+ +
+ <%= render "govuk_publishing_components/components/contents_list", { + contents: sections.map do | section | + { + href: "##{section[:heading].parameterize(separator: '-')}", + text: section[:heading], + } + end + } %> +
+ + <% sections.each do | section | %> + <%= render partial: "admin/whats_new/section", locals: section %> + <% end %> +
+
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index b24b5c4b80..4b83d465d7 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -15,6 +15,11 @@ <% content_for :navbar do %> <%= render "shared/header" %> +
+
"> + <%= render "shared/whats_new_banner" %> +
+
<% end %> <% content_for :content do %> diff --git a/app/views/layouts/design_system.html.erb b/app/views/layouts/design_system.html.erb index 721f0915a9..167ed27fcc 100644 --- a/app/views/layouts/design_system.html.erb +++ b/app/views/layouts/design_system.html.erb @@ -14,6 +14,8 @@
+ <%= render "shared/whats_new_banner" %> + <%= yield(:back_link) %> <%= yield(:breadcrumbs) %> @@ -37,6 +39,7 @@ context: yield(:context), title: yield(:title), margin_top: 0, + margin_bottom: yield(:title_margin_bottom).present? ? yield(:title_margin_bottom) : nil, } %>
diff --git a/app/views/shared/_header.html.erb b/app/views/shared/_header.html.erb index 058f269f48..c092b39b64 100644 --- a/app/views/shared/_header.html.erb +++ b/app/views/shared/_header.html.erb @@ -8,8 +8,7 @@ navbar-default navbar-inverse navbar-static-top - <% if environment_style %>environment-indicator<% end %> - add-bottom-margin" role="banner"> + <% if environment_style %>environment-indicator<% end %>" role="banner">