@@ -11,6 +11,7 @@ defmodule AlgoraWeb.HomeLive do
11
11
alias Algora.Payments.Transaction
12
12
alias Algora.Repo
13
13
alias Algora.Workspace
14
+ alias Algora.Workspace.Ticket
14
15
alias AlgoraWeb.Components.Footer
15
16
alias AlgoraWeb.Components.Header
16
17
alias AlgoraWeb.Components.Logos
@@ -66,15 +67,21 @@ defmodule AlgoraWeb.HomeLive do
66
67
tx . net_amount
67
68
) ,
68
69
join: u in assoc ( tx , :user ) ,
69
- join: b in assoc ( tx , :bounty ) ,
70
- join: t in assoc ( b , :ticket ) ,
70
+ left_join: b in assoc ( tx , :bounty ) ,
71
+ left_join: tip in assoc ( tx , :tip ) ,
72
+ join: t in Ticket ,
73
+ on: t . id == b . ticket_id or t . id == tip . ticket_id ,
71
74
join: r in assoc ( t , :repository ) ,
72
75
join: o in assoc ( r , :user ) ,
73
76
join: ltx in assoc ( tx , :linked_transaction ) ,
74
77
join: ltx_user in assoc ( ltx , :user ) ,
75
- select_merge: % {
78
+ select: % {
79
+ succeeded_at: tx . succeeded_at ,
80
+ net_amount: tx . net_amount ,
81
+ bounty_id: b . id ,
82
+ tip_id: tip . id ,
76
83
user: u ,
77
- bounty: % { b | ticket: % { t | repository: % { r | user: o } } } ,
84
+ ticket: % { t | repository: % { r | user: o } } ,
78
85
linked_transaction: % { ltx | user: ltx_user }
79
86
} ,
80
87
order_by: [ desc: tx . succeeded_at ] ,
@@ -1675,28 +1682,28 @@ defmodule AlgoraWeb.HomeLive do
1675
1682
< div class = "relative -ml-[2.75rem] " >
1676
1683
< span
1677
1684
:if = { index != length ( @ transactions ) - 1 }
1678
- class = "absolute left-2 top-6 -ml-px h-full w-0.5 block ml-[2.75rem] bg-muted-foreground/25 "
1685
+ class = "absolute left-1 top-6 h-full w-0.5 block ml-[2.75rem] bg-muted-foreground/25 "
1679
1686
aria-hidden = "true "
1680
1687
>
1681
1688
</ span >
1682
1689
< . link
1683
1690
rel = "noopener "
1684
1691
target = "_blank "
1685
1692
class = "w-full group inline-flex "
1686
- href = { transaction . bounty . ticket . url }
1693
+ href = { transaction . ticket . url }
1687
1694
>
1688
1695
< div class = "w-full relative flex space-x-3 " >
1689
1696
< div class = "w-full flex min-w-0 flex-1 justify-between space-x-4 pt-1.5 " >
1690
1697
< div class = "w-full flex items-center gap-3 " >
1691
1698
< div class = "flex -space-x-1 ring-8 ring-[#050505] " >
1692
- < span class = "relative shrink-0 overflow-hidden flex h-9 w-9 items-center justify-center rounded-xl ring-4 ring-white bg-gray-950 ring-[#050505] " >
1699
+ < span class = "relative shrink-0 overflow-hidden flex h-9 w-9 items-center justify-center rounded-xl ring-4 bg-gray-950 ring-[#050505] " >
1693
1700
< img
1694
1701
class = "aspect-square h-full w-full "
1695
1702
alt = { transaction . user . name }
1696
1703
src = { transaction . user . avatar_url }
1697
1704
/>
1698
1705
</ span >
1699
- < span class = "relative shrink-0 overflow-hidden flex h-9 w-9 items-center justify-center rounded-xl ring-4 ring-white bg-gray-950 ring-[#050505] " >
1706
+ < span class = "relative shrink-0 overflow-hidden flex h-9 w-9 items-center justify-center rounded-xl ring-4 bg-gray-950 ring-[#050505] " >
1700
1707
< img
1701
1708
class = "aspect-square h-full w-full "
1702
1709
alt = { transaction . linked_transaction . user . name }
@@ -1717,7 +1724,11 @@ defmodule AlgoraWeb.HomeLive do
1717
1724
< span class = "font-bold font-display text-success-400 group-hover:text-success-300 transition-colors " >
1718
1725
{ Money . to_string! ( transaction . net_amount ) }
1719
1726
</ span >
1720
- bounty
1727
+ <%= if transaction . bounty_id do %>
1728
+ bounty
1729
+ <% else %>
1730
+ tip
1731
+ <% end %>
1721
1732
</ p >
1722
1733
< div class = "ml-auto xl:ml-0 xl:mb-[2px] whitespace-nowrap text-xs text-muted-foreground sm:text-sm " >
1723
1734
< time datetime = { transaction . succeeded_at } >
0 commit comments