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.
73 lines
3.3 KiB
Plaintext
Executable File
73 lines
3.3 KiB
Plaintext
Executable File
<div class="card rounded-2xl <%= sold_out ? "border border-neutral-200 opacity-75" : "border border-neutral-200 " %>">
|
|
<div class="card-body p-6">
|
|
<div class="flex justify-between items-start mb-4">
|
|
<div>
|
|
<h3 class="text-xl font-bold text-primary <%= "text-slate-400" if sold_out %>"><%= name %></h3>
|
|
<p class="text-neutral-600 text-sm <%= "text-slate-400" if sold_out %>"><%= description %></p>
|
|
</div>
|
|
<div class="text-right">
|
|
<p class="text-2xl font-bold text-primary <%= "text-slate-400" if sold_out %>">
|
|
<%= number_to_currency(price_cents / 100.0, unit: "€") %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex justify-between items-center">
|
|
<div>
|
|
<p class="text-sm text-neutral-600 flex items-center">
|
|
<span class="inline-block"><%= quantity %> total •</span>
|
|
<% if sold_out %>
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-red-100 text-red-800 ml-2">
|
|
<svg class="-ml-0.5 mr-1.5 h-2 w-2 text-red-400" fill="currentColor" viewBox="0 0 8 8">
|
|
<circle cx="4" cy="4" r="3" />
|
|
</svg>
|
|
Sold Out
|
|
</span>
|
|
<% else %>
|
|
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-800 ml-2">
|
|
<svg class="-ml-0.5 mr-1.5 h-2 w-2 text-green-400" fill="currentColor" viewBox="0 0 8 8">
|
|
<circle cx="4" cy="4" r="3" />
|
|
</svg>
|
|
<%= remaining %> available
|
|
</span>
|
|
<% end %>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="flex justify-between items-right mt-4">
|
|
<% if sold_out %>
|
|
<div class="text-sm text-slate-500 font-medium">
|
|
<svg class="w-5 h-5 inline-block mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path>
|
|
</svg>
|
|
Unavailable
|
|
</div>
|
|
<% else %>
|
|
<div class="flex items-center space-x-2">
|
|
<button type="button"
|
|
class="w-8 h-8 rounded-full bg-slate-200 hover:bg-slate-300 flex items-center justify-center transition-colors duration-200"
|
|
onclick="decreaseQuantity(<%= id %>)">
|
|
<span class="text-slate-600">-</span>
|
|
</button>
|
|
<input type="number"
|
|
id="quantity_<%= id %>"
|
|
min="0"
|
|
max="<%= remaining %>"
|
|
value="0"
|
|
class="w-12 text-center border border-slate-300 rounded px-2 py-1 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2"
|
|
data-name="<%= name %>"
|
|
data-price="<%= price_cents %>"
|
|
onchange="updateCart(<%= id %>, this.dataset.name, this.dataset.price)">
|
|
<button type="button"
|
|
class="w-8 h-8 rounded-full bg-slate-200 hover:bg-slate-300 flex items-center justify-center transition-colors duration-200"
|
|
onclick="increaseQuantity(<%= id %>, <%= remaining %>)">
|
|
<span class="text-slate-600">+</span>
|
|
</button>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|