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">
% for my $transaction ( $transactions->all ) { <div class="col">
<a href="<%= url_for . '/' . $transaction->id %>" class="list-group-item list-group-item-action"> <div class="card">
<div class="row text-center"> <h3 class="card-header">
<div class="col">From: <%= $transaction->buyer->name %></div> Transactions
<div class="col">To: <%= $transaction->seller->name %></div> </h3>
<div class="col">Value: <%= $transaction->value %></div> <div class="list-group list-group-flush">
<div class="col">Submitted At: <%= $transaction->submitted_at %></div> % for my $transaction ( $transactions->all ) {
<div class="col">Purchase Time: <%= $transaction->purchase_time %></div> <a href="<%= url_for . '/' . $transaction->id %>" class="list-group-item list-group-item-action">
</div> <div class="row">
</a> <div class="col-md-4 row">
% } <div class="col my-auto">
<div class="list-group-item"> <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' } ); %= 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' %>"/>