-
Notifications
You must be signed in to change notification settings - Fork 194
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow users to bulk republish by organisation
This adds a page where users can enter an organisation slug, followed by a page where users confirm that they want all documents associated with that organisation to be republished. Users are then redirected back to the index with a flashed confirmation message
- Loading branch information
Showing
8 changed files
with
211 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
app/views/admin/bulk_republishing/confirm_documents_by_organisation.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<% content_for :page_title, "Republish #{@bulk_content_type_metadata[:name]} '#{@organisation.name}'" %> | ||
<% content_for :title, "Are you sure you want to republish #{@bulk_content_type_metadata[:name]} '#{@organisation.name}'?" %> | ||
<% content_for :title_margin_bottom, 6 %> | ||
<% content_for :error_summary, render(Admin::ErrorSummaryComponent.new(object: @republishing_event)) %> | ||
|
||
<div class="govuk-grid-row"> | ||
<section class="govuk-grid-column-two-thirds"> | ||
<p class="govuk-body govuk-!-margin-bottom-7"> | ||
This will queue all documents associated with the organisation <%= link_to @organisation.name, @organisation.public_url, { class: "govuk-link" } %> to be republished. | ||
</p> | ||
<%= render partial: "shared/republishing_form", locals: { | ||
republishing_event: @republishing_event, | ||
republishing_path: admin_bulk_republishing_documents_by_organisation_republish_path(@organisation.slug), | ||
} %> | ||
</section> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
app/views/admin/bulk_republishing/new_documents_by_organisation.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<% content_for :page_title, "Republish all by organisation" %> | ||
<% content_for :title, "What organisation's documents would you like to republish?" %> | ||
<% content_for :title_margin_bottom, 6 %> | ||
|
||
<div class="govuk-grid-row"> | ||
<section class="govuk-grid-column-two-thirds"> | ||
<%= form_with(url: admin_bulk_republishing_documents_by_organisation_search_path, method: :post) do %> | ||
<%= render "govuk_publishing_components/components/input", { | ||
label: { | ||
text: "Enter the slug for the organisation", | ||
}, | ||
hint: "You can get the slug from the last part of the public URL - everything after '/government/organisations/'.", | ||
name: "organisation_slug", | ||
} %> | ||
<%= render "govuk_publishing_components/components/button", { | ||
text: "Continue", | ||
} %> | ||
<% end %> | ||
</section> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters