diff --git a/packages/editor/templates/Coin/app/app.css b/packages/editor/templates/Coin/app/app.css index 67421c16..0f4d3c22 100755 --- a/packages/editor/templates/Coin/app/app.css +++ b/packages/editor/templates/Coin/app/app.css @@ -3,4 +3,8 @@ body { color: #FCE8DF; font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif; text-align: center; +} + +.hidden { + display: none; } \ No newline at end of file diff --git a/packages/editor/templates/Coin/app/app.html b/packages/editor/templates/Coin/app/app.html index 759ffc75..fef39385 100755 --- a/packages/editor/templates/Coin/app/app.html +++ b/packages/editor/templates/Coin/app/app.html @@ -1,46 +1,48 @@ + + + + + + - - - - - - - - - - - - - -
-

Create new coins

-
-

Address

- -
-
-

Amount

- -
-
- + + + + +
+

Welcome!

+

Please deploy () your contract to begin.

-
- -
-

Check balance of wallet

-
-

Address

- + -
- -
-
- -

Balance: 

- - + \ No newline at end of file diff --git a/packages/editor/templates/Coin/app/app.js b/packages/editor/templates/Coin/app/app.js index 70f566a0..43f0824c 100755 --- a/packages/editor/templates/Coin/app/app.js +++ b/packages/editor/templates/Coin/app/app.js @@ -1,5 +1,5 @@ // The object 'Contracts' will be injected here, which contains all data for all contracts, keyed on contract name: -// Contracts['HelloWorld'] = { +// Contracts['Coin'] = { // abi: [], // address: "0x..", // endpoint: "http://...." @@ -158,10 +158,33 @@ Coin.prototype.bindButtons = function() { }); } +// Remove the welcome content, and display the main content. +// Called once a contract has been deployed +Coin.prototype.updateDisplayContent = function() { + this.hideWelcomeContent(); + this.showMainContent(); +}; + +// A contract will not have its address set until it has been deployed +Coin.prototype.hasContractDeployed = function() { + return this.instance && this.instance.address; +}; + +Coin.prototype.hideWelcomeContent = function() { + $('#welcome-container').addClass('hidden'); +}; + +Coin.prototype.showMainContent = function() { + $('#main-container').removeClass('hidden'); +}; + // Create the instance of the `Coin` object Coin.prototype.onReady = function() { - this.bindButtons(); this.init(); + if (this.hasContractDeployed()) { + this.updateDisplayContent(); + this.bindButtons(); + } }; if(typeof(Contracts) === "undefined") var Contracts={ Coin: { abi: [] }}; diff --git a/packages/editor/templates/Crypto Pizzas/app/app.css b/packages/editor/templates/Crypto Pizzas/app/app.css index b648cfa9..0f27a7e7 100755 --- a/packages/editor/templates/Crypto Pizzas/app/app.css +++ b/packages/editor/templates/Crypto Pizzas/app/app.css @@ -35,7 +35,7 @@ hr { opacity: .6; } -.error { +.error, .hidden { display: none; } diff --git a/packages/editor/templates/Crypto Pizzas/app/app.html b/packages/editor/templates/Crypto Pizzas/app/app.html index 71f45e89..94a602ad 100755 --- a/packages/editor/templates/Crypto Pizzas/app/app.html +++ b/packages/editor/templates/Crypto Pizzas/app/app.html @@ -31,8 +31,12 @@
+
+

Welcome!

+

Please deploy () your contract to begin.

+
-
+