Commit iniziale di eminuxCRM: CRM Rails con pipeline, campagne email e Docker.
Include autenticazione, progetti isolati, mail marketing HTML con SMTP, test A/B e editor WYSIWYG. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<div class="mx-auto max-w-2xl space-y-4">
|
||||
<h1 class="text-2xl font-semibold"><%= @contact.new_record? ? "Nuovo contatto" : "Modifica contatto" %></h1>
|
||||
<%= form_with model: @contact, class: "#{card_class} p-6 space-y-4" do |f| %>
|
||||
<%= render "shared/errors", object: @contact %>
|
||||
<%= f.label :organization_id, class: "mb-1 block text-sm font-medium" %>
|
||||
<%= f.collection_select :organization_id, @organizations, :id, :name, {}, class: input_class %>
|
||||
<div class="grid gap-4 sm:grid-cols-2">
|
||||
<%= f.text_field :first_name, placeholder: "Nome", required: true, class: input_class %>
|
||||
<%= f.text_field :last_name, placeholder: "Cognome", required: true, class: input_class %>
|
||||
<%= f.text_field :role, placeholder: "Ruolo", class: input_class %>
|
||||
<%= f.email_field :email, placeholder: "Email", class: input_class %>
|
||||
<%= f.text_field :phone, placeholder: "Telefono", class: input_class %>
|
||||
<%= f.text_field :mobile, placeholder: "Cellulare", class: input_class %>
|
||||
<%= f.select :preferred_contact_method, Catalog::CONTACT_METHODS.map { |k,v| [v,k] }, {}, class: input_class %>
|
||||
</div>
|
||||
<label class="flex items-center gap-2 text-sm"><%= f.check_box :primary_contact %> Contatto principale</label>
|
||||
<%= f.text_area :notes, rows: 3, placeholder: "Note", class: input_class %>
|
||||
<div class="flex gap-2">
|
||||
<%= f.submit class: btn_primary %>
|
||||
<%= link_to "Annulla", @contact.persisted? ? @contact.organization : contacts_path, class: btn_secondary %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
<%= render "form" %>
|
||||
@@ -0,0 +1,31 @@
|
||||
<div class="space-y-4">
|
||||
<div class="flex items-center justify-between">
|
||||
<h1 class="text-2xl font-semibold">Contatti</h1>
|
||||
<div class="flex gap-2">
|
||||
<%= link_to "Export CSV", contacts_path(format: :csv), class: btn_secondary %>
|
||||
<%= link_to "Nuovo", new_contact_path, class: btn_primary %>
|
||||
</div>
|
||||
</div>
|
||||
<%= form_with url: contacts_path, method: :get, class: "flex gap-2" do %>
|
||||
<%= text_field_tag :q, params[:q], placeholder: "Cerca…", class: input_class %>
|
||||
<%= submit_tag "Cerca", class: btn_primary %>
|
||||
<% 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="<%= table_class %>">
|
||||
<thead class="bg-zinc-50 text-left text-xs uppercase text-zinc-500 dark:bg-zinc-800 dark:text-zinc-400">
|
||||
<tr><th class="px-4 py-3">Nome</th><th class="px-4 py-3">Organizzazione</th><th class="px-4 py-3">Email</th><th class="px-4 py-3">Telefono</th></tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
|
||||
<% @contacts.each do |c| %>
|
||||
<tr>
|
||||
<td class="px-4 py-3 font-medium"><%= link_to c.full_name, c.organization, class: "hover:underline" %><% if c.primary_contact? %> ★<% end %></td>
|
||||
<td class="px-4 py-3"><%= c.organization.name %></td>
|
||||
<td class="px-4 py-3"><%= c.email %></td>
|
||||
<td class="px-4 py-3"><%= c.phone.presence || c.mobile %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<%== pagy_nav(@pagy) if @pagy.pages > 1 %>
|
||||
</div>
|
||||
@@ -0,0 +1 @@
|
||||
<%= render "form" %>
|
||||
@@ -0,0 +1,11 @@
|
||||
<div class="space-y-4">
|
||||
<h1 class="text-2xl font-semibold"><%= @contact.full_name %></h1>
|
||||
<div class="rounded-xl border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-100 p-5 text-sm">
|
||||
<p><strong>Organizzazione:</strong> <%= link_to @contact.organization.name, @contact.organization %></p>
|
||||
<p><strong>Ruolo:</strong> <%= @contact.role %></p>
|
||||
<p><strong>Email:</strong> <%= @contact.email %></p>
|
||||
<p><strong>Telefono:</strong> <%= @contact.phone %></p>
|
||||
<p><strong>Cellulare:</strong> <%= @contact.mobile %></p>
|
||||
<%= link_to "Modifica", edit_contact_path(@contact), class: "mt-4 inline-block text-emerald-700 dark:text-emerald-400" %>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user