removed transaction list code

This commit is contained in:
Finn 2018-03-15 13:07:29 +00:00
parent 29eaa291c5
commit 3ceb926cd4
2 changed files with 0 additions and 58 deletions

View file

@ -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;

View file

@ -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>