Commit c4994ead by Ari Rizzitano

avoid numeral-prefixed id attributes; bump to v1.2.5

[template] avoid potential invalid id attribute

[template] forgot to update default label

v1.2.5

dodge a few more numeral-prefixed ids
parent a5f3f764
...@@ -14,19 +14,19 @@ ...@@ -14,19 +14,19 @@
{% for key, value in answers %} {% for key, value in answers %}
<div class="poll-answer"> <div class="poll-answer">
<div class="poll-input-container"> <div class="poll-input-container">
<input type="radio" name="choice" id="{{ block_id }}-answer-{{ key }}" value="{{ key }}" <input type="radio" name="choice" id="poll-{{ block_id }}-answer-{{ key }}" value="{{ key }}"
{% if choice == key %}checked{% endif %}/> {% if choice == key %}checked{% endif %}/>
</div> </div>
{% if any_img %} {% if any_img %}
<div class="poll-image"> <div class="poll-image">
<label for="{{ block_id }}-answer-{{ key }}" class="poll-image-label"> <label for="poll-{{ block_id }}-answer-{{ key }}" class="poll-image-label">
{% if value.img %} {% if value.img %}
<img src="{{ value.img }}"/> <img src="{{ value.img }}"/>
{% endif %} {% endif %}
</label> </label>
</div> </div>
{% endif %} {% endif %}
<label class="poll-answer-text" for="{{ block_id }}-answer-{{ key }}">{{ value.label|safe }}</label> <label class="poll-answer-text" for="poll-{{ block_id }}-answer-{{ key }}">{{ value.label|safe }}</label>
</div> </div>
{% endfor %} {% endfor %}
</div> </div>
......
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
<tr> <tr>
<td></td> <td></td>
{% for answer, label in answers %} {% for answer, label in answers %}
<th id="{{block_id}}-{{answer}}" class="survey-answer">{{label}}</th> <th id="poll-{{block_id}}-{{answer}}" class="survey-answer">{{label}}</th>
{% endfor %} {% endfor %}
</tr> </tr>
</thead> </thead>
{% for key, question in questions %} {% for key, question in questions %}
<tr class="survey-row" role="group" aria-labelledby="{{block_id}}-{{key}}"> <tr class="survey-row" role="group" aria-labelledby="poll-{{block_id}}-{{key}}">
<th id="{{block_id}}-{{key}}" class="survey-question"> <th id="poll-{{block_id}}-{{key}}" class="survey-question">
{% if question.img %} {% if question.img %}
<div class="poll-image-td"> <div class="poll-image-td">
<img src="{{question.img}}" alt="{{question.img_alt|default_if_none:''}}"/> <img src="{{question.img}}" alt="{{question.img_alt|default_if_none:''}}"/>
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
<input type="radio" <input type="radio"
name="{{key}}" name="{{key}}"
value="{{answer}}"{% if question.choice == answer %} checked{% endif %} value="{{answer}}"{% if question.choice == answer %} checked{% endif %}
aria-labelledby="{{block_id}}-{{answer}}" aria-labelledby="poll-{{block_id}}-{{answer}}"
/> />
</label> </label>
</td> </td>
......
...@@ -44,7 +44,7 @@ def package_data(pkg, roots): ...@@ -44,7 +44,7 @@ def package_data(pkg, roots):
setup( setup(
name='xblock-poll', name='xblock-poll',
version='1.2.4', version='1.2.5',
description='An XBlock for polling users.', description='An XBlock for polling users.',
packages=[ packages=[
'poll', 'poll',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment