aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--public/js/report.coffee14
-rw-r--r--views/transactions/index.html13
2 files changed, 25 insertions, 2 deletions
diff --git a/public/js/report.coffee b/public/js/report.coffee
index 1aa085a6..7989c211 100644
--- a/public/js/report.coffee
+++ b/public/js/report.coffee
@@ -61,6 +61,7 @@ display = (transactions) ->
amount = received * exchange
notes = @notes
txid = @txid
+ address = @address
date = moment(@date, 'YYYY-MM-DD h:mm:ss').format('MMM D h:mma')
row = $("""
@@ -79,17 +80,30 @@ display = (transactions) ->
$('.report tbody').append(row)
row.click(->
+ $('#confirm, #yousure').hide()
+ $('#buttons, #modal textarea').show()
notes = $(this).attr('data-notes')
$('#modal').modal()
$('#modal textarea').val('')
+ $('#modal .btn-primary').toggle(address?)
$('#modal .btn-danger').off().click(->
+ $('#yousure, #confirm').show()
+ $('#buttons, #modal textarea').hide()
+ )
+
+ $('#confirm .btn-danger').click(->
$.ajax(type: 'delete', url: "/#{$('#user').val()}/transactions/#{txid}")
$('#modal').modal('hide')
row.remove()
)
+ $('#modal .btn-primary').off().click(->
+ window.open("https://blockchain.info/address/#{address}", '_blank')
+ $('#modal').modal('hide')
+ )
+
$('#modal textarea').off().change(->
notes = $(this).val()
$.post("/transactions/#{txid}", notes: $(this).val()) if txid
diff --git a/views/transactions/index.html b/views/transactions/index.html
index 3584e832..dcb76580 100644
--- a/views/transactions/index.html
+++ b/views/transactions/index.html
@@ -45,10 +45,19 @@
</div>
<div class="modal-body">
<textarea style="width: 100%; height: 100px;" placeholder="Notes"></textarea>
+ <p id="yousure">You sure?</p>
</div>
<div class="modal-footer">
- <button type="button" class="btn btn-danger">Delete Transaction</button>
- <button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
+ <div id="buttons">
+ <button type="button" class="btn btn-danger" tabindex="-1">Delete Transaction</button>
+ <button type="button" class="btn btn-primary">View Blockchain</button>
+ <button type="button" class="btn btn-default" data-dismiss="modal">Done</button>
+ </div>
+
+ <div id="confirm">
+ <button type="button" class="btn btn-default" data-dismiss="modal">No</button>
+ <button type="button" class="btn btn-danger">Yes</button>
+ </div>
</div>
</div>
</div>