Le voci si possono modificare o eliminare se registrate per errore, e la ricerca non va più in errore SQL sul campo email. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1.5 KiB
ERB
37 lines
1.5 KiB
ERB
<div class="mx-auto max-w-2xl space-y-4">
|
|
<h1 class="text-xl font-semibold md:text-2xl">Modifica attività</h1>
|
|
<p class="text-sm text-zinc-500"><%= @organization.name %></p>
|
|
|
|
<%= form_with model: [@organization, @activity], class: "#{card_class} p-4 md:p-6 space-y-5" do |f| %>
|
|
<%= render "shared/errors", object: @activity %>
|
|
|
|
<div class="space-y-1">
|
|
<%= f.label :activity_type, "Tipo", class: "block text-sm font-medium" %>
|
|
<%= f.select :activity_type, Catalog::ACTIVITY_TYPES.map { |k, v| [v, k] }, {}, class: input_class %>
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<%= f.label :subject, "Oggetto", class: "block text-sm font-medium" %>
|
|
<%= f.text_field :subject, required: true, class: input_class %>
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<%= f.label :description, "Descrizione", class: "block text-sm font-medium" %>
|
|
<%= f.text_area :description, rows: 4, class: input_class %>
|
|
</div>
|
|
|
|
<div class="space-y-1">
|
|
<%= f.label :happened_at, "Data e ora", class: "block text-sm font-medium" %>
|
|
<%= f.datetime_local_field :happened_at,
|
|
value: @activity.happened_at&.in_time_zone&.strftime("%Y-%m-%dT%H:%M"),
|
|
required: true,
|
|
class: input_class %>
|
|
</div>
|
|
|
|
<div class="flex flex-col gap-2 border-t border-zinc-100 pt-4 sm:flex-row dark:border-zinc-800">
|
|
<%= f.submit "Salva modifiche", class: "#{btn_primary} w-full sm:w-auto" %>
|
|
<%= link_to "Annulla", @organization, class: "#{btn_secondary} w-full sm:w-auto" %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|