diff --git a/app/views/location_releases/index.html.erb b/app/views/location_releases/index.html.erb index b69328f..afc39b5 100644 --- a/app/views/location_releases/index.html.erb +++ b/app/views/location_releases/index.html.erb @@ -1,5 +1,6 @@
+ />
<% if policy(LocationRelease).new? %> <%= link_to fa_icon("plus", text: t(".actions.new")), [:new, @project, :location_release], class: "btn btn-primary mr-2 mb-2" %> @@ -10,7 +11,7 @@ <% end %> <% if @location_releases.any? && policy(LocationRelease).download_multiple? %> - <%= link_to "Download All", [@project, :contract_downloads, release_type: @location_releases.name], method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: { + <%= button_to "Download", [@project, :contract_downloads, release_type: @location_releases.name], id: "download_releases", method: :post, remote: true, class: "btn btn-light border ml-auto mr-2 mb-2", data: { disable_with: "Please wait..." } %> <% end %> diff --git a/app/views/location_releases/index.js.erb b/app/views/location_releases/index.js.erb index 263a8a6..0ce1d89 100644 --- a/app/views/location_releases/index.js.erb +++ b/app/views/location_releases/index.js.erb @@ -1,3 +1,5 @@ $("#location_releases").html("<%= j render(@location_releases) %>"); $("form input[type='search']").val("<%= params[:query] %>"); $("#location_releases_pagination").html("<%= j will_paginate(@location_releases) %>"); +$("#selected_releases_form").attr('data-releasable-ids', JSON.stringify([])); +$("#total_entries").val(<%= @location_releases.total_entries %>); \ No newline at end of file diff --git a/spec/jobs/generate_contracts_zip_job_spec.rb b/spec/jobs/generate_contracts_zip_job_spec.rb index 3c83eb7..dfddd38 100644 --- a/spec/jobs/generate_contracts_zip_job_spec.rb +++ b/spec/jobs/generate_contracts_zip_job_spec.rb @@ -186,10 +186,13 @@ describe GenerateContractsZipJob do end context "generates ZIP for location releases" do - let(:release) { create(:location_release_with_contract_template, :native, project: project) } + let(:release) { create(:location_release_with_contract_template, :native, project: project, person_name: "John Doe") } + let(:release2) { create(:location_release_with_contract_template, :native, project: project, person_name: "Jane Doe") } + let(:release3) { create(:location_release_with_contract_template, :native, project: project, person_name: "Brad Doe") } subject { 'LocationRelease' } it_behaves_like "generates ZIP containig CSV file with all releases data" + it_behaves_like "generates ZIP containig CSV file with specific releases data" end context "generates ZIP for material releases" do