2017-09-05 12:44:58 +00:00
|
|
|
% layout 'admin';
|
|
|
|
% title 'Transactions';
|
|
|
|
% content_for javascript => begin
|
|
|
|
% 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>
|
|
|
|
% }
|
2017-09-07 11:53:01 +00:00
|
|
|
<div class="card mb-3">
|
2017-09-29 14:52:34 +00:00
|
|
|
<h3 class="card-header d-flex justify-content-between">
|
2017-09-07 11:53:01 +00:00
|
|
|
Transaction Details
|
2017-09-29 14:52:34 +00:00
|
|
|
<form class="form-inline" action="<%= url_for . '/delete' %>" method="post">
|
2017-09-07 12:20:53 +00:00
|
|
|
<div class="form-group">
|
2017-09-29 14:52:34 +00:00
|
|
|
<button class="btn btn-danger" type="submit">Delete Transaction</button>
|
2017-09-07 12:20:53 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
2017-09-07 11:53:01 +00:00
|
|
|
</h3>
|
2017-09-29 14:52:34 +00:00
|
|
|
<div class="card-body">
|
2017-09-07 12:20:53 +00:00
|
|
|
<form>
|
2017-09-07 11:53:01 +00:00
|
|
|
<div class="form-group">
|
2018-01-15 17:14:16 +00:00
|
|
|
<label for="buyer">Buyer</label>
|
2017-09-07 11:53:01 +00:00
|
|
|
<input id="buyer" type="text" class="form-control" placeholder="Buyer ID" name="buyer" value="<%= $transaction->buyer->name %>" disabled>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-15 17:14:16 +00:00
|
|
|
<label for="seller">Seller</label>
|
2017-09-07 11:53:01 +00:00
|
|
|
<input id="seller" type="text" class="form-control" placeholder="Seller ID" name="seller" value="<%= $transaction->seller->name %>" disabled>
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-15 17:14:16 +00:00
|
|
|
<label for="value">Value</label>
|
2017-10-24 16:55:49 +00:00
|
|
|
<input id="value" type="text" class="form-control" placeholder="Value" name="value" value="<%= sprintf '£%.2f', $transaction->value / 100000 %>" disabled>
|
2017-09-07 11:53:01 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-15 17:14:16 +00:00
|
|
|
<label for="text">Category</label>
|
2018-01-16 14:47:17 +00:00
|
|
|
<input id="category" type="text" class="form-control" placeholder="Uncategorised" name="category" value="<%= defined $transaction->category ? $transaction->category->category->name : 'Uncategorised' %>" disabled>
|
2018-01-15 17:14:16 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="submitted_at">Submitted At</label>
|
2017-10-24 16:55:49 +00:00
|
|
|
<input id="submitted_at" type="text" class="form-control" placeholder="Submitted At" name="submitted_at" value="<%= format_human_datetime $transaction->submitted_at %>" disabled>
|
2017-09-07 11:53:01 +00:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2018-01-15 17:14:16 +00:00
|
|
|
<label for="purchase_time">Purchase Time</label>
|
2017-10-24 16:55:49 +00:00
|
|
|
<input id="purchase_time" type="text" class="form-control" placeholder="Purchase Time" name="purchase_time" value="<%= format_human_datetime $transaction->purchase_time %>" disabled>
|
2017-09-07 11:53:01 +00:00
|
|
|
</div>
|
2017-09-29 14:52:34 +00:00
|
|
|
<div class="form-group d-flex justify-content-center">
|
|
|
|
<img class="mw-100" src="<%= url_for . '/image' %>"/>
|
2017-09-07 11:53:01 +00:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|