<commit_before>:ruby
  table_dom_id = SecureRandom.hex

.table-responsive
  %table.table.table-hover{:id => table_dom_id, :data => {:toggle => 'table',
    :card_view => "false",
    :pagination => 'true',
    :show_pagination_switch => 'true',
    :page_list => "[5, 10, 20, 50, 100, 200]",
    :page_size => current_user.num_table_rows,
    :search => 'false',
    :toolbar => "#buckets_table_actions",
    :export_types => "['csv', 'txt', 'excel']",
    :show_export => 'true',
    :show_columns => 'true',
    :state_save => 'true',
    :state_save_id_table => "funding_buckets_id",
    :state_save_expire => "1y",
    :show_multi_sort => 'true',
    :sort_priority => '[{"sortName": "bucket_fy","sortOrder":"asc"},{"sortName":"bucket_owner","sortOrder":"asc"}]'}}

    %thead
      %tr
        - if compact_columns == 0
          %th.center{:data => {:visible => 'false'}} Object Key
        %th.center{:data => {:field => 'bucket_fy', :sortable => 'true'}} FY
        - if @funding_template.nil?
          %th.center{:data => {:sortable => 'true'}} Program (Template)
        %th.center{:data => {:sortable => 'true'}} Name
        %th.center{:data => {:sortable => 'true'}} Type
        - if (current_user.organizations.ids & @organization_list).count > 1 || !@my_funds
          %th.center{:data => {:field => 'bucket_owner', :sortable => 'true'}} Owner
        %th.center{:data => {:sortable => 'true', :formatter => 'currency_formatter'}} Total
        %th.center{:data => {:sortable => 'true', :formatter => 'currency_formatter'}} Committed
        %th.center{:data => {:sortable => 'true', :formatter => 'currency_formatter'}} Available
        %th.center{:data => {:sortable => 'true'}} Expires

        - if compact_columns == 0
          %th

    %tbody
      - buckets.each do |b|
        %tr{:id => b.object_key, :class => 'action-path'}
          - if compact_columns == 0
            %td.left= b.object_key
          %td.left= format_as_fiscal_year(b.fiscal_year)
          - if @funding_template.nil?
            %td.left= "#{b.funding_template.funding_source.name} (#{b.funding_template.name})"
          %td.left= "#{b.name}"
          - if @my_funds
            %td.left= b.is_bucket_app? ? 'Grant Application' : (b.funding_template.funding_source.formula_fund ? 'Formula' : 'Discretionary')
          - else
            %td.left= b.funding_template.funding_source.funding_source_type.name
          - if (current_user.organizations.ids & @organization_list).count > 1 || !@my_funds
            %td.left= b.owner.name
          %td.right= b.budget_amount
          %td.right= b.budget_committed
          %td.right= b.budget_remaining
          -unless b.funding_template.funding_source.life_in_years.nil?
            %td.left= format_as_fiscal_year(b.fiscal_year + b.funding_template.funding_source.life_in_years - 1)
          -else
            %td.left

          - if compact_columns == 0
            %td.center.nowrap{:data => {:field => 'action-cell'}}
              - if (can? :edit_bucket_app, b) && b.is_bucket_app?
                = link_to edit_bucket_app_funding_bucket_path(b) do
                  %i.fa.fa-edit.fa-1-5x.text-success
              - elsif (can? :update, b)
                = link_to edit_funding_bucket_path(b), :remote => true do
                  %i.fa.fa-edit.fa-1-5x.text-success

              - if (can? :destroy_bucket_app, b) && b.is_bucket_app?
                = link_to destroy_bucket_app_funding_bucket_path(b), :method => :delete, :data => {:confirm => "Are you sure you want to remove this grant application? The action can't be undone."} do
                  %i.fa.fa-trash-o.fa-1-5x.text-danger
<commit_msg>[fixes #136583923] Adds a delete button to the buckets table.<commit_after>:ruby
  table_dom_id = SecureRandom.hex

.table-responsive
  %table.table.table-hover{:id => table_dom_id, :data => {:toggle => 'table',
    :card_view => "false",
    :pagination => 'true',
    :show_pagination_switch => 'true',
    :page_list => "[5, 10, 20, 50, 100, 200]",
    :page_size => current_user.num_table_rows,
    :search => 'false',
    :toolbar => "#buckets_table_actions",
    :export_types => "['csv', 'txt', 'excel']",
    :show_export => 'true',
    :show_columns => 'true',
    :state_save => 'true',
    :state_save_id_table => "funding_buckets_id",
    :state_save_expire => "1y",
    :show_multi_sort => 'true',
    :sort_priority => '[{"sortName": "bucket_fy","sortOrder":"asc"},{"sortName":"bucket_owner","sortOrder":"asc"}]'}}

    %thead
      %tr
        - if compact_columns == 0
          %th.center{:data => {:visible => 'false'}} Object Key
        %th.center{:data => {:field => 'bucket_fy', :sortable => 'true'}} FY
        - if @funding_template.nil?
          %th.center{:data => {:sortable => 'true'}} Program (Template)
        %th.center{:data => {:sortable => 'true'}} Name
        %th.center{:data => {:sortable => 'true'}} Type
        - if (current_user.organizations.ids & @organization_list).count > 1 || !@my_funds
          %th.center{:data => {:field => 'bucket_owner', :sortable => 'true'}} Owner
        %th.center{:data => {:sortable => 'true', :formatter => 'currency_formatter'}} Total
        %th.center{:data => {:sortable => 'true', :formatter => 'currency_formatter'}} Committed
        %th.center{:data => {:sortable => 'true', :formatter => 'currency_formatter'}} Available
        %th.center{:data => {:sortable => 'true'}} Expires

        - if compact_columns == 0
          %th

    %tbody
      - buckets.each do |b|
        %tr{:id => b.object_key, :class => 'action-path'}
          - if compact_columns == 0
            %td.left= b.object_key
          %td.left= format_as_fiscal_year(b.fiscal_year)
          - if @funding_template.nil?
            %td.left= "#{b.funding_template.funding_source.name} (#{b.funding_template.name})"
          %td.left= "#{b.name}"
          - if @my_funds
            %td.left= b.is_bucket_app? ? 'Grant Application' : (b.funding_template.funding_source.formula_fund ? 'Formula' : 'Discretionary')
          - else
            %td.left= b.funding_template.funding_source.funding_source_type.name
          - if (current_user.organizations.ids & @organization_list).count > 1 || !@my_funds
            %td.left= b.owner.name
          %td.right= b.budget_amount
          %td.right= b.budget_committed
          %td.right= b.budget_remaining
          -unless b.funding_template.funding_source.life_in_years.nil?
            %td.left= format_as_fiscal_year(b.fiscal_year + b.funding_template.funding_source.life_in_years - 1)
          -else
            %td.left

          - if compact_columns == 0
            %td.center.nowrap{:data => {:field => 'action-cell'}}
              - if (can? :edit_bucket_app, b) && b.is_bucket_app?
                = link_to edit_bucket_app_funding_bucket_path(b) do
                  %i.fa.fa-edit.fa-1-5x.text-success
              - elsif (can? :update, b)
                = link_to edit_funding_bucket_path(b), :remote => true do
                  %i.fa.fa-edit.fa-1-5x.text-success

              - if can? :destroy, b
                = link_to destroy_bucket_app_funding_bucket_path(b), :method => :delete, :data => {:confirm => "Are you sure you want to remove this bucket? The action can't be undone."}  do
                  %i.fa.fa-trash-o.fa-1-5x.text-danger
              - elsif (can? :destroy_bucket_app, b) && b.is_bucket_app?
                = link_to destroy_bucket_app_funding_bucket_path(b), :method => :delete, :data => {:confirm => "Are you sure you want to remove this grant application? The action can't be undone."} do
                  %i.fa.fa-trash-o.fa-1-5x.text-danger

{'fraction_non_alphanumeric': 0.16404114047650045, 'fraction_numerical': 0.008462439786486135, 'mean_word_length': 2.5763500931098697, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 112, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2361932', 'n_tokens_mistral': 2727, 'n_tokens_neox': 2579, 'n_words': 481}