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" -%} {%- assign tag = "h4" -%}
{%- endif -%} {%- endif -%}
<{{tag}}>Method</{{tag}}> <{{tag}}>Method</{{tag}}>
{%- assign name = page.name | downcase | url_encode -%} {%- assign prefix = page.id | downcase | split: "/" | last | url_encode | prepend: "cb-" -%}
<ol class='method' data-cb-prefix='check-{{ name }}'> <ol class='method' data-cb-prefix='{{ prefix }}'>
{% assign i = 1 -%} {% assign i = 1 -%}
{%- for item in page.method -%} {%- 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> <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 -%} {% assign i = i | plus: 1 -%}
{% endfor %} {%- endfor %}
</ol> </ol>
{%- endif -%} {%- endif -%}