-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bbc804
commit 61a238f
Showing
14 changed files
with
325 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
defmodule ElixirConfAfrica.Transaction do | ||
defstruct [:reference, :amount, :status, :currency, :paid_at, :email, :bank] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
111 changes: 75 additions & 36 deletions
111
lib/elixir_conf_africa_web/live/paid_ticket_live/index.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,80 @@ | ||
<div class="flex justify-between items-center"> | ||
<h1 class="text-2xl font-bold">Listing Paid Tickets</h1> | ||
</div> | ||
|
||
<table class="w-[100%] mt-4"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th>Ticket id</th> | ||
<th>Quantity</th> | ||
<th>Amount</th> | ||
<th>Type</th> | ||
<th>Email Action</th> | ||
</tr> | ||
</thead> | ||
<tbody class="p-2 text-center " id="ticket"> | ||
<%= for ticket <- @ticket_collection do %> | ||
<tr id={"ticket-#{ticket.id}"}> | ||
<td><%= ticket.name %></td> | ||
<td><%= ticket.email %></td> | ||
<td><%= ticket.ticketid %></td> | ||
<td><%= ticket.quantity %></td> | ||
<td><%= ticket.cost %> KSH /=</td> | ||
<td><%= ticket.ticket_type.name %></td> | ||
<td> | ||
<div class="flex justify-center items-center p-2 rounded-md "> | ||
<button | ||
class="bg-green-500 text-white p-2 rounded-md" | ||
phx-click="send_email" | ||
phx-value-ticketid={ticket.ticketid} | ||
id={"send-email-#{ticket.id}"} | ||
> | ||
Send Email | ||
</button> | ||
</div> | ||
</td> | ||
<div class="h-[80vh]"> | ||
<table class="w-[100%] mt-4"> | ||
<thead class="w-[100%]"> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th>Ticket id</th> | ||
<th>Quantity</th> | ||
<th>Amount</th> | ||
<th>Type</th> | ||
<th>Email Action</th> | ||
</tr> | ||
</thead> | ||
<tbody class="p-2 text-center " id="ticket"> | ||
<%= for ticket <- @ticket_collection do %> | ||
<tr id={"ticket-#{ticket.id}"}> | ||
<td><%= ticket.name %></td> | ||
<td><%= ticket.email %></td> | ||
<td><%= ticket.ticketid %></td> | ||
<td><%= ticket.quantity %></td> | ||
<td><%= ticket.cost %> KSH /=</td> | ||
<td><%= ticket.ticket_type.name %></td> | ||
<td> | ||
<div class="flex justify-center items-center p-2 rounded-md "> | ||
<button | ||
class="bg-green-500 text-white p-2 rounded-md" | ||
phx-click="send_email" | ||
phx-value-ticketid={ticket.ticketid} | ||
id={"send-email-#{ticket.id}"} | ||
> | ||
Send Email | ||
</button> | ||
</div> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="flex items-center mt-4"> | ||
<div> | ||
<%= if @page_number > 1 do %> | ||
<.link navigate={~p"/tickets/paid?page=#{@page_number - 1}"}> | ||
<div class="flex gap-2 items-center "> | ||
Previous | ||
</div> | ||
</.link> | ||
<% end %> | ||
</div> | ||
|
||
<div style="display: flex; flex-direction: row; padding: 2px;"> | ||
<%= for idx <- Enum.to_list(1..@total_pages) do %> | ||
<.link navigate={~p"/tickets/paid?page=#{idx}"}> | ||
<%= if @page_number == idx do %> | ||
<p style="border: 1px solid black; padding-left: 5px; padding-right: 5px;"> | ||
<%= idx %> | ||
</p> | ||
<% else %> | ||
<p style="padding-left: 5px; padding-right: 5px;"> | ||
<%= idx %> | ||
</p> | ||
<% end %> | ||
</.link> | ||
<% end %> | ||
</div> | ||
|
||
<div> | ||
<%= if @page_number < @total_pages do %> | ||
<.link navigate={~p"/tickets/paid?page=#{@page_number + 1}"}> | ||
<div class="flex gap-2 items-center "> | ||
Next | ||
</div> | ||
</.link> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 63 additions & 24 deletions
87
lib/elixir_conf_africa_web/live/refunded_ticket_live/index.html.heex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,72 @@ | ||
<div class="flex justify-between items-center"> | ||
<h1 class="text-2xl font-bold">Listing Refunded Tickets</h1> | ||
</div> | ||
|
||
<table class="w-[100%] mt-4"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th>Ticket id</th> | ||
<th>Quantity</th> | ||
<th>Amount</th> | ||
<th>Type</th> | ||
</tr> | ||
</thead> | ||
<tbody class="p-2 text-center | ||
<div class="h-[80vh]"> | ||
<table class="w-[100%] mt-4"> | ||
<thead> | ||
<tr> | ||
<th>Name</th> | ||
<th>Email</th> | ||
<th>Ticket id</th> | ||
<th>Quantity</th> | ||
<th>Amount</th> | ||
<th>Type</th> | ||
</tr> | ||
</thead> | ||
<tbody class="p-2 text-center | ||
" id="ticket"> | ||
<%= for ticket <- @ticket_collection do %> | ||
<tr id={"ticket-#{ticket.id}"}> | ||
<td><%= ticket.name %></td> | ||
<td><%= ticket.email %></td> | ||
<td><%= ticket.ticketid %></td> | ||
<td><%= ticket.quantity %></td> | ||
<td><%= ticket.cost %> KSH /=</td> | ||
<td><%= ticket.ticket_type.name %></td> | ||
</tr> | ||
<%= for ticket <- @ticket_collection do %> | ||
<tr id={"ticket-#{ticket.id}"}> | ||
<td><%= ticket.name %></td> | ||
<td><%= ticket.email %></td> | ||
<td><%= ticket.ticketid %></td> | ||
<td><%= ticket.quantity %></td> | ||
<td><%= ticket.cost %> KSH /=</td> | ||
<td><%= ticket.ticket_type.name %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div class="flex items-center mt-4"> | ||
<div> | ||
<%= if @page_number > 1 do %> | ||
<.link navigate={~p"/tickets/refunded?page=#{@page_number - 1}"}> | ||
<div class="flex gap-2 items-center "> | ||
Previous | ||
</div> | ||
</.link> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div style="display: flex; flex-direction: row; padding: 2px;"> | ||
<%= for idx <- Enum.to_list(1..@total_pages) do %> | ||
<.link navigate={~p"/tickets/refunded?page=#{idx}"}> | ||
<%= if @page_number == idx do %> | ||
<p style="border: 1px solid black; padding-left: 5px; padding-right: 5px;"> | ||
<%= idx %> | ||
</p> | ||
<% else %> | ||
<p style="padding-left: 5px; padding-right: 5px;"> | ||
<%= idx %> | ||
</p> | ||
<% end %> | ||
</.link> | ||
<% end %> | ||
</div> | ||
|
||
<div> | ||
<%= if @page_number < @total_pages do %> | ||
<.link navigate={~p"/tickets/refunded?page=#{@page_number + 1}"}> | ||
<div class="flex gap-2 items-center "> | ||
Next | ||
</div> | ||
</.link> | ||
<% end %> | ||
</div> | ||
</div> |
Oops, something went wrong.