-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pending and archived payments to the pool are now displayed on the admin page.
- Loading branch information
1 parent
89827b5
commit a41ea95
Showing
10 changed files
with
215 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
$.fn["pagination"].defaults.locator = "data"; | ||
$.fn["pagination"].defaults.totalNumberLocator = function(response) { return response.count; }; | ||
$.fn["pagination"].defaults.nextText = '<div class="pagination-arrow pagination-arrow-right"></div>'; | ||
$.fn["pagination"].defaults.prevText = '<div class="pagination-arrow pagination-arrow-left"></div>'; | ||
$.fn["pagination"].defaults.hideWhenLessThanOnePage = true; | ||
|
||
if ($('#pending-payments-page-select').length) { | ||
$('#pending-payments-page-select').pagination({ | ||
dataSource: "/admin/payments/pending", | ||
callback: function (data) { | ||
var html = ''; | ||
if (data.length > 0) { | ||
$.each(data, function (_, item) { | ||
html += '<tr><td><a href="' + item.workheighturl + '" rel="noopener noreferrer">' + item.workheight + '</a></td><td>' + item.createdon + '</td><td>' + item.amount + '</td></tr>'; | ||
}); | ||
} else { | ||
html += '<tr><td colspan="100%"><span class="no-data">No pending payments</span></td></tr>'; | ||
} | ||
$('#pending-payments-table').html(html); | ||
} | ||
}); | ||
}; | ||
|
||
if ($('#archived-payments-page-select').length) { | ||
$('#archived-payments-page-select').pagination({ | ||
dataSource: "/admin/payments/archived", | ||
callback: function (data) { | ||
var html = ''; | ||
if (data.length > 0) { | ||
$.each(data, function (_, item) { | ||
html += '<tr><td><a href="' + item.workheighturl + '" rel="noopener noreferrer">' + item.workheight + '</a></td><td><a href="' + item.paidheighturl + '" rel="noopener noreferrer">' + item.paidheight + '</a></td><td>' + item.createdon + '</td><td>' + item.amount + '</td><td><a href="' + item.txurl + '" rel="noopener noreferrer">' + item.txid + '</a></td></tr>'; | ||
}); | ||
} else { | ||
html += '<tr><td colspan="100%"><span class="no-data">No received payments</span></td></tr>'; | ||
} | ||
$('#archived-payments-table').html(html); | ||
} | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{{define "payments"}} | ||
|
||
{{ if .PendingPayments }} | ||
<div class="row"> | ||
<div class="col-12 p-3"> | ||
<div class="block__content"> | ||
|
||
<h1>Pending Payments</h1> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Work Height</th> | ||
<th>Created On</th> | ||
<th>Amount</th> | ||
</tr> | ||
</thead> | ||
<tbody id="pending-payments-table"> | ||
{{ range .PendingPayments }} | ||
<tr> | ||
<td><a href="{{ .WorkHeightURL }}" | ||
rel="noopener noreferrer">{{ .WorkHeight }}</a></td> | ||
<td>{{ .CreatedOn }}</td> | ||
<td>{{ .Amount }}</td> | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
|
||
<div id="pending-payments-page-select" class="page-select"></div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
{{end}} | ||
|
||
<div class="row"> | ||
<div class="col-12 p-3"> | ||
<div class="block__content"> | ||
<h1>Payments Received</h1> | ||
|
||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Work Height</th> | ||
<th>Payment Height</th> | ||
<th>Created On</th> | ||
<th>Amount</th> | ||
<th>Tx ID</th> | ||
</tr> | ||
</thead> | ||
<tbody id="archived-payments-table"> | ||
{{ range .ArchivedPayments }} | ||
<tr> | ||
<td><a href="{{ .WorkHeightURL }}" | ||
rel="noopener noreferrer">{{ .WorkHeight }}</a></td> | ||
<td><a href="{{ .PaidHeightURL }}" | ||
rel="noopener noreferrer">{{ .PaidHeight }}</a></td> | ||
<td>{{ .CreatedOn }}</td> | ||
<td>{{ .Amount }}</td> | ||
<td><a href="{{ .TxURL }}" | ||
rel="noopener noreferrer">{{ .TxID }}</a> | ||
</td> | ||
</tr> | ||
{{else}} | ||
<tr> | ||
<td colspan="100%"><span class="no-data">No payments received</span></td> | ||
</tr> | ||
{{end}} | ||
</tbody> | ||
</table> | ||
|
||
<div id="archived-payments-page-select" class="page-select"></div> | ||
|
||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.