develop #3

Merged
kbe merged 227 commits from develop into main 2025-09-16 14:35:23 +00:00
Showing only changes of commit 28ef801c9a - Show all commits

View File

@@ -1,6 +1,15 @@
<% content_for(:title, @event.name) %> <% content_for(:title, @event.name) %>
<div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8"> <div class="max-w-6xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Breadcrumb -->
<%= 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 }
] %>
<!-- Header with actions --> <!-- Header with actions -->
<div class="mb-8"> <div class="mb-8">
<div class="flex items-center justify-between"> <div class="flex items-center justify-between">
@@ -29,9 +38,16 @@
<% end %> <% end %>
<% if @event.draft? %> <% 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 %> <% if @event.ticket_types.blank? %>
<i data-lucide="upload" class="w-4 h-4 mr-2"></i> <%= 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 <i data-lucide="upload" class="w-4 h-4 mr-2"></i>
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 %>
<i data-lucide="upload" class="w-4 h-4 mr-2"></i>
Publier
<% end %>
<% end %> <% end %>
<% elsif @event.published? %> <% 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 %> <%= 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 %>
@@ -63,6 +79,23 @@
</div> </div>
</div> </div>
</div> </div>
<% if @event.ticket_types.blank? %>
<div class="bg-amber-50 border border-amber-200 rounded-2xl p-4 mt-4">
<div class="flex items-center">
<i data-lucide="alert-triangle" class="w-5 h-5 text-amber-400 mr-3"></i>
<div>
<h3 class="text-sm font-medium text-amber-900">Aucun type de billet configuré</h3>
<p class="text-sm text-amber-700">Vous devez créer au moins un type de billet avant de pouvoir publier cet événement.</p>
</div>
<div class="ml-auto">
<%= link_to promoter_event_ticket_types_path(@event), class: "text-amber-600 hover:text-amber-800 font-medium text-sm" do %>
Configurer les billets <i data-lucide="external-link" class="w-4 h-4 inline ml-1"></i>
<% end %>
</div>
</div>
</div>
<% end %>
<% when "published" %> <% when "published" %>
<div class="bg-green-50 border border-green-200 rounded-2xl p-4"> <div class="bg-green-50 border border-green-200 rounded-2xl p-4">
<div class="flex items-center"> <div class="flex items-center">
@@ -178,10 +211,6 @@
<div class="bg-white rounded-2xl border border-gray-200 p-6"> <div class="bg-white rounded-2xl border border-gray-200 p-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Informations</h3> <h3 class="text-lg font-semibold text-gray-900 mb-4">Informations</h3>
<div class="space-y-4"> <div class="space-y-4">
<div>
<span class="text-sm text-gray-500">Slug</span>
<p class="font-mono text-sm"><%= @event.slug %></p>
</div>
<div> <div>
<span class="text-sm text-gray-500">Créé le</span> <span class="text-sm text-gray-500">Créé le</span>
<p class="text-sm"><%= @event.created_at.strftime("%d/%m/%Y à %H:%M") %></p> <p class="text-sm"><%= @event.created_at.strftime("%d/%m/%Y à %H:%M") %></p>