Organizzazioni

<%= link_to "Export CSV", organizations_path(request.query_parameters.merge(format: :csv)), class: btn_secondary %> <%= link_to "Import CSV", new_import_path, class: btn_secondary %> <%= link_to "Nuova", new_organization_path, class: btn_primary %>
<%= 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 %> <%= text_field_tag :sport, params[:sport], placeholder: "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 %> <%= link_to "Reset", organizations_path, class: btn_secondary %>
<% end %>
<% @organizations.each do |org| %> <% opp = org.campaign_opportunity(current_project) %> <% end %>
N. Organizzazione Regione M/F Streaming Test Stage Invio
<%= org.list_position || "—" %> <%= link_to org.name, org, class: "font-medium text-zinc-900 hover:underline dark:text-zinc-100" %>
<%= org.email.presence || org.organization_type_label %>
<%= [org.region, org.province].compact_blank.join(" · ").presence || "—" %> <%= org.team_gender_label.presence || "—" %> <%= streaming_badge(org.streaming_status) || "—" %><%= opp&.ab_variant.presence || "—" %> <%= opp ? stage_badge(opp.pipeline_stage) : "—" %> <%= opp&.send_status_label.presence || "—" %>
<%== pagy_nav(@pagy) if @pagy.pages > 1 %>