made method checkbox IDs a bit shorter

This commit is contained in:
Lynne Megido 2020-03-03 23:15:05 +10:00
parent efe748ad3e
commit b2007bfc66
Signed by: lynnesbian
GPG key ID: F0A184B5213D9F90

View file

@ -4,12 +4,12 @@
{%- assign tag = "h4" -%}
{%- endif -%}
<{{tag}}>Method</{{tag}}>
{%- assign name = page.name | downcase | url_encode -%}
<ol class='method' data-cb-prefix='check-{{ name }}'>
{%- assign prefix = page.id | downcase | split: "/" | last | url_encode | prepend: "cb-" -%}
<ol class='method' data-cb-prefix='{{ prefix }}'>
{% assign i = 1 -%}
{%- for item in page.method -%}
<li><input id='check-{{ name }}-{{ i }}' class='method-checkbox' data-number='{{ i }}' type='checkbox'><label for='check-{{ name }}-{{ i }}'>{{ item }}</label></li>
{%- assign i = i | plus: 1 -%}
{% endfor %}
<li><input id='{{ prefix }}-{{ i }}' class='method-checkbox' data-number='{{ i }}' type='checkbox'><label for='{{ prefix }}-{{ i }}'>{{ item }}</label></li>
{% assign i = i | plus: 1 -%}
{%- endfor %}
</ol>
{%- endif -%}