Browse Source

CLDC-546 Add start page (#173)

* Delete superfluous assets folders

* Delete about page

* Replace test page with explictly named start page

* Add content for start page
pull/175/head
Paul Robert Lloyd 3 years ago committed by GitHub
parent
commit
ed01b02d11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 0
      app/assets/images/.keep
  2. 15
      app/assets/stylesheets/application.css
  3. 3
      app/controllers/about_controller.rb
  4. 3
      app/controllers/start_controller.rb
  5. 3
      app/controllers/test_controller.rb
  6. 5
      app/views/about/index.html.erb
  7. 47
      app/views/start/index.html.erb
  8. 30
      app/views/test/index.html.erb
  9. 59
      app/webpacker/styles/_related-navigation.scss
  10. 5
      app/webpacker/styles/application.scss
  11. 4
      config/routes.rb
  12. 2
      spec/controllers/start_controller_spec.rb
  13. 7
      spec/features/test_spec.rb

0
app/assets/images/.keep

15
app/assets/stylesheets/application.css

@ -1,15 +0,0 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
* vendor/assets/stylesheets directory can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
* compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
* files in this directory. Styles in this file should be added after the last require_* statement.
* It is generally better to create a new file per style scope.
*
*= require_tree .
*= require_self
*/

3
app/controllers/about_controller.rb

@ -1,3 +0,0 @@
class AboutController < ApplicationController
def index; end
end

3
app/controllers/start_controller.rb

@ -0,0 +1,3 @@
class StartController < ApplicationController
def index; end
end

3
app/controllers/test_controller.rb

@ -1,3 +0,0 @@
class TestController < ApplicationController
def index; end
end

5
app/views/about/index.html.erb

@ -1,5 +0,0 @@
<% content_for :title, "About" %>
<h1 class="govuk-heading-l">
<%= content_for(:title) %>
</h1>

47
app/views/start/index.html.erb

@ -0,0 +1,47 @@
<h1 class="govuk-heading-xl govuk-!-width-two-thirds">
<%= t("service_name") %>
</h1>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<p class="govuk-body">Use this service to submit social housing lettings and sales data to the Department for Levelling Up, Housing and Communities (DLUHC).</p>
<p class="govuk-body">We’ll ask you questions about a sale or letting, like details about the household or property. Your answers will create a log that you can submit directly to us.</p>
<p class="govuk-body">Your organisation can also:</p>
<ul class="govuk-list govuk-list--bullet">
<li>upload data for multiple sales and lettings</li>
<li>transfer data using an API</li>
<%# TODO: Add link to lettings log form %>
<li><%= govuk_link_to("download a copy of the 2021 to 2022 lettings log as a PDF", "https://digital.dclg.gov.uk/jira/servicedesk/customer/portal/4/group/21") %> (2MB)</li>
</ul>
<p class="govuk-body">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.</p>
<p class="govuk-body">This service is only for social housing in England.</p>
<%= govuk_start_button(
text: 'Start now',
href: user_session_path
) %>
<h2 class="govuk-heading-m">Before you start</h2>
<p class="govuk-body">Use your account details to sign in.</p>
<p class="govuk-body">If you need to set up a new account, speak to your organisation’s CORE data coordinator. If you don’t know who that is, <%= govuk_link_to("contact the helpdesk", "https://digital.dclg.gov.uk/jira/servicedesk/customer/portal/4/group/21") %>.</p>
<p class="govuk-body">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.</p>
<%# TODO: Add link to data sharing agreement %>
<p class="govuk-body"><%= govuk_link_to("Read our data sharing agreement", "#") %>.</p>
</div>
<div class="govuk-grid-column-one-third">
<div class="app-related-navigation">
<nav class="app-related-navigation__nav-section" role="navigation" aria-labelledby="related-content">
<h2 class="app-related-navigation__main-heading" id="related-content">
Related content
</h2>
<ul class="app-related-navigation__link-list">
<li class="app-related-navigation__link">
<%# TODO: Add link to guidance %>
<%= govuk_link_to("How to submit social housing lettings and sales data (CORE)", "#", classes: "app-related-navigation__section-link app-related-navigation__section-link--other") %>
</li>
</ul>
</nav>
</div>
</div>
</div>

30
app/views/test/index.html.erb

@ -1,30 +0,0 @@
<%= render GovukComponent::AccordionComponent.new(id: 'abc123') do |component|
component.section(
heading_text: 'Home electronics',
summary_text: 'Entertainment, communication and recreation',
expanded: true) do
tag.p(class: 'govuk-body') do
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."
end
end
component.section(heading_text: 'Appliances', summary_text: 'Laundry, cookers and vacuum cleaners') do
tag.p(class: 'govuk-body') do
"Ut et elementum tortor. Donec a tellus sed sem euismod congue"
end
end
component.section(heading_text: 'Toys') do
safe_join([
tag.p(class: 'govuk-body') do
"In et nunc vitae tortor sollicitudin ultrices. Vivamus a purus justo."
end,
tag.p(class: 'govuk-body') do
"Duis a turpis non nunc pulvinar venenatis quis congue mauris"
end
])
end
end %>
<%= govuk_link_to('About', about_path) %>

59
app/webpacker/styles/_related-navigation.scss

@ -0,0 +1,59 @@
.app-related-navigation {
@include govuk-text-colour;
border-top: 2px solid govuk-colour("blue");
}
.app-related-navigation__main-heading {
@include govuk-font(19, $weight: bold);
margin-top: govuk-spacing(3);
margin-bottom: govuk-spacing(2);
}
.app-related-navigation__sub-heading {
@include govuk-font(16);
border-top: 1px solid govuk-colour("mid-grey", $legacy: "grey-2");
margin: 0;
padding-top: govuk-spacing(3);
}
.app-related-navigation__sub-heading--footer {
@include govuk-font(19, $weight: bold);
border-top: 0;
padding-top: 0;
margin-top: govuk-spacing(3);
margin-bottom: govuk-spacing(2);
}
.app-related-navigation__main-heading + .app-related-navigation__sub-heading {
border-top: 0;
padding-top: 0;
}
.app-related-navigation__nav-section {
margin-bottom: govuk-spacing(6);
}
.app-related-navigation__link-list {
padding: 0;
margin: 0;
list-style: none;
margin-bottom: 1.25em;
}
.app-related-navigation__link {
@include govuk-font($size: 16, $weight: regular, $line-height: 1.45);
list-style-type: none;
margin-top: govuk-spacing(3);
@include govuk-media-query($from: tablet) {
line-height: 1.28;
}
}
.app-related-navigation__section-link {
font-weight: bold;
}
.app-related-navigation__section-link--other {
font-weight: normal;
}

5
app/webpacker/styles/application.scss

@ -11,8 +11,9 @@ $govuk-image-url-function: frontend-image-url;
@import "~govuk-frontend/govuk/all"; @import "~govuk-frontend/govuk/all";
@import '_task-list'; @import 'related-navigation';
@import '_tab-navigation'; @import 'task-list';
@import 'tab-navigation';
$govuk-global-styles: true; $govuk-global-styles: true;

4
config/routes.rb

@ -11,8 +11,8 @@ Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
ActiveAdmin.routes(self) ActiveAdmin.routes(self)
root to: "test#index"
get "about", to: "about#index" root to: "start#index"
resources :users do resources :users do
member do member do

2
spec/controllers/test_controller_spec.rb → spec/controllers/start_controller_spec.rb

@ -1,7 +1,7 @@
require "rails_helper" require "rails_helper"
# Test Controller intital test # Test Controller intital test
RSpec.describe TestController, type: :controller do RSpec.describe StartController, type: :controller do
let(:valid_session) { {} } let(:valid_session) { {} }
describe "GET #index" do describe "GET #index" do

7
spec/features/test_spec.rb

@ -4,11 +4,4 @@ RSpec.describe "Test Features" do
visit("/") visit("/")
expect(page).to have_content("Submit social housing lettings and sales data (CORE)") expect(page).to have_content("Submit social housing lettings and sales data (CORE)")
end end
it "Links to the About page" do
visit("/")
click_link("About")
expect(current_path).to eql("/about")
expect(page).to have_content("About")
end
end end

Loading…
Cancel
Save