Commit 9d95f256 by murad

Survey UI fixes for label

parent d43543a7
...@@ -160,6 +160,15 @@ li.poll-result .poll-image { ...@@ -160,6 +160,15 @@ li.poll-result .poll-image {
border: 0; border: 0;
} }
.survey-table td{
text-align: center;
}
.survey-table td label{
display: block;
padding: 5px 0;
}
.survey-table td, .survey-table th { .survey-table td, .survey-table th {
border: 1px solid #CCC; border: 1px solid #CCC;
border-top: 0; border-top: 0;
...@@ -303,6 +312,9 @@ th.survey-answer { ...@@ -303,6 +312,9 @@ th.survey-answer {
visibility: hidden; visibility: hidden;
} }
.survey-table .survey-option .visible-mobile-only{
width: calc(100% - 20px);
}
.survey-table .survey-option{ .survey-table .survey-option{
display: block; display: block;
border: 1px solid #ccc; border: 1px solid #ccc;
...@@ -326,7 +338,10 @@ th.survey-answer { ...@@ -326,7 +338,10 @@ th.survey-answer {
.survey-table .survey-option label{ .survey-table .survey-option label{
text-align: left; text-align: left;
width: calc(100% - 18px);
padding: 8px 0; padding: 8px 0;
} }
.survey-table tbody tr:last-child td{
border-bottom: 1px solid #ccc;
}
} }
...@@ -25,21 +25,21 @@ ...@@ -25,21 +25,21 @@
</th> </th>
{% for answer, label in answers %} {% for answer, label in answers %}
<td class="survey-option" headers="poll-{{block_id}}-{{key}} poll-{{block_id}}-{{answer}}"> <td class="survey-option" headers="poll-{{block_id}}-{{key}} poll-{{block_id}}-{{answer}}">
<input type="radio"
name="{{key}}"
id="{{key}}-{{forloop.counter}}"
value="{{answer}}"{% if question.choice == answer %} checked{% endif %}
{% if question.img_alt %}
aria-label="{{question.img_alt}} {{label}}"
{% else %}
aria-label="{{question.label|striptags}} {{label}}"
{% endif %}
/>
{% with answer_count=forloop.counter %} {% with answer_count=forloop.counter %}
{% for answer, label in answers %} {% for answer, label in answers %}
{% if forloop.counter == answer_count %} {% if forloop.counter == answer_count %}
<label class="visible-mobile-only" for="{{key}}-{{answer_count}}"> <label for="{{key}}-{{answer_count}}">
{{label}} <input type="radio"
name="{{key}}"
id="{{key}}-{{forloop.counter}}"
value="{{answer}}"{% if question.choice == answer %} checked{% endif %}
{% if question.img_alt %}
aria-label="{{question.img_alt}} {{label}}"
{% else %}
aria-label="{{question.label|striptags}} {{label}}"
{% endif %}
/>
<span class="visible-mobile-only">{{label}}</span>
</label> </label>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
......
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