diff --git a/app/controllers/collection_resources_controller.rb b/app/controllers/collection_resources_controller.rb index ed080c749..b11904b70 100644 --- a/app/controllers/collection_resources_controller.rb +++ b/app/controllers/collection_resources_controller.rb @@ -91,6 +91,17 @@ class CollectionResourcesController < ApplicationController redirect_to collection_resources_path end + def new + return render_not_found unless current_user.support? + + year = params[:year].to_i + log_type = params[:log_type] + + return render_not_found unless editable_collection_resource_years.include?(year) + + @collection_resource = CollectionResource.new(year:, log_type:) + end + private def resource_params diff --git a/app/views/collection_resources/_collection_resource_summary_list.erb b/app/views/collection_resources/_collection_resource_summary_list.erb index 8ef588fd5..d806d043e 100644 --- a/app/views/collection_resources/_collection_resource_summary_list.erb +++ b/app/views/collection_resources/_collection_resource_summary_list.erb @@ -25,7 +25,7 @@ <% end %> <% end %>
+ This file will be available for all users to download. +
+ + <%= f.govuk_file_field :file, + label: { text: "Upload file", size: "m" } %> + + <%= f.govuk_text_field :display_name, + label: nil, + hint: { text: "This will be used in the download link on the homepage. Do not include the log type or collection year. For example, if you enter “bulk upload change log”, the download link will say “Download the lettings bulk upload change log (2024 to 2025)”." } %> + + <%= f.govuk_submit "Add resource" %> + <%= govuk_button_link_to "Cancel", collection_resources_path, secondary: true %> + <% end %> +