feat: complete promoter payout system with Stripe Connect onboarding
This commit is contained in:
@@ -1,2 +1,39 @@
|
||||
<h1>Promoter::Payouts#index</h1>
|
||||
<p>Find me in app/views/promoter/payouts/index.html.erb</p>
|
||||
<div class="container mx-auto px-4 py-8">
|
||||
<h1 class="text-3xl font-bold mb-6">My Payouts</h1>
|
||||
|
||||
<% if @events.any? %>
|
||||
<div class="grid gap-6 md:grid-cols-2 lg:grid-cols-3">
|
||||
<% @events.each do |event| %>
|
||||
<div class="bg-white rounded-lg shadow-md p-6">
|
||||
<h3 class="text-xl font-semibold mb-2"><%= event.name %></h3>
|
||||
<p class="text-gray-600 mb-2">Date: <%= event.start_time.strftime('%B %d, %Y at %I:%M %p') %></p>
|
||||
<p class="text-gray-600 mb-4">Status: <span class="font-medium"><%= event.payout_status.humanize %></span></p>
|
||||
|
||||
<% if event.earnings.pending.any? %>
|
||||
<div class="mb-4">
|
||||
<p class="text-lg font-semibold text-green-600">Gross: €<%= (event.total_earnings_cents / 100.0).round(2) %></p>
|
||||
<p class="text-sm text-gray-500">Fees (10%): €<%= (event.total_fees_cents / 100.0).round(2) %></p>
|
||||
<p class="text-lg font-semibold text-blue-600">Net: €<%= (event.net_earnings_cents / 100.0).round(2) %></p>
|
||||
</div>
|
||||
|
||||
<% if event.can_request_payout? %>
|
||||
<%= button_to "Request Payout", promoter_payouts_path(event_id: event.id),
|
||||
method: :post,
|
||||
class: "w-full bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
|
||||
<% else %>
|
||||
<p class="text-sm text-gray-500">Payout not available yet</p>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<p class="text-gray-500">No pending earnings</p>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="text-center py-12">
|
||||
<h2 class="text-2xl font-semibold mb-2">No events found</h2>
|
||||
<p class="text-gray-600 mb-4">You haven't created any events yet.</p>
|
||||
<%= link_to "Create Event", new_promoter_event_path, class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded" %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user