decide.nolog.cz/app/templates/poll.hbs

150 lines
4.6 KiB
Handlebars
Raw Normal View History

2014-07-06 17:37:54 +02:00
<div id="poll">
<div class="row">
<div class="col-sm-6 col-lg-5">
<div class="box meta-data">
<h2 class="title">{{title}}</h2>
<p class="description">{{description}}</p>
2014-09-29 00:48:26 +02:00
<p class="creationDate">{{t "poll.created-time" creationDateBinding="creationDate"}}</p>
</div>
</div>
<div class="col-sm-6 col-lg-5 col-lg-offset-2">
<div class="box share-link">
2014-09-29 00:48:26 +02:00
<p>{{t "poll.share"}}</p>
<p class="link"><a {{bind-attr href=pollUrl}}>{{pollUrl}}</a></p>
<p class="notice">
2014-09-29 00:48:26 +02:00
{{t "poll.share.notice"}}
</p>
</div>
2014-07-06 17:37:54 +02:00
</div>
</div>
2014-07-06 17:37:54 +02:00
<div class="box">
<div class="table-scroll">
<table class="user-selections-table table table-striped table-condensed">
<thead>
{{#if isDateTime}}
2014-10-25 21:53:10 +02:00
<tr class="dateGroups">
<th>&nbsp;</th>
{{#each dateGroup in dateGroups}}
<th {{bind-attr colspan="dateGroup.colspan"}}>
{{formattedDate dateGroup.value}}
</th>
{{/each}}
<th>&nbsp;</th>
</tr>
{{/if}}
<tr>
<th>&nbsp;</th>
{{#each option in options}}
<th>
{{#if isFindADate}}
{{#if isDateTime}}
{{formattedDate option.title format="LT"}}
{{/if}}
{{#unless isDateTime}}
{{formattedDate option.title}}
{{/unless}}
{{/if}}
2014-07-06 17:37:54 +02:00
{{#if isMakeAPoll}}
{{option.title}}
{{/if}}
</th>
{{/each}}
<th>&nbsp;</th>
</tr>
</thead>
2014-07-06 17:37:54 +02:00
<tbody>
<tr class='newUser'>
<td>
{{#form-for controller}}
{{#input newUserName}}
{{input-field newUserName
placeholderTranslation="poll.input.newUserName.placeholder"
}}
{{#if view.showError}}
{{error-field newUserName}}
{{/if}}
{{/input}}
{{/form-for}}
</td>
{{#each newUserSelection in controller.newUserSelections}}
<td>
{{#form-for newUserSelection}}
{{#if isFreeText}}
{{input value label=" "}}
{{else}}
{{#each answer in answers}}
<div class="radio">
<label>
2014-09-29 00:48:26 +02:00
{{radio-button checked=newUserSelection.value value=answer}}
<span {{bind-attr class="answer.id"}}>
<span {{bind-attr class="answer.icon"}} style="width: 14px;"></span>
2014-09-29 00:48:26 +02:00
{{answer.label}}
</span>
</label>
</div>
{{/each}}
{{/if}}
{{/form-for}}
</td>
{{/each}}
<td>
2014-10-24 01:24:21 +02:00
<button {{action "addNewUser"}} class="btn btn-default btn-primary" {{bind-attr disabled=isNotValid}}>
{{t "poll.save"}}
</button>
</td>
</tr>
2014-07-06 17:37:54 +02:00
{{#each user in users}}
<tr>
<td>{{user.name}}</td>
{{#each selection in user.selections}}
<td>
2014-09-29 00:48:26 +02:00
{{#if isFreeText}}
{{selection.value}}
{{else}}
<span {{bind-attr class="selection.value.id"}}>
2014-09-29 00:48:26 +02:00
<span {{bind-attr class="selection.value.icon"}}></span>
{{selection.value.label}}
</span>
{{/if}}
</td>
{{/each}}
<td>&nbsp;</td>
</tr>
{{/each}}
2014-07-06 17:37:54 +02:00
{{#unless isFreeText}}
<tr class='evaluation evaluation-header'>
2014-09-29 00:48:26 +02:00
<td {{bind-attr colspan=fullRowColspan}}>
2014-10-24 01:24:21 +02:00
{{t "poll.evaluation.label"}}
<button {{action "switchEvaluationVisibility" target="view"}} class="btn btn-default">
{{view.showEvaluationLabel}}
</button>
2014-09-29 00:48:26 +02:00
</td>
</tr>
2014-07-06 17:37:54 +02:00
{{#if view.showEvaluation}}
{{#each answer in evaluation}}
<tr class='evaluation'>
<td>
{{answer.label}}
</td>
2014-07-06 17:37:54 +02:00
{{#each option in answer.options}}
<td>
{{option}}
</td>
{{/each}}
<td>&nbsp;</td>
</tr>
{{/each}}
{{/if}}
{{/unless}}
</tbody>
</table>
</div>
2014-07-06 17:37:54 +02:00
</div>