+
+
+ <%= render 'components/breadcrumb', crumbs: [
+ { name: 'Accueil', path: root_path },
+ { name: 'Tableau de bord', path: dashboard_path },
+ { name: 'Mes événements', path: promoter_events_path },
+ { name: @event.name }
+ ] %>
+
@@ -27,11 +36,18 @@
Modifier
<% end %>
-
+
<% if @event.draft? %>
- <%= button_to publish_promoter_event_path(@event), method: :patch, class: "inline-flex items-center px-4 py-2 bg-green-600 text-white font-medium rounded-lg hover:bg-green-700 transition-colors duration-200" do %>
-
- Publier
+ <% if @event.ticket_types.blank? %>
+ <%= button_to publish_promoter_event_path(@event), method: :patch, disabled: true, class: "inline-flex items-center px-4 py-2 bg-gray-400 text-white font-medium rounded-lg cursor-not-allowed transition-colors duration-200", title: "Vous devez créer au moins un type de billet avant de publier" do %>
+
+ Publier
+ <% end %>
+ <% else %>
+ <%= button_to publish_promoter_event_path(@event), method: :patch, class: "inline-flex items-center px-4 py-2 bg-green-600 text-white font-medium rounded-lg hover:bg-green-700 transition-colors duration-200" do %>
+
+ Publier
+ <% end %>
<% end %>
<% elsif @event.published? %>
<%= button_to unpublish_promoter_event_path(@event), method: :patch, class: "inline-flex items-center px-4 py-2 bg-yellow-600 text-white font-medium rounded-lg hover:bg-yellow-700 transition-colors duration-200" do %>
@@ -39,7 +55,7 @@
Dépublier
<% end %>
<% end %>
-
+
<% if @event.published? %>
<%= button_to cancel_promoter_event_path(@event), method: :patch, class: "inline-flex items-center px-4 py-2 bg-red-600 text-white font-medium rounded-lg hover:bg-red-700 transition-colors duration-200", data: { confirm: "Êtes-vous sûr de vouloir annuler cet événement ?" } do %>
@@ -63,6 +79,23 @@