Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
74 lines
5.0 KiB
ERB
74 lines
5.0 KiB
ERB
<div class="space-y-4">
|
|
<div class="flex flex-wrap items-center justify-between gap-3">
|
|
<h1 class="text-2xl font-semibold">Organizzazioni</h1>
|
|
<div class="flex gap-2">
|
|
<%= 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 %>
|
|
</div>
|
|
</div>
|
|
|
|
<%= form_with url: organizations_path, method: :get, class: "#{card_class} p-4" do %>
|
|
<div class="grid gap-3 md:grid-cols-3 xl:grid-cols-4">
|
|
<%= 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 %>
|
|
<label class="flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-300">
|
|
<%= check_box_tag :overdue_tasks, "1", params[:overdue_tasks] == "1" %>
|
|
Task scaduti
|
|
</label>
|
|
<%= 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 %>
|
|
</div>
|
|
<div class="mt-3 flex gap-2">
|
|
<%= submit_tag "Filtra", class: btn_primary %>
|
|
<%= link_to "Reset", organizations_path, class: btn_secondary %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<div class="overflow-hidden rounded-xl border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-100">
|
|
<table class="min-w-full divide-y divide-zinc-100 dark:divide-zinc-800 text-sm">
|
|
<thead class="bg-zinc-50 text-left text-xs uppercase tracking-wide text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400">
|
|
<tr>
|
|
<th class="px-4 py-3">N.</th>
|
|
<th class="px-4 py-3">Organizzazione</th>
|
|
<th class="px-4 py-3">Regione</th>
|
|
<th class="px-4 py-3">M/F</th>
|
|
<th class="px-4 py-3">Streaming</th>
|
|
<th class="px-4 py-3">Test</th>
|
|
<th class="px-4 py-3">Stage</th>
|
|
<th class="px-4 py-3">Invio</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
|
|
<% @organizations.each do |org| %>
|
|
<tr class="hover:bg-zinc-50 dark:hover:bg-zinc-800/80">
|
|
<td class="px-4 py-3 tabular-nums text-zinc-500"><%= org.list_position || "—" %></td>
|
|
<td class="px-4 py-3">
|
|
<%= link_to org.name, org, class: "font-medium text-zinc-900 hover:underline dark:text-zinc-100" %>
|
|
<div class="text-xs text-slate-500"><%= org.email.presence || org.organization_type_label %></div>
|
|
</td>
|
|
<td class="px-4 py-3"><%= [org.region, org.province].compact_blank.join(" · ").presence || "—" %></td>
|
|
<td class="px-4 py-3"><%= org.team_gender_label.presence || "—" %></td>
|
|
<td class="px-4 py-3"><%= streaming_badge(org.streaming_status) || "—" %></td>
|
|
<% opp = org.campaign_opportunity(current_project) %>
|
|
<td class="px-4 py-3"><%= opp&.ab_variant.presence || "—" %></td>
|
|
<td class="px-4 py-3"><%= opp ? stage_badge(opp.pipeline_stage) : "—" %></td>
|
|
<td class="px-4 py-3"><%= opp&.send_status_label.presence || "—" %></td>
|
|
</tr>
|
|
<% end %>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<%== pagy_nav(@pagy) if @pagy.pages > 1 %>
|
|
</div>
|