From f2a963146479584dd01983171b93be45bd592136 Mon Sep 17 00:00:00 2001 From: Marek Sirovy Date: Mon, 16 Jan 2017 21:00:43 +0100 Subject: [PATCH 1/3] Add current_amount to projects table --- models/Projects.js | 1 + 1 file changed, 1 insertion(+) diff --git a/models/Projects.js b/models/Projects.js index c8e41b3..84d1c67 100644 --- a/models/Projects.js +++ b/models/Projects.js @@ -14,6 +14,7 @@ module.exports = BaseModel.extend({ table.string('name'); table.string('description'); table.decimal('goal_amount', 16, 8); + table.decimal('current_amount', 16, 8); } }); From a9c034efdbb535ddae04d8e9116acb5816c70170 Mon Sep 17 00:00:00 2001 From: Marek Sirovy Date: Mon, 16 Jan 2017 22:16:22 +0100 Subject: [PATCH 2/3] show progress bar on home page --- controllers/home.js | 1 + public/css/style.css | 6 ++++++ views/home.html | 7 ++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/controllers/home.js b/controllers/home.js index e8fe9e3..f3783d2 100644 --- a/controllers/home.js +++ b/controllers/home.js @@ -14,6 +14,7 @@ module.exports = function(app) { 'projects.name', 'projects.description', 'projects.goal_amount', + 'projects.current_amount', 'project_addresses.token' ]) .from('projects') diff --git a/public/css/style.css b/public/css/style.css index 000f08e..2222f7d 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -29,3 +29,9 @@ a { .project .name { color: #1ABE7B; } + +/* home page progress-bar +*/ +progress { + background: #1ABE7B; +} diff --git a/views/home.html b/views/home.html index 3bc5425..28600d8 100644 --- a/views/home.html +++ b/views/home.html @@ -5,7 +5,12 @@

Bitstarter homepage

{{name}}

{{description}}

-

{{goal_amount}} Ƀ

+

+ {{current_amount}}/{{goal_amount}}Ƀ
+ +

{{token}}

{{#if ../user}}

From e272679caed46e050e1194245912db72fa8cbd64 Mon Sep 17 00:00:00 2001 From: Marek Sirovy Date: Tue, 17 Jan 2017 10:23:17 +0100 Subject: [PATCH 3/3] add label to progress bar and fix collor --- public/css/style.css | 29 +++++++++++++++++++++++++++-- views/home.html | 8 ++++---- 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 2222f7d..a5ca944 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -30,8 +30,33 @@ a { color: #1ABE7B; } -/* home page progress-bar + +/* HOME - progress-bar */ progress { - background: #1ABE7B; + display: block; + font-weight: bold; + color: #fff; + height: 20px; + width: 300px; + -webkit-appearance: none; +} + +progress::-webkit-progress-bar { + border-radius: 10px; + background-color: #bbb; +} + +progress::-webkit-progress-value{ + border-radius: 10px; + background-color: #1ABE7B; +} + + + +progress::after { + content: "received "attr(value)'Ƀ from 'attr(max)'Ƀ'; + position: relative; + left: 10px; + top: -20px; } diff --git a/views/home.html b/views/home.html index 28600d8..228faaa 100644 --- a/views/home.html +++ b/views/home.html @@ -5,12 +5,12 @@

Bitstarter homepage

{{name}}

{{description}}

-

- {{current_amount}}/{{goal_amount}}Ƀ
+

-

+ max="{{goal_amount}}"> + +

{{token}}

{{#if ../user}}