|  | 
| 1 | 1 | <%# locals: (form:, field_name:, disabled:, events:, default_event:, lazy_load_balances: false, sending: false, receiving: false, allow_custom_events: false) %> | 
| 2 | 2 | 
 | 
| 3 | 3 | <div class="field" data-controller="organization-select"> | 
| 4 |  | -    <%= form.label field_name, sending ? "From" : "To" %> | 
| 5 |  | -    <select name="disbursement[<%= field_name %>]" id="disbursement_<%= field_name %>" <%= "disabled" if disabled %> class="bg-[transparent] dark:bg-darkless input input--select flex items-center select-none cursor-pointer disabled:cursor-default" data-organization-select-target="dropdown"> | 
| 6 |  | -        <option value>Select one...</option> | 
| 7 |  | -        <option <%= "default" if default_event.present? %> value="<%= default_event.public_id if default_event.present? %>"><%= default_event.name if default_event.present? %></option> | 
| 8 |  | -    </select> | 
|  | 4 | +  <%= form.label field_name, sending ? "From" : "To" %> | 
|  | 5 | +  <select name="disbursement[<%= field_name %>]" id="disbursement_<%= field_name %>" <%= "disabled" if disabled %> class="bg-[transparent] dark:bg-darkless input input--select flex items-center select-none cursor-pointer disabled:cursor-default" data-organization-select-target="dropdown"> | 
|  | 6 | +    <option value>Select one...</option> | 
|  | 7 | +    <option <%= "default" if default_event.present? %> value="<%= default_event.public_id if default_event.present? %>"><%= default_event.name if default_event.present? %></option> | 
|  | 8 | +  </select> | 
| 9 | 9 | 
 | 
| 10 |  | -    <div data-organization-select-target="wrapper" style="max-width: 384px;"> | 
| 11 |  | -        <input data-organization-select-target="search" style="display: none; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;" type="text" placeholder="Search"> | 
|  | 10 | +  <div data-organization-select-target="wrapper" style="max-width: 384px;"> | 
|  | 11 | +    <input data-organization-select-target="search" style="display: none; border-bottom-left-radius: 0px; border-bottom-right-radius: 0px;" type="text" placeholder="Search"> | 
| 12 | 12 | 
 | 
| 13 |  | -        <div data-organization-select-target="menu" style="display: none; border-width: 1px; border-style: solid; border-top: none; max-width: 384px; border-top-left-radius: 0px; border-top-right-radius: 0px;" class="border-smoke rounded-md dark:border-black overflow-hidden h-40"> | 
| 14 |  | -            <div class="w-full h-full rounded-md overflow-y-scroll" style="border-top-left-radius: 0px; border-top-right-radius: 0px; content-visibility: auto;"> | 
| 15 |  | -                <div> | 
| 16 |  | -                    <% events.each_with_index.map do |event, i| %> | 
| 17 |  | -                    <% disabled_message = nil %> | 
| 18 |  | -                    <% disabled_message = "Insufficient balance" if sending && !admin_signed_in? && event.balance_available <= 0 %> | 
| 19 |  | -                    <% disabled_message = "HCB transfers disabled" if sending && !policy(event).create_transfer? %> | 
| 20 |  | -                    <div data-id="<%= event.public_id %>" data-slug="<%= event.slug %>" data-name="<%= event.name %>" data-organization-select-target="organization" style="<%= i > 50 ? "display: none" : "" %>" data-index="<%= i %>"> | 
| 21 |  | -                        <button <%= "disabled" if disabled_message %> aria-label="<%= disabled_message %>" class="<%= "tooltipped tooltipped--i" if disabled_message %> text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150" type="button"> | 
| 22 |  | -                            <div class="text-left <%= "tooltipped tooltipped--e" if admin_signed_in? %>" aria-label="<%= "ID: #{event.id}" if admin_signed_in? %>"><%= event.name %></div> | 
|  | 13 | +    <div data-organization-select-target="menu" style="display: none; border-width: 1px; border-style: solid; border-top: none; max-width: 384px; border-top-left-radius: 0px; border-top-right-radius: 0px;" class="border-smoke rounded-md dark:border-black overflow-hidden h-40"> | 
|  | 14 | +      <div class="w-full h-full rounded-md overflow-y-scroll" style="border-top-left-radius: 0px; border-top-right-radius: 0px; content-visibility: auto;"> | 
|  | 15 | +        <div> | 
|  | 16 | +          <% events.each_with_index.map do |event, i| %> | 
|  | 17 | +            <% disabled_message = nil %> | 
|  | 18 | +            <% disabled_message = "Insufficient balance" if sending && !admin_signed_in? && event.balance_available <= 0 %> | 
|  | 19 | +            <% disabled_message = "HCB transfers disabled" if sending && !policy(event).create_transfer? %> | 
|  | 20 | +            <div data-id="<%= event.public_id %>" data-slug="<%= event.slug %>" data-name="<%= event.name %>" data-organization-select-target="organization" style="<%= i > 50 ? "display: none" : "" %>" data-index="<%= i %>"> | 
|  | 21 | +              <button <%= "disabled" if disabled_message %> aria-label="<%= disabled_message %>" class="<%= "tooltipped tooltipped--i" if disabled_message %> text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150" type="button"> | 
|  | 22 | +                <div class="text-left <%= "tooltipped tooltipped--e" if admin_signed_in? %>" aria-label="<%= "ID: #{event.id}" if admin_signed_in? %>"><%= event.name %></div> | 
| 23 | 23 | 
 | 
| 24 |  | -                            <div class="text-muted pl-2"> | 
| 25 |  | -                              <%= turbo_frame_tag "event_balance_#{event.public_id}", src: event_async_balance_path(event, symbol: true), data: { turbo_permanent: true, controller: "cached-frame", action: "turbo:frame-render->cached-frame#cache" }, loading: :lazy do %> | 
| 26 |  | -                                  <strong>-</strong> | 
| 27 |  | -                              <% end %> | 
| 28 |  | -                            </div> | 
| 29 |  | -                        </button> | 
| 30 |  | -                        <hr class="my-0"> | 
| 31 |  | -                    </div> | 
| 32 |  | -                    <% end %> | 
| 33 |  | -                    <% if receiving && allow_custom_events %> | 
| 34 |  | -                    <div data-id="other" data-organization-select-target="other"> | 
| 35 |  | -                        <button class="text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150"> | 
| 36 |  | -                            <div class="text-left other-name"></div> | 
| 37 |  | -                            <div></div> | 
| 38 |  | -                        </button> | 
| 39 |  | -                        <hr class="my-0"> | 
| 40 |  | -                    </div> | 
| 41 |  | -                    <% end %> | 
|  | 24 | +                <div class="text-muted pl-2"> | 
|  | 25 | +                  <%= turbo_frame_tag "event_balance_#{event.public_id}", src: event_async_balance_path(event, symbol: true), data: { turbo_permanent: true, controller: "cached-frame", action: "turbo:frame-render->cached-frame#cache" }, loading: :lazy do %> | 
|  | 26 | +                    <strong>-</strong> | 
|  | 27 | +                  <% end %> | 
| 42 | 28 |                 </div> | 
|  | 29 | +              </button> | 
|  | 30 | +              <hr class="my-0"> | 
| 43 | 31 |             </div> | 
|  | 32 | +          <% end %> | 
|  | 33 | +          <% if receiving && allow_custom_events %> | 
|  | 34 | +            <div data-id="other" data-organization-select-target="other"> | 
|  | 35 | +              <button class="text-[length:inherit] border-none bg-[transparent] w-full flex justify-between p-2 cursor-pointer disabled:cursor-default hover:bg-smoke hover:dark:bg-darkless transition-colors duration-150"> | 
|  | 36 | +                <div class="text-left other-name"></div> | 
|  | 37 | +                <div></div> | 
|  | 38 | +              </button> | 
|  | 39 | +              <hr class="my-0"> | 
|  | 40 | +            </div> | 
|  | 41 | +          <% end %> | 
| 44 | 42 |         </div> | 
|  | 43 | +      </div> | 
| 45 | 44 |     </div> | 
| 46 |  | - | 
|  | 45 | +  </div> | 
| 47 | 46 | </div> | 
0 commit comments