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 %>
| N. |
Regione |
Prov. |
Società |
M/F |
Email verificata |
Sito / profilo |
Streaming rilevato |
Evidenza / fit commerciale |
Test A/B |
Stato invio |
Data invio |
Esito |
Demo / Trial |
Conversione |
Piano |
Fonte contatto / ricerca |
Data verifica |
Note follow-up |
<% @organizations.each do |org| %>
<% opp = org.campaign_opportunity(current_project) %>
| <%= org.list_position || "—" %> |
<%= org.region.presence || "—" %> |
<%= org.province.presence || "—" %> |
<%= link_to org.name, org, class: "font-medium text-zinc-900 hover:underline dark:text-zinc-100" %>
|
<%= org.team_gender_label.presence || "—" %> |
<%= mailto_link(org.email, class: "text-sky-700 hover:underline dark:text-sky-400") %> |
<%= external_link(org.website, class: "text-sky-700 hover:underline dark:text-sky-400") %> |
<%= streaming_badge(org.streaming_status) || "—" %> |
<%= table_clip(org.commercial_fit) %> |
<%= opp&.ab_variant.present? ? ab_variant_badge(opp.ab_variant) : "—" %> |
<%= opp&.send_status_label.presence || "—" %> |
<%= format_date(opp&.sent_on) %> |
<%= table_clip(opp&.outcome, length: 24) %> |
<%= opp ? yes_no(opp.demo_trial) : "—" %> |
<%= opp ? yes_no(opp.converted) : "—" %> |
<%= opp&.product.presence || "—" %> |
<%= external_link(org.source_url, class: "text-sky-700 hover:underline dark:text-sky-400") %> |
<%= format_date(org.verified_at) %> |
<%= table_clip(org.notes) %> |
<% end %>
<%== pagy_nav(@pagy) if @pagy.pages > 1 %>