Browse Source

CLDC-1886 Add sales paper form download (#1408)

* Add sales paper form download

* Rename download path

* Add 22/23 sales log download
pull/1409/head
kosiakkatrina 2 years ago committed by GitHub
parent
commit
48c4b45813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 16
      app/controllers/start_controller.rb
  2. 18
      app/views/layouts/_collection_resources.html.erb
  3. 2
      config/routes.rb
  4. BIN
      public/files/2022_23_sales_paper_form.pdf
  5. BIN
      public/files/2023_24_sales_paper_form.pdf

16
app/controllers/start_controller.rb

@ -4,4 +4,20 @@ class StartController < ApplicationController
redirect_to(lettings_logs_path) redirect_to(lettings_logs_path)
end end
end end
def download_23_24_sales_form
send_file(
Rails.root.join("public/files/2023_24_sales_paper_form.pdf"),
filename: "2023-24 Sales paper form.pdf",
type: "application/pdf",
)
end
def download_22_23_sales_form
send_file(
Rails.root.join("public/files/2022_23_sales_paper_form.pdf"),
filename: "2022-23 Sales paper form.pdf",
type: "application/pdf",
)
end
end end

18
app/views/layouts/_collection_resources.html.erb

@ -19,4 +19,22 @@
metadata: "PDF, 654 KB, 4 pages", metadata: "PDF, 654 KB, 4 pages",
}, },
]) %> ]) %>
<h2 class="govuk-body-l govuk-!-margin-bottom-3">Sales 23/24</h2>
<%= render DocumentListComponent.new(items: [
{
name: "Sales log for buyers (2023/24)",
href: download_23_24_sales_form_path,
metadata: "PDF, 421 KB, 8 pages",
},
]) %>
<h2 class="govuk-body-l govuk-!-margin-bottom-3">Sales 22/23</h2>
<%= render DocumentListComponent.new(items: [
{
name: "Sales log for buyers (2022/23)",
href: download_22_23_sales_form_path,
metadata: "PDF, 397 KB, 5 pages",
},
]) %>
</div> </div>

2
config/routes.rb

@ -35,6 +35,8 @@ Rails.application.routes.draw do
get "/accessibility-statement", to: "content#accessibility_statement" get "/accessibility-statement", to: "content#accessibility_statement"
get "/privacy-notice", to: "content#privacy_notice" get "/privacy-notice", to: "content#privacy_notice"
get "/data-sharing-agreement", to: "content#data_sharing_agreement" get "/data-sharing-agreement", to: "content#data_sharing_agreement"
get "/download-23-24-sales-form", to: "start#download_23_24_sales_form"
get "/download-22-23-sales-form", to: "start#download_22_23_sales_form"
resource :account, only: %i[show edit], controller: "users" do resource :account, only: %i[show edit], controller: "users" do
get "edit/password", to: "users#edit_password" get "edit/password", to: "users#edit_password"

BIN
public/files/2022_23_sales_paper_form.pdf

Binary file not shown.

BIN
public/files/2023_24_sales_paper_form.pdf

Binary file not shown.
Loading…
Cancel
Save