diff --git a/app/views/promoter/events/show.html.erb b/app/views/promoter/events/show.html.erb index f27e271..71428e7 100644 --- a/app/views/promoter/events/show.html.erb +++ b/app/views/promoter/events/show.html.erb @@ -1,6 +1,15 @@ <% content_for(:title, @event.name) %>
+ + + <%= 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 @@
+ + <% if @event.ticket_types.blank? %> +
+
+ +
+

Aucun type de billet configuré

+

Vous devez créer au moins un type de billet avant de pouvoir publier cet événement.

+
+
+ <%= link_to promoter_event_ticket_types_path(@event), class: "text-amber-600 hover:text-amber-800 font-medium text-sm" do %> + Configurer les billets + <% end %> +
+
+
+ <% end %> <% when "published" %>
@@ -99,7 +132,7 @@
<% end %> - + <% if @event.featured? %>
@@ -178,10 +211,6 @@

Informations

-
- Slug -

<%= @event.slug %>

-
Créé le

<%= @event.created_at.strftime("%d/%m/%Y à %H:%M") %>

@@ -218,7 +247,7 @@ Marquer comme complet <% end %>
- <%= button_to promoter_event_path(@event), method: :delete, + <%= button_to promoter_event_path(@event), method: :delete, data: { confirm: "Êtes-vous sûr de vouloir supprimer cet événement ? Cette action est irréversible." }, class: "w-full inline-flex items-center px-4 py-2 text-red-600 font-medium rounded-lg hover:bg-red-50 transition-colors duration-200" do %> @@ -228,4 +257,4 @@
-
\ No newline at end of file +