File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
plausible_web/templates/auth Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,6 @@ defmodule Plausible.Billing.PaddleApi do
108
108
Enum . sort ( response , fn % { "payout_date" => d1 } , % { "payout_date" => d2 } ->
109
109
Date . compare ( Date . from_iso8601! ( d1 ) , Date . from_iso8601! ( d2 ) ) == :gt
110
110
end )
111
- |> Enum . take ( 12 )
112
111
|> then ( & { :ok , & 1 } )
113
112
else
114
113
error ->
Original file line number Diff line number Diff line change 121
121
</ p >
122
122
</ div >
123
123
<% { :ok , invoice_list } when is_list ( invoice_list ) - > %>
124
- < div class = "max-w-2xl px-8 pt-6 pb-8 mx-auto mt-16 bg-white border-t-2 border-orange-200 rounded rounded-t-none shadow-md dark:bg-gray-800 " >
124
+ < div
125
+ class = "max-w-2xl px-8 pt-6 pb-8 mx-auto mt-16 bg-white border-t-2 border-orange-200 rounded rounded-t-none shadow-md dark:bg-gray-800 "
126
+ x-data = "{showAll: false} "
127
+ >
125
128
< h2 class = "text-xl font-black dark:text-gray-100 " > Invoices</ h2 >
126
129
< div class = "my-4 border-b border-gray-300 dark:border-gray-500 " > </ div >
127
130
< table class = "min-w-full divide-y divide-gray-200 " >
147
150
</ th >
148
151
</ tr >
149
152
</ thead >
150
- <%= for invoice <- format_invoices ( invoice_list ) do %>
151
- < tbody class = "divide-y divide-gray-200 " >
152
- < tr >
153
+ <%= for { invoice , idx } <- Enum . with_index ( format_invoices ( invoice_list ) ) do %>
154
+ < tbody class = { [ "divide-y divide-gray-200" ] } >
155
+ < tr x-show = { "showAll || #{ idx } < 12" } >
153
156
< td class = "py-4 text-sm text-gray-800 dark:text-gray-200 font-medium " >
154
157
<%= invoice . date %>
155
158
</ td >
160
163
<%= link ( "Link" , to: invoice . url , target: "_blank" ) %>
161
164
</ td >
162
165
</ tr >
166
+ < tr :if = { idx == 12 && length ( invoice_list ) > 12 } x-show = "!showAll " >
167
+ < td colspan = "3 " class = "text-center " >
168
+ < button
169
+ x-on:click = "showAll = true "
170
+ x-show = "!showAll "
171
+ class = "mt-4 text-indigo-500 hover:text-indigo-600 "
172
+ >
173
+ Show More
174
+ </ button >
175
+ </ td >
176
+ </ tr >
163
177
</ tbody >
164
178
<% end %>
165
179
</ table >
You can’t perform that action at this time.
0 commit comments