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,31 @@
|
||||
<%= form_with model: mail_template, class: "grid gap-6 lg:grid-cols-[1fr_16rem]" do |f| %>
|
||||
<div class="space-y-6 rounded-xl border border-zinc-200 bg-white text-zinc-900 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-100 p-6">
|
||||
<%= render "shared/errors", object: mail_template %>
|
||||
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Nome</label>
|
||||
<%= f.text_field :name, required: true, class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium">Oggetto</label>
|
||||
<%= f.text_field :subject, required: true, class: input_class %>
|
||||
</div>
|
||||
<div>
|
||||
<%= render "shared/wysiwyg_field", form: f, method: :body_html, label: "Corpo HTML" %>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2 border-t border-zinc-100 pt-4 dark:border-zinc-800">
|
||||
<%= f.submit mail_template.new_record? ? "Crea template" : "Salva", class: btn_primary %>
|
||||
<%= link_to "Annulla", mail_templates_path, class: btn_secondary %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-4">
|
||||
<%= render "shared/merge_tokens" %>
|
||||
<% unless mail_template.new_record? %>
|
||||
<%= button_to "Elimina template", mail_template_path(mail_template), method: :delete,
|
||||
class: btn_danger,
|
||||
form: { data: { turbo_confirm: "Eliminare #{mail_template.name}?" } } %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="mx-auto max-w-5xl space-y-6">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Modifica template</h1>
|
||||
<p class="mt-1 text-sm text-zinc-500"><%= @mail_template.name %></p>
|
||||
</div>
|
||||
|
||||
<%= render "form", mail_template: @mail_template %>
|
||||
</div>
|
||||
@@ -0,0 +1,41 @@
|
||||
<div class="space-y-6">
|
||||
<div class="flex flex-wrap items-end justify-between gap-3">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Template email</h1>
|
||||
<p class="mt-1 text-sm text-zinc-500">
|
||||
<%= link_to "Invii", mailings_path, class: "hover:underline" %>
|
||||
· HTML riutilizzabile con variabili della scheda cliente.
|
||||
</p>
|
||||
</div>
|
||||
<%= link_to "Nuovo template", new_mail_template_path, class: btn_primary %>
|
||||
</div>
|
||||
|
||||
<div class="overflow-hidden <%= card_class %>">
|
||||
<% if @mail_templates.empty? %>
|
||||
<p class="p-6 text-sm text-zinc-500">Nessun template. Creane uno e usalo come base per gli invii.</p>
|
||||
<% else %>
|
||||
<table class="<%= table_class %>">
|
||||
<thead class="border-b border-zinc-100 bg-zinc-50 text-left text-xs font-medium uppercase tracking-wide text-zinc-500 dark:border-zinc-800 dark:bg-zinc-800 dark:text-zinc-400">
|
||||
<tr>
|
||||
<th class="px-4 py-3">Nome</th>
|
||||
<th class="px-4 py-3">Oggetto</th>
|
||||
<th class="px-4 py-3">Ambito</th>
|
||||
<th class="px-4 py-3"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-zinc-100 dark:divide-zinc-800">
|
||||
<% @mail_templates.each do |template| %>
|
||||
<tr>
|
||||
<td class="px-4 py-3 font-medium"><%= template.name %></td>
|
||||
<td class="px-4 py-3 text-zinc-600 dark:text-zinc-300"><%= template.subject %></td>
|
||||
<td class="px-4 py-3 text-zinc-500"><%= template.project_id? ? current_project.name : "Tutti i progetti" %></td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<%= link_to "Modifica", edit_mail_template_path(template), class: "text-zinc-700 hover:underline dark:text-zinc-300" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,8 @@
|
||||
<div class="mx-auto max-w-5xl space-y-6">
|
||||
<div>
|
||||
<h1 class="text-2xl font-semibold tracking-tight">Nuovo template</h1>
|
||||
<p class="mt-1 text-sm text-zinc-500">HTML con variabili {{campo}} dalla scheda del cliente.</p>
|
||||
</div>
|
||||
|
||||
<%= render "form", mail_template: @mail_template %>
|
||||
</div>
|
||||
Reference in New Issue
Block a user