Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions campaign/index.html
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>
18 changes: 18 additions & 0 deletions src/campaign.js
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)
})
}