Files
stl/server/templates/category_entry.hbs

52 lines
1.3 KiB
Handlebars

<li class="category_entry">
<div class="category_header">
<div class="category_icon"
style="background-color: {{this.category.color}}"
></div>
<span class="category_name">{{this.category.name}}</span>
<div class="category_button_container">
{{#if this.category.started}}
<form
action="/category/{{@key}}/bump_session/minutes/5"
id="bump-form-{{@key}}"
method="post"></form>
<button
class="category_bump_button"
form="bump-form-{{@key}}"
type="submit">+5m</button>
{{/if}}
<!-- without this extra tag, every even noscript tag seems to not trigger -->
<!-- what is even happening help -->
<noscript></noscript>
<noscript>
<form
{{#if this.category.started}}
action="/category/{{@key}}/end_session"
{{else}}
action="/category/{{@key}}/start_session"
{{/if}}
id="toggle-form-{{@key}}"
method="post"></form>
</noscript>
<button
id="toggle-button-{{@key}}"
type="submit"
form="toggle-form-{{@key}}"
onClick="toggle_category('{{@key}}')"
{{#if this.category.started}}
class="category_button category_button_toggled"
{{else}}
class="category_button"
{{/if}}>
</button>
</div>
</div>
{{#if this.children}}
<ul class="category_children striped_list">
{{#each this.children}}
{{> category_entry}}
{{/each}}
</ul>
{{/if}}
</li>