From feb7567c741fffacfae78e7492fd3d623848ec1b Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Apr 2022 12:39:31 +0100 Subject: [PATCH 1/5] Remove reference to upcoming features from start page --- app/views/start/index.html.erb | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index d687246b7..e59a15a89 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -6,13 +6,7 @@

Use this service to submit social housing lettings and sales data to the Department for Levelling Up, Housing and Communities (DLUHC).

We’ll ask you questions about a letting or sale, like details about the household or property. Your answers will create a log that you can submit directly to us.

-

Your organisation can also:

- +

Your organisation can also set up and manage user accounts.

The data will be used to update the national record for social housing. It will also help to inform policy about the cost of social housing and what type of housing needs to be built.

This service is only for social housing in England.

From fd675bdf010c80af635ef7dd6092e30cb5bc4f83 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Apr 2022 13:37:26 +0100 Subject: [PATCH 2/5] Add document list component --- .../document_list_component.html.erb | 15 +++++ app/components/document_list_component.rb | 8 +++ app/frontend/styles/_document-list.scss | 66 +++++++++++++++++++ app/frontend/styles/application.scss | 1 + .../document_list_component_spec.rb | 19 ++++++ 5 files changed, 109 insertions(+) create mode 100644 app/components/document_list_component.html.erb create mode 100644 app/components/document_list_component.rb create mode 100644 app/frontend/styles/_document-list.scss create mode 100644 spec/components/document_list_component_spec.rb diff --git a/app/components/document_list_component.html.erb b/app/components/document_list_component.html.erb new file mode 100644 index 000000000..6242ab3dc --- /dev/null +++ b/app/components/document_list_component.html.erb @@ -0,0 +1,15 @@ +
    + <% items.each do |item| %> +
  • +

    + <%= govuk_link_to item[:name], item[:href] %> +

    + <% if item[:description] %> +

    <%= item[:description] %>

    + <% end %> + <% if item[:metadata] %> + + <% end %> +
  • + <% end %> +
diff --git a/app/components/document_list_component.rb b/app/components/document_list_component.rb new file mode 100644 index 000000000..253370c98 --- /dev/null +++ b/app/components/document_list_component.rb @@ -0,0 +1,8 @@ +class DocumentListComponent < ViewComponent::Base + attr_reader :items + + def initialize(items:) + @items = items + super + end +end diff --git a/app/frontend/styles/_document-list.scss b/app/frontend/styles/_document-list.scss new file mode 100644 index 000000000..89c547ef6 --- /dev/null +++ b/app/frontend/styles/_document-list.scss @@ -0,0 +1,66 @@ +.app-document-list { + list-style: none; + padding: 0; +} + +.app-document-list__item { + margin-bottom: govuk-spacing(4); + + &:last-child { + border-bottom: 0; + margin-bottom: 0; + padding-bottom: 0; + } +} + +.app-document-list__item-title { + @include govuk-font($size: 16, $weight: "bold"); + margin: 0 0 govuk-spacing(1); +} + +.app-document-list__item-metadata { + padding: 0; + margin: 0; +} + +.app-document-list__item-description { + @include govuk-font($size: 16); + margin: govuk-spacing(1) 0; +} + +.app-document-list__item-metadata { + @include govuk-font($size: 16); + color: $govuk-secondary-text-colour; + margin: 0; +} +.app-document-list { + list-style: none; + padding: 0; +} + +.app-document-list__item { + margin-bottom: govuk-spacing(4); + + &:last-child { + border-bottom: 0; + margin-bottom: 0; + padding-bottom: 0; + } +} + +.app-document-list__item-title { + @include govuk-font($size: 16, $weight: "bold"); + margin: 0 0 govuk-spacing(1); +} + +.app-document-list__item-description { + @include govuk-font($size: 16); + margin: govuk-spacing(1) 0; +} + +.app-document-list__item-metadata { + @include govuk-font($size: 16); + color: $govuk-secondary-text-colour; + padding: 0; + margin: 0; +} diff --git a/app/frontend/styles/application.scss b/app/frontend/styles/application.scss index 258c21e4d..1c7642374 100644 --- a/app/frontend/styles/application.scss +++ b/app/frontend/styles/application.scss @@ -14,6 +14,7 @@ $govuk-global-styles: true; @import "accessible-autocomplete"; @import "button"; +@import "document-list"; @import "figure"; @import "filter"; @import "filter-layout"; diff --git a/spec/components/document_list_component_spec.rb b/spec/components/document_list_component_spec.rb new file mode 100644 index 000000000..ee0c32301 --- /dev/null +++ b/spec/components/document_list_component_spec.rb @@ -0,0 +1,19 @@ +require "rails_helper" + +RSpec.describe DocumentListComponent, type: :component do + let(:items) do + [{ name: "PDF Form", href: "/forms/form.pdf", description: "An important form", metadata: "4 pages" }, + { name: "Website", href: "https://example.com" }] + end + + context "when rendering tabs" do + it "all of the nav tabs specified in the items hash are passed to it" do + result = render_inline(described_class.new(items:)) + + expect(result.text).to include("PDF Form") + expect(result.text).to include("An important form") + expect(result.text).to include("4 pages") + expect(result.text).to include("Website") + end + end +end From bdf7cd011deceaa44d0f081a219b3da905d0bad0 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Apr 2022 13:37:49 +0100 Subject: [PATCH 3/5] Add card styles --- app/frontend/styles/_card.scss | 7 +++++++ app/frontend/styles/application.scss | 1 + 2 files changed, 8 insertions(+) create mode 100644 app/frontend/styles/_card.scss diff --git a/app/frontend/styles/_card.scss b/app/frontend/styles/_card.scss new file mode 100644 index 000000000..d0a9e9ecf --- /dev/null +++ b/app/frontend/styles/_card.scss @@ -0,0 +1,7 @@ +.app-card { + @include govuk-responsive-padding(4); + @include govuk-font($size: 19); + background-color: govuk-colour("light-grey"); + display: block; + position: relative; +} diff --git a/app/frontend/styles/application.scss b/app/frontend/styles/application.scss index 1c7642374..6d0e3ca55 100644 --- a/app/frontend/styles/application.scss +++ b/app/frontend/styles/application.scss @@ -14,6 +14,7 @@ $govuk-global-styles: true; @import "accessible-autocomplete"; @import "button"; +@import "card"; @import "document-list"; @import "figure"; @import "filter"; From a6fa99819211e1a36f63f3af9c8bb97e276457a4 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Apr 2022 13:40:54 +0100 Subject: [PATCH 4/5] Add collection resouces sidebar to start page and organisation page --- .../layouts/_collection_resources.html.erb | 9 ++++++++ app/views/organisations/show.html.erb | 4 ++++ app/views/start/index.html.erb | 21 +++---------------- 3 files changed, 16 insertions(+), 18 deletions(-) create mode 100644 app/views/layouts/_collection_resources.html.erb diff --git a/app/views/layouts/_collection_resources.html.erb b/app/views/layouts/_collection_resources.html.erb new file mode 100644 index 000000000..fb4028990 --- /dev/null +++ b/app/views/layouts/_collection_resources.html.erb @@ -0,0 +1,9 @@ +
+

2022/23 collection resources

+ + <%= render DocumentListComponent.new(items: [{ + name: "Lettings log for tenants", + href: "https://core.communities.gov.uk/public/download/guides-and-manuals/2022-23%20Lettings%20paper%20form.pdf?download-format=pdf", + metadata: "PDF, 654 KB, 4 pages" + }]) %> +
diff --git a/app/views/organisations/show.html.erb b/app/views/organisations/show.html.erb index c549605e6..8af61268f 100644 --- a/app/views/organisations/show.html.erb +++ b/app/views/organisations/show.html.erb @@ -26,4 +26,8 @@ <% end %> <% end %>
+ +
+ <%= render partial: "layouts/collection_resources" %> +
diff --git a/app/views/start/index.html.erb b/app/views/start/index.html.erb index e59a15a89..578fccc53 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -3,7 +3,7 @@
-
+

Use this service to submit social housing lettings and sales data to the Department for Levelling Up, Housing and Communities (DLUHC).

We’ll ask you questions about a letting or sale, like details about the household or property. Your answers will create a log that you can submit directly to us.

Your organisation can also set up and manage user accounts.

@@ -22,22 +22,7 @@

You can <%= govuk_link_to("request an account", "https://digital.dclg.gov.uk/jira/servicedesk/customer/portal/4/group/21") %> if your organisation doesn’t have one.

-
- +
+ <%= render partial: "layouts/collection_resources" %>
From 7c8f71c808042113f0904e48743f0ed5789115ad Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Wed, 20 Apr 2022 13:49:56 +0100 Subject: [PATCH 5/5] Add 2021/22 lettings log to collection resources list --- app/views/layouts/_collection_resources.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_collection_resources.html.erb b/app/views/layouts/_collection_resources.html.erb index fb4028990..4b45b0a8d 100644 --- a/app/views/layouts/_collection_resources.html.erb +++ b/app/views/layouts/_collection_resources.html.erb @@ -1,9 +1,13 @@
-

2022/23 collection resources

+

Collection resources

<%= render DocumentListComponent.new(items: [{ - name: "Lettings log for tenants", + name: "Lettings log for tenants (2022/23)", href: "https://core.communities.gov.uk/public/download/guides-and-manuals/2022-23%20Lettings%20paper%20form.pdf?download-format=pdf", metadata: "PDF, 654 KB, 4 pages" + }, { + name: "Lettings log for tenants (2021/22)", + href: "https://core.communities.gov.uk/public/download/guides-and-manuals/2021_22%20Lettings%20Log.pdf?download-format=pdf", + metadata: "PDF, 302 KB, 3 pages" }]) %>