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
bd93e485
Commit
bd93e485
authored
Nov 09, 2015
by
Braden MacDonald
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9 from open-craft/results-width
Fix: Results view is too narrow when no images are present
parents
f119cff5
fa0aa99f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
8 deletions
+14
-8
poll/poll.py
+7
-5
poll/public/css/poll.css
+5
-1
poll/public/handlebars/poll_results.handlebars
+2
-2
No files found.
poll/poll.py
View file @
bd93e485
...
...
@@ -318,7 +318,6 @@ class PollBlock(PollBase):
total
=
0
self
.
clean_tally
()
source_tally
=
self
.
tally
any_img
=
self
.
any_image
(
self
.
answers
)
for
key
,
value
in
answers
.
items
():
count
=
int
(
source_tally
[
key
])
tally
.
append
({
...
...
@@ -330,7 +329,6 @@ class PollBlock(PollBase):
'first'
:
False
,
'choice'
:
False
,
'last'
:
False
,
'any_img'
:
any_img
,
})
total
+=
count
...
...
@@ -437,9 +435,13 @@ class PollBlock(PollBase):
self
.
publish_event_from_dict
(
self
.
event_namespace
+
'.view_results'
,
{})
detail
,
total
=
self
.
tally_detail
()
return
{
'question'
:
markdown
(
self
.
question
),
'tally'
:
detail
,
'total'
:
total
,
'feedback'
:
markdown
(
self
.
feedback
),
'plural'
:
total
>
1
,
'display_name'
:
self
.
display_name
,
'question'
:
markdown
(
self
.
question
),
'tally'
:
detail
,
'total'
:
total
,
'feedback'
:
markdown
(
self
.
feedback
),
'plural'
:
total
>
1
,
'display_name'
:
self
.
display_name
,
'any_img'
:
self
.
any_image
(
self
.
answers
),
}
@XBlock.json_handler
...
...
poll/public/css/poll.css
View file @
bd93e485
...
...
@@ -38,12 +38,16 @@
.percentage-gauge-container
{
display
:
inline-block
;
width
:
65
%
;
width
:
87
%
;
vertical-align
:
middle
;
position
:
relative
;
background-color
:
#fafbfc
;
}
.poll-results.has-images
.percentage-gauge-container
{
width
:
65%
;
}
ul
.poll-answers
,
ul
.poll-answers-results
{
list-style-type
:
none
!important
;
max-width
:
80%
;
...
...
poll/public/handlebars/poll_results.handlebars
View file @
bd93e485
<script
id=
"poll-results-template"
type=
"text/html"
>
<
h3
class
=
"poll-header"
>
{{
display_name
}}
<
/h3
>
<
div
class
=
"poll-question-container"
>
{{{
question
}}}
<
/div
>
<
ul
class
=
"poll-answers-results poll-results"
>
<
ul
class
=
"poll-answers-results poll-results
{{
~#
if
any_img
}}
has-images
{{/if}}
"
>
{{#
each
tally
}}
<
li
class
=
"poll-result"
>
<
div
class
=
"poll-result-input-container"
>
<
input
id
=
"answer-
{{
key
}}
"
type
=
"radio"
disabled
{{#if
choice
}}
checked
{{/if}}
/>
<
/div
>
{{
~#
if
any_img
~
}}
{{
~#
if
..
/
any_img
~
}}
<
div
class
=
"poll-image result-image"
>
<
label
for
=
"answer-
{{
key
}}
"
class
=
"poll-image-label"
>
{{#if
img
}}
...
...
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