Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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>
2 changes: 1 addition & 1 deletion create-campaign.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ <h1><span class="blue">issue</span><span class="red">hunter</span></h1>
<input id="issueId" type="text" placeholder="issue id">
</div>
<div>
<button onclick="createCampaign();">Create campaign</button>
<button onclick="createCampaign()">Create campaign</button>
</div>

<h3>New Campaign</h3>
Expand Down
21 changes: 13 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,24 @@
<h1><span class="blue">issue</span><span class="red">hunter</span></h1>
</header>

<ul>
<li><a href="/create-campaign.html">Create campaign</a></li>
<li><a href="/add-funds.html">Add funds</a></li>
</ul>

<p>
Coinbase Address: <strong id="coinbase"></strong></br>
Coinbase Balance: <strong id="balance"></strong></br>
Accounts: <strong id="accounts"></strong></br>
Coinbase Balance: <strong id="balance"></strong>
</p>

<p>Accounts:</p>
<div id="accounts"></div>

<p>
Latest Block Number: <strong id="latestBlock"></strong></br>
Latest Block Timestamp: <strong id="latestBlockTimestamp"></strong></br>
Latest Block Hash: <strong id="latestBlockHash"></strong></br>
Latest Block Hash: <strong id="latestBlockHash"></strong>
</p>

<ul>
<li><a href="/create-campaign.html">Create campaign</a></li>
<li><a href="/add-funds.html">Add funds</a></li>
</ul>
</article>
</body>
</html>
1 change: 0 additions & 1 deletion src/add-funds.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function addFunds() {

// TODO: listen for CampaignFunded events for a specific issue id
issueHunter.CampaignFunded().watch(function (err, event) {
console.log(event)
document.querySelector(".add-funds #status").innerText = "Confirmed"
document.querySelector(".add-funds #block").innerText = event.blockHash
document.querySelector(".add-funds #txn").innerText = event.transactionHash
Expand Down
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)
})
}