Commit 1504add6 by Braden MacDonald

Merge v1.3.2: Responsive UI for mobile

parents e1ea9b05 9d95f256
...@@ -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;
...@@ -280,3 +289,59 @@ th.survey-answer { ...@@ -280,3 +289,59 @@ th.survey-answer {
height: 100%; height: 100%;
padding-right: .5em; padding-right: .5em;
} }
.visible-mobile-only{
display: none;
visibility: hidden;
}
@media only screen and (max-width: 767px){
.visible-mobile-only{
display: inline-block;
visibility: visible;
}
.survey-table .survey-question{
display: block;
border: 0;
padding-bottom: 10px;
}
.survey-table thead{
display: none;
visibility: hidden;
}
.survey-table .survey-option .visible-mobile-only{
width: calc(100% - 20px);
}
.survey-table .survey-option{
display: block;
border: 1px solid #ccc;
text-align: left;
padding: 0 10px;
margin-bottom: 10px;
border-radius: 5px;
}
.survey-table .survey-option:last-child{
border-right: 1px solid #ccc;
}
.survey-table tr:last-child td{
border-bottom: 1px solid #ccc;
}
.survey-table tr:last-child td:first-child{
border-bottom: 0;
}
.survey-table .survey-option label{
text-align: left;
padding: 8px 0;
}
.survey-table tbody tr:last-child td{
border-bottom: 1px solid #ccc;
}
}
...@@ -25,17 +25,25 @@ ...@@ -25,17 +25,25 @@
</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}}">
<label> {% with answer_count=forloop.counter %}
<input type="radio" {% for answer, label in answers %}
name="{{key}}" {% if forloop.counter == answer_count %}
value="{{answer}}"{% if question.choice == answer %} checked{% endif %} <label for="{{key}}-{{answer_count}}">
{% if question.img_alt %} <input type="radio"
aria-label="{{question.img_alt}} {{label}}" name="{{key}}"
{% else %} id="{{key}}-{{forloop.counter}}"
aria-label="{{question.label|striptags}} {{label}}" value="{{answer}}"{% if question.choice == answer %} checked{% endif %}
{% endif %} {% if question.img_alt %}
/> aria-label="{{question.img_alt}} {{label}}"
</label> {% else %}
aria-label="{{question.label|striptags}} {{label}}"
{% endif %}
/>
<span class="visible-mobile-only">{{label}}</span>
</label>
{% endif %}
{% endfor %}
{% endwith %}
</td> </td>
{% endfor %} {% endfor %}
</tr> </tr>
......
...@@ -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.3.1', version='1.3.2',
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