From 481b05121383f943342b697cbed4e751c060d9f9 Mon Sep 17 00:00:00 2001 From: Jonathan Barrow Date: Fri, 23 Apr 2021 18:06:47 -0400 Subject: [PATCH] moved checkboxes out of JS checkbox code now lives entirely in the handlebars views and not inside the JS --- src/index.js | 18 ------------------ views/partials/custom-checkbox.handlebars | 1 - views/partials/progress-list.handlebars | 13 ++++++++++--- 3 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 views/partials/custom-checkbox.handlebars diff --git a/src/index.js b/src/index.js index bd36d34..79ea6ed 100644 --- a/src/index.js +++ b/src/index.js @@ -44,24 +44,6 @@ app.engine('handlebars', handlebars({ ${htmlRight} `; - }, - customCheckbox(type) { - switch(type) { - case 'completed': - return ` -
- -
- `; - case 'started': - return ` -
-
-
- `; - default: - return '
'; - } } } })); diff --git a/views/partials/custom-checkbox.handlebars b/views/partials/custom-checkbox.handlebars deleted file mode 100644 index 1f749bc..0000000 --- a/views/partials/custom-checkbox.handlebars +++ /dev/null @@ -1 +0,0 @@ -{{{ customCheckbox status }}} \ No newline at end of file diff --git a/views/partials/progress-list.handlebars b/views/partials/progress-list.handlebars index 032a7e1..005b94f 100644 --- a/views/partials/progress-list.handlebars +++ b/views/partials/progress-list.handlebars @@ -15,21 +15,28 @@
{{#each data.progress.completed}}
- {{> custom-checkbox status="completed" }} +
+ + + +
{{ this }}
{{/each}} {{#each data.progress.started}}
- {{> custom-checkbox status="started" }} +
+
+
{{ this }}
{{/each}} {{#each data.progress.not_started}}
- {{> custom-checkbox status="not_started" }} +
{{ this }}
{{/each}}