removed transaction list code
This commit is contained in:
parent
15fe827f85
commit
9229f6ec92
2 changed files with 0 additions and 58 deletions
|
@ -6,21 +6,6 @@ has result_set => sub {
|
||||||
return $c->schema->resultset('Transaction');
|
return $c->schema->resultset('Transaction');
|
||||||
};
|
};
|
||||||
|
|
||||||
sub index {
|
|
||||||
my $c = shift;
|
|
||||||
|
|
||||||
my $transactions = $c->result_set->search(
|
|
||||||
undef, {
|
|
||||||
page => $c->param('page') || 1,
|
|
||||||
rows => 10,
|
|
||||||
order_by => { -desc => 'submitted_at' },
|
|
||||||
},
|
|
||||||
);
|
|
||||||
$c->stash(
|
|
||||||
transactions => $transactions,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
sub read {
|
sub read {
|
||||||
my $c = shift;
|
my $c = shift;
|
||||||
|
|
||||||
|
|
|
@ -2,46 +2,3 @@
|
||||||
% title 'Transactions';
|
% title 'Transactions';
|
||||||
% content_for javascript => begin
|
% content_for javascript => begin
|
||||||
% end
|
% end
|
||||||
% if ( my $error = flash 'error' ) {
|
|
||||||
<div class="alert alert-danger" role="alert">
|
|
||||||
<strong>Error!</strong> <%= $error %>
|
|
||||||
</div>
|
|
||||||
% } elsif ( my $success = flash 'success' ) {
|
|
||||||
<div class="alert alert-success" role="alert">
|
|
||||||
<strong>Success!</strong> <%= $success %>
|
|
||||||
</div>
|
|
||||||
% }
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col">
|
|
||||||
<div class="card">
|
|
||||||
<h3 class="card-header">
|
|
||||||
Transactions
|
|
||||||
</h3>
|
|
||||||
<div class="list-group list-group-flush">
|
|
||||||
% for my $transaction ( $transactions->all ) {
|
|
||||||
<a href="<%= url_for . '/' . $transaction->id %>" class="list-group-item list-group-item-action" target="_blank">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-4 row">
|
|
||||||
<div class="col my-auto">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">From: <%= $transaction->buyer->name %></div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">To: <%= $transaction->seller->name %></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col-md-4 text-center my-auto"><h3><%= sprintf('£%.2f', $transaction->value / 100000) %></h3></div>
|
|
||||||
<div class="col-md-4 text-right my-auto"><%= format_human_datetime $transaction->purchase_time %></div>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
% }
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
%= bootstrap_pagination( $c->param('page') || 1, $transactions->pager->last_page, { class => 'justify-content-center' } );
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
Reference in a new issue