Rework transaction views

This commit is contained in:
Tom Bloor 2017-10-24 17:55:49 +01:00
parent 751c6e64f2
commit 3e3f667053
2 changed files with 34 additions and 16 deletions

View file

@ -11,19 +11,37 @@
<strong>Success!</strong> <%= $success %> <strong>Success!</strong> <%= $success %>
</div> </div>
% } % }
<div class="list-group"> <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 ) { % for my $transaction ( $transactions->all ) {
<a href="<%= url_for . '/' . $transaction->id %>" class="list-group-item list-group-item-action"> <a href="<%= url_for . '/' . $transaction->id %>" class="list-group-item list-group-item-action">
<div class="row text-center"> <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 class="col">From: <%= $transaction->buyer->name %></div>
</div>
<div class="row">
<div class="col">To: <%= $transaction->seller->name %></div> <div class="col">To: <%= $transaction->seller->name %></div>
<div class="col">Value: <%= $transaction->value %></div> </div>
<div class="col">Submitted At: <%= $transaction->submitted_at %></div> </div>
<div class="col">Purchase Time: <%= $transaction->purchase_time %></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> </div>
</a> </a>
% } % }
<div class="list-group-item"> </div>
</div>
</div>
</div>
<div class="row">
<div class="col">
%= bootstrap_pagination( $c->param('page') || 1, $transactions->pager->last_page, { class => 'justify-content-center' } ); %= bootstrap_pagination( $c->param('page') || 1, $transactions->pager->last_page, { class => 'justify-content-center' } );
</div> </div>
</div> </div>

View file

@ -32,15 +32,15 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Value</label> <label for="email">Value</label>
<input id="value" type="text" class="form-control" placeholder="Value" name="value" value="<%= $transaction->value %>" disabled> <input id="value" type="text" class="form-control" placeholder="Value" name="value" value="<%= sprintf '£%.2f', $transaction->value / 100000 %>" disabled>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Submitted At</label> <label for="email">Submitted At</label>
<input id="submitted_at" type="text" class="form-control" placeholder="Submitted At" name="submitted_at" value="<%= $transaction->submitted_at %>" disabled> <input id="submitted_at" type="text" class="form-control" placeholder="Submitted At" name="submitted_at" value="<%= format_human_datetime $transaction->submitted_at %>" disabled>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="email">Purchase Time</label> <label for="email">Purchase Time</label>
<input id="purchase_time" type="text" class="form-control" placeholder="Purchase Time" name="purchase_time" value="<%= $transaction->purchase_time %>" disabled> <input id="purchase_time" type="text" class="form-control" placeholder="Purchase Time" name="purchase_time" value="<%= format_human_datetime $transaction->purchase_time %>" disabled>
</div> </div>
<div class="form-group d-flex justify-content-center"> <div class="form-group d-flex justify-content-center">
<img class="mw-100" src="<%= url_for . '/image' %>"/> <img class="mw-100" src="<%= url_for . '/image' %>"/>