Commit 45b3d590 by Jonathan Piacenti

Began work on formatting the results per the specification.

parent f2a5de2a
.poll-answer {
margin-left: 1em;
font-weight: bold;
}
.percentage-gauge {
display: inline-block;
background-color: #e5ebee;
float:right;
height: 1.2em;
}
.poll-result-input-container {
float: left;
}
.percentage-gauge-container {
width: auto;
overflow: hidden;
}
ul.poll-answers, ul.poll-answers-results {
list-style-type: none;
}
.poll-answer-text-container {
position: relative;
top: -1.2em;
left: .2em;
font-weight: bold;
}
.poll-percent-container {
float: right;
}
\ No newline at end of file
<script id="results" type="text/html">
<h2>{{question}}</h2>
<ul>
{{{question}}}
<ul class="poll-answers-results">
{{#each tally}}
<li class="poll-result">
<input id="answer-{{key}}" type="radio" disabled {{#if choice}}checked="True"{{/if}} />
<span class="percentage-guage" style="width:{{percentage}}%;"></span>
<label for="answer-{{key}}">{{answer}}</label>
<span class="poll-percent-display{{#if top}} poll-top-choice{{/if}}">{{percent}}%</span>
<div class="result-answer-container">
<div class="poll-result-input-container">
<input id="answer-{{key}}" type="radio" disabled {{#if choice}}checked="True"{{/if}} />
</div>
<div class="percentage-gauge-container">
<div class="percentage-gauge" style="width:{{percent}}%;"></div>
</div>
</div>
<div class="poll-answer-text-container">
<label for="answer-{{key}}">{{answer}}</label>
</div>
<div class="poll-percent-container">
<span class="poll-percent-display{{#if top}} poll-top-choice{{/if}}">{{percent}}%</span>
</div>
</li>
{{/each}}
</ul>
......
......@@ -5,7 +5,7 @@
<form>
<h2>Poll</h2>
{{question|safe}}
<ul>
<ul class="poll-answers">
{% for key, answer in answers %}
<li class="poll-answer">
<input type="radio" name="choice" id="answer-{{number}}" value="{{key}}">
......
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