-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3269 from DFE-Digital/CAPT-1834/claim-allocations…
…-dropdown CAPT 1834/claim allocations dropdown
- Loading branch information
Showing
2 changed files
with
50 additions
and
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,27 @@ | ||
<% allocate_claim_count = @claims.where(assigned_to: nil).count > 25 ? 25 : @claims.where(assigned_to: nil).size %> | ||
|
||
<h2 class="govuk-heading-m">Allocate claims</h2> | ||
|
||
<%= form_with url: admin_bulk_allocate_path, method: :patch do |form| %> | ||
<%= form.hidden_field :allocate_claim_count, value: allocate_claim_count %> | ||
<%= form_with url: admin_bulk_allocate_path, method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |form| %> | ||
<div class="govuk-form-group admin-filter-group" id="allocations"> | ||
<div> | ||
<label class="govuk-label" for="allocate_to_team_member"> | ||
Team members: | ||
</label> | ||
<%= form.select :allocate_to_team_member, options_for_select(DfeSignIn::User.options_for_select, params[:allocate_to_team_member]), {}, class: "govuk-select" %> | ||
</div> | ||
<div> | ||
<label class="govuk-label" for="allocate_to_policy"> | ||
Policy: | ||
</label> | ||
<%= form.select :allocate_to_policy, options_for_select(Policies.options_for_select, params[:policy]), {include_blank: "All"}, class: "govuk-select" %> | ||
</div> | ||
<%= form.govuk_select( | ||
:allocate_to_team_member, | ||
options_for_select(DfeSignIn::User.options_for_select, params[:allocate_to_team_member]), | ||
label: { text: "Team members:" } | ||
) %> | ||
|
||
<%= form.govuk_select( | ||
:allocate_to_policy, | ||
options_for_select(Policies.options_for_select, params[:policy]), | ||
options: { include_blank: "All" }, | ||
label: { text: "Policy:" } | ||
) %> | ||
|
||
<div> | ||
<div class="govuk-label">Default: 25</div> | ||
<%= form.submit "Allocate claims", class: "govuk-button govuk-button--secondary", id: :allocate, disabled: allocate_claim_count.zero? %> | ||
</div> | ||
<%= form.govuk_select( | ||
:allocate_claim_count, | ||
options_for_select([5, 10, 25], params[:allocate_claim_count] || 25), | ||
label: { text: "Number of claims:" } | ||
) %> | ||
|
||
<div> | ||
<%= form.submit "Unallocate claims", class: "govuk-button govuk-button--secondary admin-filter-group__button", id: :unallocate, formaction: admin_bulk_deallocate_path %> | ||
</div> | ||
<%= form.submit "Allocate claims", class: "govuk-button govuk-button--secondary", id: :allocate, disabled: @claims.where(assigned_to: nil).count.zero? %> | ||
<%= form.submit "Unallocate claims", class: "govuk-button govuk-button--secondary", id: :unallocate, formaction: admin_bulk_deallocate_path %> | ||
</div> | ||
<% end %> |
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