Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-poll
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
xblock-poll
Commits
d43543a7
Commit
d43543a7
authored
Jul 25, 2017
by
murad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Survey UI responsive structure for mobile
parent
e1ea9b05
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
2 deletions
+60
-2
poll/public/css/poll.css
+50
-0
poll/public/html/survey.html
+10
-2
No files found.
poll/public/css/poll.css
View file @
d43543a7
...
...
@@ -280,3 +280,53 @@ th.survey-answer {
height
:
100%
;
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
{
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
;
width
:
calc
(
100%
-
18px
);
padding
:
8px
0
;
}
}
poll/public/html/survey.html
View file @
d43543a7
...
...
@@ -25,9 +25,9 @@
</th>
{% for answer, label in answers %}
<td
class=
"survey-option"
headers=
"poll-{{block_id}}-{{key}} poll-{{block_id}}-{{answer}}"
>
<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}}"
...
...
@@ -35,7 +35,15 @@
aria-label=
"{{question.label|striptags}} {{label}}"
{%
endif
%}
/>
</label>
{% with answer_count=forloop.counter %}
{% for answer, label in answers %}
{% if forloop.counter == answer_count %}
<label
class=
"visible-mobile-only"
for=
"{{key}}-{{answer_count}}"
>
{{label}}
</label>
{% endif %}
{% endfor %}
{% endwith %}
</td>
{% endfor %}
</tr>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment