ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/views/case_workers/admin/allocations/_allocation.html.haml

Summary

Maintainability
Test Coverage
#allocation
  = govuk_notification_banner('Allocation', nil, class: 'govuk-!-display-none') unless !flash.empty?

#api-key.govuk-grid-row{ data: { api_key: current_user.api_key } }
  .govuk-grid-column-two-thirds
    = render partial: 'layouts/header', locals: { page_heading: t('.page_heading') }

= form_with url: case_workers_admin_allocations_path, method: :get, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f|
  = f.hidden_field :tab, id: :tab, value: params[:tab]
  = f.hidden_field :filter, id: :filter, value: params[:filter] if params[:filter]
  = f.hidden_field :page, id: :page, value: params[:page]
  = f.hidden_field :value_band_id, id: :value_band_id, value: params[:value_band_id] if params[:value_band_id]

  .govuk-grid-row
    .govuk-grid-column-two-thirds.scheme-filters
      = render partial: 'scheme_filters', locals: { f: f }

  = f.govuk_fieldset legend: { text: t('.allocate_claims'), size: 'm' } do
    .govuk-grid-row
      .govuk-grid-column-one-third
        = f.govuk_number_field :quantity_to_allocate, label: { text: t('.no_of_claims') }

      #cc-caseworker.govuk-grid-column-one-third.fx-autocomplete-wrapper
        = f.govuk_select :allocation_case_worker_id, label: { text: t('dictionary.models.case_worker') } do
          = options_for_select [['', '']]
          = options_from_collection_for_select @case_workers, :id, :name

      .govuk-grid-column-one-third{ class: 'govuk-!-padding-top-6' }
        = govuk_button t('.allocate'), class: 'allocation-submit'

  = f.govuk_fieldset legend: { text: t('.filter_claims'), size: 'm' } do
    .govuk-grid-row
      .govuk-grid-column-one-third
        = render partial: 'filter_tasks', locals: { f: f }

      .govuk-grid-column-one-third
        = render partial: 'filter_value_bands', locals: { f: f }

      .govuk-grid-column-one-third{ class: 'govuk-!-padding-top-6' }
        = govuk_button t('.clear_filters'), class: 'clear-filters govuk-button--secondary'

  %h2.govuk-heading-m
    = t('.allocation_queue')

  = govuk_table(class: 'app-jq-datatable', style: 'width: 100%') do
    = govuk_table_caption(class: 'govuk-visually-hidden') do
      = t('.table_summary')

    = govuk_table_thead_collection ['',
      t('.case_number'),
      t('.court'),
      t('.defendents'),
      t('.type'),
      t('.submitted'),
      t('.total')]