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 @@ + 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/_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/_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..6d0e3ca55 100644 --- a/app/frontend/styles/application.scss +++ b/app/frontend/styles/application.scss @@ -14,6 +14,8 @@ $govuk-global-styles: true; @import "accessible-autocomplete"; @import "button"; +@import "card"; +@import "document-list"; @import "figure"; @import "filter"; @import "filter-layout"; diff --git a/app/views/layouts/_collection_resources.html.erb b/app/views/layouts/_collection_resources.html.erb new file mode 100644 index 000000000..4b45b0a8d --- /dev/null +++ b/app/views/layouts/_collection_resources.html.erb @@ -0,0 +1,13 @@ +
+

Collection resources

+ + <%= render DocumentListComponent.new(items: [{ + 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" + }]) %> +
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 d687246b7..578fccc53 100644 --- a/app/views/start/index.html.erb +++ b/app/views/start/index.html.erb @@ -3,16 +3,10 @@
-
+

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:

-
    -
  • upload data for multiple sales and lettings
  • -
  • transfer data using an API
  • - <%# TODO: Add link to lettings log form %> -
  • <%= govuk_link_to("download a copy of the 2021 to 2022 lettings log as a PDF", "#") %> (2MB)
  • -
+

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.

@@ -28,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" %>
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