-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It shows basic campaign info and it exposes a form to call the `campaignFunds` getter to get the amount funded by an address. See #3.
- Loading branch information
Showing
2 changed files
with
62 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>issuehunter</title> | ||
<link rel="stylesheet" type="text/css" href="http://issuehunter.github.io/stylesheets/github-markdown.css"> | ||
<link rel="stylesheet" type="text/css" href="http://issuehunter.github.io/stylesheets/style.css" /> | ||
<script src="https://rawgit.com/ethereum/web3.js/develop/dist/web3.js"></script> | ||
<script src="/src/contract-abi.js"></script> | ||
<script src="/src/app.js"></script> | ||
<script src="/src/campaign.js"></script> | ||
</head> | ||
<body> | ||
<article class="markdown-body"> | ||
<header class="logo"> | ||
<h1><span class="blue">issue</span><span class="red">hunter</span></h1> | ||
</header> | ||
|
||
<p><a href="/">Back</a></p> | ||
|
||
<h3>Campaign</h3> | ||
<p> | ||
Executed: <strong id="executed"></strong></br> | ||
Total amount: <strong id="totalAmount"></strong></br> | ||
Created by: <strong id="createdBy"></strong></br> | ||
Reward period expires at: <strong id="rewardPeriodExpiresAt"></strong></br> | ||
Execute period expires at: <strong id="executePeriodExpiresAt"></strong></br> | ||
Resolved by: <strong id="resolutor"></strong> | ||
</p> | ||
|
||
<div> | ||
<label for="account">Account</label> | ||
<input id="account" type="text" placeholder="0x123"> | ||
</div> | ||
<div> | ||
<button onclick="campaignFunds()">Campaign funds</button> | ||
</div> | ||
|
||
<p> | ||
Amount: <strong id="amount"></strong> | ||
</p> | ||
</article> | ||
</body> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
var issueId = decodeURIComponent(window.location.search.substr(1)) | ||
|
||
issueHunter.campaigns(issueId, function(err, campaign) { | ||
console.log(campaign) | ||
document.querySelector("#executed").innerText = campaign[0] | ||
document.querySelector("#totalAmount").innerText = web3.fromWei(campaign[1]) | ||
document.querySelector("#createdBy").innerText = campaign[2] | ||
document.querySelector("#rewardPeriodExpiresAt").innerText = Date(campaign[3]) | ||
document.querySelector("#executePeriodExpiresAt").innerText = Date(campaign[4]) | ||
document.querySelector("#resolutor").innerText = campaign[5] | ||
}) | ||
|
||
function campaignFunds() { | ||
var account = document.querySelector("#account").value | ||
issueHunter.campaignFunds.call(issueId, account, function (err, amount) { | ||
document.querySelector("#amount").innerText = web3.fromWei(amount) | ||
}) | ||
} |