diff --git a/module/blades.js b/module/blades.js index 1d23828..15fc099 100644 --- a/module/blades.js +++ b/module/blades.js @@ -49,6 +49,15 @@ Hooks.once("init", async function() { preloadHandlebarsTemplates(); + // Is the value Turf side. + Handlebars.registerHelper('is_turf_side', function(value, options) { + if (["left", "right", "top", "bottom"].includes(value)) { + return options.fn(this); + } else { + return options.inverse(this); + } + }); + // Multiboxes. Handlebars.registerHelper('multiboxes', function(selected, options) { diff --git a/templates/parts/turf-list.html b/templates/parts/turf-list.html index 2159e80..96b18aa 100644 --- a/templates/parts/turf-list.html +++ b/templates/parts/turf-list.html @@ -4,8 +4,16 @@ {{#each turfs_data as |turf id|}}
- {{#each turf.connects as |connect|}} -
+ {{#each turf.connects as |connect key|}} + + {{#is_turf_side key}} + {{#if connect}} +
+ {{/if}} + {{else}} +
+ {{/is_turf_side}} + {{/each}} {{#if ../can_edit}} @@ -16,10 +24,10 @@
{{#multiboxes turf.connects}} - - - - + + + + {{/multiboxes}}