Merge pull request #1 from status-im/develop

Mainnet support
This commit is contained in:
Ricardo Guilherme Schmidt 2017-05-30 19:26:51 -03:00 committed by GitHub
commit 695e3d14b8
6 changed files with 22 additions and 7 deletions

View File

@ -5,7 +5,7 @@ Allows you to set bounties for Github issues, paid out in Ether.
More information:
http://wiki.status.im/proposals/commiteth/
Live alpha version (uses Ropsten testnet):
Live alpha version:
https://commiteth.com

View File

@ -34,6 +34,7 @@
user = null;
}
var commitethVersion = "{{commiteth-version}}";
var onTestnet = "{{on-testnet?}}";
</script>
{% style "https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.1.8/semantic.min.css" %}

View File

@ -17,7 +17,7 @@
(:import [java.util UUID]))
(def ^:dynamic url "https://api.github.com/")
(defonce ^:const on-testnet? (System/getProperty "commiteth.onTestnet"))
(defn server-address [] (:server-address env))
(defn client-id [] (:github-client-id env))
(defn client-secret [] (:github-client-secret env))
@ -183,6 +183,12 @@
[owner repo issue-number]
(md-image "Contract deploying" (str (server-address) "/img/deploying_contract.png")))
(defn network-text []
(str "Network: " (if on-testnet?
"Testnet"
"Mainnet")
"\n"))
(defn generate-open-comment
[owner repo issue-number contract-address balance balance-str]
(let [image-url (md-image "QR Code" (get-qr-url owner repo issue-number balance))
@ -191,7 +197,7 @@
(format (str "Current balance: %s\n"
"Contract address: %s\n"
"%s\n"
"Network: Testnet\n"
(network-text)
"To claim this bounty sign up at %s")
balance-str contract-address image-url site-url)))
@ -200,7 +206,7 @@
[contract-address balance-str winner-login]
(format (str "Balance: %s\n"
"Contract address: %s\n"
"Network: Testnet\n"
(network-text)
"Status: pending maintainer confirmation\n"
"Winner: %s\n")
balance-str contract-address winner-login))
@ -209,7 +215,7 @@
[contract-address balance-str payee-login]
(format (str "Balance: %s\n"
"Contract address: %s\n"
"Network: Testnet\n"
(network-text)
"Paid to: %s\n")
balance-str contract-address payee-login))

View File

@ -8,6 +8,7 @@
[clojure.java.io :as io]))
(defonce ^:const version (System/getProperty "commiteth.version"))
(defonce ^:const on-testnet? (System/getProperty "commiteth.onTestnet"))
(defn home-page [{user-id :id
login :login
@ -19,7 +20,8 @@
:admin-token admin-token
:authorize-url (github/signup-authorize-url)
:authorize-url-admin (github/admin-authorize-url)
:commiteth-version version}))
:commiteth-version version
:on-testnet? on-testnet?}))
(defroutes home-routes
(GET "/" {{user :identity} :session}

View File

@ -2,3 +2,7 @@
(def debug?
^boolean js/goog.DEBUG)
(defn on-testnet? []
(not (or (empty? js/onTestnet)
(= "false" js/onTestnet))))

View File

@ -101,7 +101,9 @@
(when-not @user
[:div.ui.text.content
[:div.ui.divider.hidden]
[:h2.ui.header "Commit ETH (Testnet)"]
[:h2.ui.header (if (config/on-testnet?)
"Commit ETH (Testnet)"
"Commit ETH")]
[:h2.ui.subheader "Earn ETH by committing to open source projects"]
[:div.ui.divider.hidden]])
[tabs]]])))