mirror of
https://github.com/PretendoNetwork/website.git
synced 2026-03-22 01:34:44 -05:00
moved checkboxes out of JS
checkbox code now lives entirely in the handlebars views and not inside the JS
This commit is contained in:
parent
36ec97501b
commit
481b051213
18
src/index.js
18
src/index.js
|
|
@ -44,24 +44,6 @@ app.engine('handlebars', handlebars({
|
|||
${htmlRight}
|
||||
</div>
|
||||
`;
|
||||
},
|
||||
customCheckbox(type) {
|
||||
switch(type) {
|
||||
case 'completed':
|
||||
return `
|
||||
<div class="custom-checkbox done">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check"><polyline points="20 6 9 17 4 12"></polyline></svg>
|
||||
</div>
|
||||
`;
|
||||
case 'started':
|
||||
return `
|
||||
<div class="custom-checkbox ongoing">
|
||||
<div class="small-dot"></div>
|
||||
</div>
|
||||
`;
|
||||
default:
|
||||
return '<div class="custom-checkbox incomplete"></div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
{{{ customCheckbox status }}}
|
||||
|
|
@ -15,21 +15,28 @@
|
|||
<div class="feature-list">
|
||||
{{#each data.progress.completed}}
|
||||
<div class="feature">
|
||||
{{> custom-checkbox status="completed" }}
|
||||
<div class="custom-checkbox done">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
|
||||
stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check">
|
||||
<polyline points="20 6 9 17 4 12"></polyline>
|
||||
</svg>
|
||||
</div>
|
||||
<span>{{ this }}</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{#each data.progress.started}}
|
||||
<div class="feature">
|
||||
{{> custom-checkbox status="started" }}
|
||||
<div class="custom-checkbox ongoing">
|
||||
<div class="small-dot"></div>
|
||||
</div>
|
||||
<span>{{ this }}</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
{{#each data.progress.not_started}}
|
||||
<div class="feature">
|
||||
{{> custom-checkbox status="not_started" }}
|
||||
<div class="custom-checkbox incomplete"></div>
|
||||
<span>{{ this }}</span>
|
||||
</div>
|
||||
{{/each}}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user