Files
aperonight/app/views/events/index.html.erb
Kevin BATAILLE 30f3ecc6ad refactor(events): replace parties concept with events throughout the application
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>

This commit refactors the entire application to replace the 'parties' concept with 'events'. All controllers, models, views, and related files have been updated to reflect this change. The parties table has been replaced with an events table, and all related functionality has been updated accordingly.
2025-08-28 13:20:51 +02:00

54 lines
2.5 KiB
Plaintext
Executable File

<div class="container mx-auto px-4 sm:px-6 lg:px-8 py-8">
<h1 class="text-3xl font-bold text-gray-900 mb-8">Événements à venir</h1>
<% if @events.any? %>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<% @events.each do |event| %>
<div class="bg-white rounded-lg shadow-md overflow-hidden hover:shadow-lg transition-shadow duration-300">
<div class="p-6">
<div class="flex justify-between items-start">
<div>
<h2 class="text-xl font-bold text-gray-900"><%= event.name %></h2>
<p class="text-sm text-gray-500 mt-1"><%= event.user.email %></p>
</div>
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-purple-100 text-purple-800">
<%= event.start_time.strftime("%d/%m/%Y") %>
</span>
</div>
<div class="mt-4">
<p class="text-gray-600 text-sm line-clamp-2"><%= event.description.truncate(100) %></p>
</div>
<div class="mt-4 flex justify-between items-center">
<div>
<% if event.ticket_types.any? %>
<p class="text-sm font-medium text-gray-900">
À partir de <%= format_price(event.ticket_types.minimum(:price_cents)) %>€
</p>
<% else %>
<p class="text-sm text-gray-500">Pas de billets disponibles</p>
<% end %>
</div>
<%= link_to "Voir les détails", event_path(event.slug, event), class: "inline-flex items-center px-3 py-1.5 border border-transparent text-xs font-medium rounded-full shadow-sm text-white bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500" %>
</div>
</div>
</div>
<% end %>
</div>
<div class="mt-8">
<%# paginate @events, theme: 'twitter_bootstrap' %>
<%= paginate @events %>
</div>
<% else %>
<div class="text-center py-12">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" />
</svg>
<h3 class="mt-2 text-sm font-medium text-gray-900">Aucun événement disponible</h3>
<p class="mt-1 text-sm text-gray-500">Il n'y a aucun événement à venir pour le moment.</p>
</div>
<% end %>