diff --git a/app/controllers/collection_resources_controller.rb b/app/controllers/collection_resources_controller.rb index f1fd6de07..e8e25487d 100644 --- a/app/controllers/collection_resources_controller.rb +++ b/app/controllers/collection_resources_controller.rb @@ -68,6 +68,16 @@ class CollectionResourcesController < ApplicationController redirect_to collection_resources_path end + def confirm_mandatory_collection_resources_release + return render_not_found unless current_user.support? + + @year = params[:year].to_i + + return render_not_found unless editable_collection_resource_years.include?(@year) + + render "collection_resources/confirm_mandatory_collection_resources_release" + end + private def resource_params diff --git a/app/helpers/collection_resources_helper.rb b/app/helpers/collection_resources_helper.rb index b5aec1405..9deb13887 100644 --- a/app/helpers/collection_resources_helper.rb +++ b/app/helpers/collection_resources_helper.rb @@ -72,7 +72,7 @@ module CollectionResourcesHelper def display_next_year_banner? return false if CollectionResource.where(year: next_collection_start_year, mandatory: true, released_to_user: true).any? - + editable_collection_resource_years.include?(next_collection_start_year) end diff --git a/app/views/collection_resources/confirm_mandatory_collection_resources_release.erb b/app/views/collection_resources/confirm_mandatory_collection_resources_release.erb new file mode 100644 index 000000000..e5da8d58a --- /dev/null +++ b/app/views/collection_resources/confirm_mandatory_collection_resources_release.erb @@ -0,0 +1,27 @@ +<% content_for :before_content do %> + <% content_for :title, "Are you sure you want to release the #{text_year_range_format(@year)} collection resources?" %> + <%= govuk_back_link(href: collection_resources_path) %> +<% end %> +<% binding.pry %> +
+ The files uploaded will immediately become available for users to download. +
+ + <%= govuk_warning_text(text: "You will not be able to undo this action.") %> + + +