Organizzazioni

<%= link_to "Export CSV", organizations_path(request.query_parameters.merge(format: :csv)), class: "#{btn_secondary} flex-1 sm:flex-none" %> <%= link_to "Import CSV", new_import_path, class: "#{btn_secondary} flex-1 sm:flex-none" %> <%= link_to "Nuova", new_organization_path, class: "#{btn_primary} flex-1 sm:flex-none" %>
<%= form_with url: organizations_path, method: :get, class: "#{card_class} p-4" do %>
<%= text_field_tag :q, params[:q], placeholder: "Cerca nome, città, contatto, email…", class: "#{input_class} md:col-span-2" %> <%= select_tag :status, options_for_catalog(Catalog::ORGANIZATION_STATUSES, params[:status]), include_blank: "Stato", class: input_class %> <%= select_tag :pipeline_stage, options_for_catalog(Catalog::PIPELINE_STAGES, params[:pipeline_stage]), include_blank: "Pipeline stage", class: input_class %> <%= select_tag :owner, options_from_collection_for_select(User.active.order(:first_name), :id, :full_name, params[:owner]), include_blank: "Owner", class: input_class %> <%= select_tag :lead_source, options_for_catalog(Catalog::LEAD_SOURCES, params[:lead_source]), include_blank: "Fonte", class: input_class %> <%= select_tag :organization_type, options_for_catalog(Catalog::ORGANIZATION_TYPES, params[:organization_type]), include_blank: "Tipologia", class: input_class %> <%= select_tag :sport, options_for_select(@sport_options, params[:sport]), include_blank: "Sport", class: input_class %> <%= text_field_tag :country, params[:country], placeholder: "Paese", class: input_class %> <%= text_field_tag :region, params[:region], placeholder: "Regione", class: input_class %> <%= select_tag :customer, options_for_select([["Cliente/non cliente", ""], ["Solo clienti", "yes"], ["Non clienti", "no"]], params[:customer]), class: input_class %> <%= select_tag :team_gender, options_for_catalog(Catalog::TEAM_GENDERS, params[:team_gender]), include_blank: "M/F", class: input_class %> <%= select_tag :streaming_status, options_for_catalog(Catalog::STREAMING_STATUSES, params[:streaming_status]), include_blank: "Streaming", class: input_class %> <%= select_tag :ab_variant, options_for_catalog(Catalog::AB_VARIANTS, params[:ab_variant]), include_blank: "Test A/B", class: input_class %> <%= select_tag :sort, options_for_select([["Lista campagna", "lista"], ["Aggiornate", "updated"], ["Nome", "name"], ["Create", "created"]], params[:sort]), class: input_class %>
<%= submit_tag "Filtra", class: "#{btn_primary} flex-1 sm:flex-none" %> <%= link_to "Reset", organizations_path, class: "#{btn_secondary} flex-1 sm:flex-none" %>
<% end %>
<% @organizations.each do |org| %> <% opp = org.campaign_opportunity(current_project) %> <%= link_to org, class: "#{card_class} block p-4 active:bg-zinc-50 dark:active:bg-zinc-800" do %>
<%= org.name %>
<%= [org.list_position, org.region, org.province].compact_blank.join(" · ").presence || "—" %>
<%= opp ? stage_badge(opp.pipeline_stage) : nil %>
<%= org.email.presence || "—" %>
<%= streaming_badge(org.streaming_status) %> <% if opp&.ab_variant.present? %><%= ab_variant_badge(opp.ab_variant) %><% end %> <%= opp&.send_status_label.presence || "Invio n/d" %>
<% end %> <% end %> <% if @organizations.blank? %>

Nessuna organizzazione.

<% end %>
<%== pagy_nav(@pagy) if @pagy.pages > 1 %>