mirror of
https://github.com/seigler/govobject-proposal
synced 2025-07-27 06:46:10 +00:00
Refactor UX
This commit is contained in:
parent
1b7dfc9be8
commit
aff7751e9d
1 changed files with 91 additions and 63 deletions
144
index.html
144
index.html
|
@ -2,7 +2,7 @@
|
|||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>govobject-proposal</title>
|
||||
<title>Dash Governance Tools</title>
|
||||
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
|
||||
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.0/themes/smoothness/jquery-ui.css">
|
||||
|
||||
|
@ -22,9 +22,11 @@
|
|||
$('#start_epoch').datepicker(opts, 'getdate');
|
||||
$('#end_epoch').datepicker(opts, 'getdate');
|
||||
|
||||
/*
|
||||
$('#dataHex').click(function() {
|
||||
copyToClipboard($(this).attr('id'));
|
||||
});
|
||||
*/
|
||||
|
||||
$('#prepareProposal').click(function() {
|
||||
copyToClipboard($(this).attr('id'));
|
||||
|
@ -34,31 +36,38 @@
|
|||
copyToClipboard($(this).attr('id'));
|
||||
});
|
||||
|
||||
$('#formSubmit').click(function() {
|
||||
var gov = '';
|
||||
|
||||
var gov = new Bitcore.GovObject.Proposal();
|
||||
$('#btnPrepare').click(function() {
|
||||
|
||||
gov = new Bitcore.GovObject.Proposal();
|
||||
|
||||
// proposal basic fields
|
||||
gov.name = document.getElementById('name').value;
|
||||
gov.url = document.getElementById('url').value;
|
||||
gov.payment_address = document.getElementById('payment_address').value;
|
||||
gov.payment_amount = parseFloat(document.getElementById('payment_amount').value);
|
||||
gov.name = $('#name').val();
|
||||
gov.url = $('#url').val();
|
||||
gov.payment_address = $('#payment_address').val();
|
||||
gov.payment_amount = parseFloat($('#payment_amount').val());
|
||||
|
||||
// format dates for gobject serialization
|
||||
gov.start_epoch = (new Date(document.getElementById('start_epoch').value) / 1000) || null;
|
||||
gov.end_epoch = (new Date(document.getElementById('end_epoch').value) / 1000) || null;
|
||||
gov.start_epoch = (new Date($('#start_epoch').val()) / 1000) || null;
|
||||
gov.end_epoch = (new Date($('#end_epoch').val()) / 1000) || null;
|
||||
|
||||
// hidden elements
|
||||
gov.type = parseInt(document.getElementById('type').value);
|
||||
gov.type = parseInt($('#type').val());
|
||||
|
||||
document.getElementById('dataHex').innerHTML = gov.uncheckedSerialize();
|
||||
//document.getElementById('dataHex').innerHTML = gov.uncheckedSerialize();
|
||||
|
||||
document.getElementById('prepareProposal').innerHTML = "gobject submit "+document.getElementById('parentHash').value+" "+document.getElementById('revision').value+" "+document.getElementById('time').value+" "+gov.uncheckedSerialize();
|
||||
var propCommand = "gobject submit "+$('#parentHash').val() + " " + $('#revision').val() +" " + $('#time').val() +" " + gov.uncheckedSerialize();
|
||||
$("textarea#prepareProposal").val(propCommand);
|
||||
|
||||
if (document.getElementById('feeTxid').value) {
|
||||
document.getElementById('submitProposal').innerHTML = "gobject submit " + document.getElementById('parentHash').value + " " + document.getElementById('revision').value + " " + document.getElementById('time').value + " " + gov.uncheckedSerialize() + " " + document.getElementById('feeTxid').value;
|
||||
$('#feeTxid').on('input', function() {
|
||||
if ($('#feeTxid').val().length > 0) {
|
||||
var submitCommand = "gobject submit " + $('#parentHash').val() + " " + $('#revision').val() + " " + $('#time').val() + " " + gov.uncheckedSerialize() + " " + $('#feeTxid').val();
|
||||
$("textarea#submitProposal").val(submitCommand);
|
||||
} else {
|
||||
$("textarea#submitProposal").val('');
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -80,47 +89,34 @@
|
|||
<div class="col-xs-10 col-xs-offset-1">
|
||||
|
||||
<div class="row" style="margin-top:2em;">
|
||||
<div class="col-xs-12"><h1>Dash Governance Proposal Creation</h1></div>
|
||||
<div class="col-xs-12"><h1>Dash Budget Proposal Generator</h1></div>
|
||||
<div class="col-xs-12">Generate budget proposal commands you can copy/paste into your Dash wallet to prepare a budget proposal and submit it to the network.</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top:2em;">
|
||||
<div class="col-xs-12"><h2>Create a Proposal</h2></div>
|
||||
<div class="col-xs-12">Enter details for your proposal and click 'Create Proposal'. This will generate a command you can run in your local wallet to prepare the proposal at a cost of 0.33 Dash</div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top:1em;">
|
||||
<div class="col-xs-6">
|
||||
|
||||
<form>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Proposal Name:</label>
|
||||
<input type="text" class="form-control" id="name" value="" placeholder="proposal-name">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="url">Proposal URL:</label>
|
||||
<label for="url">Proposal Description URL:</label>
|
||||
<input type="text" class="form-control" id="url" value="" placeholder="https://www.dashcentral.org/p/proposal-name">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="payment_address">Payment Address:</label>
|
||||
<input type="text" class="form-control" id="payment_address" value="" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="payment_amount">Payment Amount in Dash</label>
|
||||
<input type="text" class="form-control" id="payment_amount" value="" placeholder="0">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="start_epoch">Proposal Start Date:</label>
|
||||
<input type="text" class="form-control" id="start_epoch" value="" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="end_epoch">Proposal End Date:</label>
|
||||
<input type="text" class="form-control" id="end_epoch" value="" placeholder="">
|
||||
</div>
|
||||
|
||||
<div type="submit" class="btn btn-primary" id="formSubmit">Create Proposal</div>
|
||||
|
||||
<hr>
|
||||
<div type="submit" class="btn btn-primary" id="btnPrepare">Create Proposal</div>
|
||||
|
||||
<div class="form-group" style="display:none;">
|
||||
<label for="type">type:</label>
|
||||
|
@ -142,12 +138,51 @@
|
|||
<input type="text" class="form-control" id="time" value="" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="form-group" style="display:none;">
|
||||
<label for="feeTxid">fee-txid:</label>
|
||||
<input type="text" class="form-control" id="feeTxid" value="" placeholder="<fee-txid>">
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="payment_address">Payment Address:</label>
|
||||
<input type="text" class="form-control" id="payment_address" value="" placeholder="">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="payment_amount">Monthly Payment Amount in Dash:</label>
|
||||
<input type="text" class="form-control" id="payment_amount" value="" placeholder="0">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="end_epoch">Proposal End Date:</label>
|
||||
<input type="text" class="form-control" id="end_epoch" value="" placeholder="">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top:2em;">
|
||||
<div class="col-xs-12"><h2>Wallet Commands</h2></div>
|
||||
</div>
|
||||
|
||||
<div class="row" style="margin-top:2em;">
|
||||
|
||||
<!--div class="col-xs-12" style="display:none;">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="dataHex">data-hex:</label>
|
||||
<textarea class="form-control" id="dataHex" rows="6" placeholder=""></textarea>
|
||||
</div>
|
||||
</form>
|
||||
</div-->
|
||||
|
||||
<div class="col-xs-12">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="prepareProposal">Prepare-Proposal Command:</label>
|
||||
<div>Paste this proposal command into your Dash wallet console to spend a Fee transaction of 0.33 DASH.</div>
|
||||
<textarea readonly class="form-control" id="prepareProposal" rows="4" placeholder=""></textarea>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -155,35 +190,28 @@
|
|||
|
||||
<div class="row" style="margin-top:2em;">
|
||||
|
||||
<div class="col-xs-6">
|
||||
|
||||
<form>
|
||||
<div class="col-xs-12">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="dataHex">data-hex:</label>
|
||||
<textarea class="form-control" id="dataHex" rows="6" placeholder=""></textarea>
|
||||
<label for="feeTxid">Fee Transaction ID:</label>
|
||||
<div>Paste the transaction ID returned by the wallet below to generate the final submit command.</div>
|
||||
<input type="text" class="form-control" id="feeTxid" value="" placeholder="<fee-txid>">
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-xs-6">
|
||||
</div>
|
||||
|
||||
<form>
|
||||
<div class="row" style="margin-top:2em;">
|
||||
|
||||
<div class="col-xs-12">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="prepareProposal">prepare proposal:</label>
|
||||
<textarea class="form-control" id="prepareProposal" rows="4" placeholder=""></textarea>
|
||||
<label for="submitProposal">Submit Proposal Command:</label>
|
||||
<div>Paste the Fee TX id to generate the proposal submit command. This is the final step and can be completed after 6 confirmations on the fee tx.</div>
|
||||
<textarea readonly class="form-control" id="submitProposal" rows="4" placeholder=""></textarea>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="submitProposal">submit proposal:</label>
|
||||
<textarea class="form-control" id="submitProposal" rows="4" placeholder=""></textarea>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue