Permette di correggere la timeline e ripristina la ricerca in alto.
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>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<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>
|
||||
@@ -70,8 +70,9 @@
|
||||
<span class="truncate"><%= current_project.name %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= form_with url: search_path, method: :get, class: "min-w-0 flex-1" do %>
|
||||
<%= text_field_tag :q, params[:q], placeholder: "Cerca…", class: "#{input_class} min-h-10 py-2", aria: { label: "Cerca in #{current_project.name}" } %>
|
||||
<%= form_with url: search_path, method: :get, authenticity_token: false, class: "flex min-w-0 flex-1 items-center gap-1.5", data: { turbo: false } do %>
|
||||
<%= search_field_tag :q, params[:q], placeholder: "Cerca…", class: "#{input_class} min-h-10 py-2", aria: { label: "Cerca in #{current_project.name}" }, autocomplete: "off" %>
|
||||
<%= submit_tag "Cerca", class: "#{btn_secondary} shrink-0 px-3" %>
|
||||
<% end %>
|
||||
<div class="relative shrink-0" data-controller="dropdown">
|
||||
<button type="button" data-action="dropdown#toggle" class="<%= btn_primary %> px-3">
|
||||
|
||||
@@ -177,9 +177,13 @@
|
||||
<div class="text-xs font-medium text-slate-500"><%= format_dt(activity.happened_at) %></div>
|
||||
<div class="font-medium text-zinc-900 dark:text-zinc-100"><%= activity.activity_type_label %>: <%= activity.subject %></div>
|
||||
<% if activity.description.present? %>
|
||||
<div class="mt-0.5 whitespace-pre-wrap text-sm text-slate-600"><%= activity.description %></div>
|
||||
<div class="mt-0.5 whitespace-pre-wrap text-sm text-slate-600 dark:text-zinc-300"><%= activity.description %></div>
|
||||
<% end %>
|
||||
<div class="mt-0.5 text-xs text-slate-400"><%= activity.user&.full_name || "Utente rimosso" %><% if activity.contact %> · <%= activity.contact.full_name %><% end %></div>
|
||||
<div class="mt-1 flex flex-wrap items-center gap-3 text-xs">
|
||||
<%= link_to "Modifica", edit_organization_activity_path(@organization, activity), class: "font-medium text-zinc-600 hover:underline dark:text-zinc-300" %>
|
||||
<%= button_to "Elimina", organization_activity_path(@organization, activity), method: :delete, form: { data: { turbo_confirm: "Eliminare questa voce dalla timeline?" }, class: "inline" }, class: "font-medium text-rose-600 hover:underline dark:text-rose-400" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% if @activities.blank? %><p class="text-sm text-slate-500">Nessuna attività.</p><% end %>
|
||||
|
||||
Reference in New Issue
Block a user