decide.nolog.cz/index.html

166 lines
No EOL
5 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Croodle</title>
</head>
<body>
<!--
TEMPLATES
-->
<!-- application template -->
<script type="text/x-handlebars">
<div class="main">
<h1>Croodle</h1>
{{outlet}}
</div>
</script>
<!-- loading template -->
<script type="text/x-handlebars" id="loading">
<div id="loading">loading...</div>
</script>
<!-- error template -->
<script type="text/x-handlebars" id="error">
<div id="loading">
<h2>error</h2>
<p>{{status}}<br/>{{statusText}}</p>
</div>
</script>
<!-- poll template -->
<script type="text/x-handlebars" id="poll">
<h2>title</h2>
<p>{{title}}</p>
<h2>description</h2>
<p>{{description}}</p>
<h2>type</h2>
<p>{{pollType}}</p>
<h2>answer type</h2>
<p>{{answerType}}</p>
<h2>options and user</h2>
<table>
<thead>
<tr>
<td>user</td>
{{#each option in options}}
<td>{{option.title}}</td>
{{/each}}
<td>&nbsp;</td>
</tr>
</thead>
<tbody>
{{#each user in users}}
<tr>
<td>{{user.name}}</td>
{{#each selection in user.selections}}
<td>{{selection.value}}</td>
{{/each}}
<td>&nbsp;</td>
</tr>
{{/each}}
<tr class='newUser'>
<td>{{input value=view.newUserName}}</td>
{{#each newUserSelection in view.newUserSelections}}
<td>
{{#if isFreeText}}
{{input value=newUserSelection.value}}
{{else}}
{{view Ember.Select
contentBinding="answers"
optionValuePath="content.label"
optionLabelPath="content.label"
prompt="Please select an answer"
valueBinding="newUserSelection.value"}}
{{/if}}
</td>
{{/each}}
<td><button {{action "addNewUser" target="view"}}> ok </button></td>
</tr>
</tbody>
</table>
<h2>creationDate</h2>
<p>{{creationDate}}</p>
</script>
<!-- create templates -->
<script type="text/x-handlebars" id="create">
{{outlet}}
</script>
<script type="text/x-handlebars" id="create/index">
<h2>create a poll</h2>
<p>
type:<br/>
{{view Ember.Select
contentBinding="App.PollTypes"
optionValuePath="content.id"
optionLabelPath="content.label"
prompt="Please select a poll type"
valueBinding="pollType"
}}
</p>
<p><button {{action "save"}}> ok </button></p>
</script>
<script type="text/x-handlebars" id="create/meta">
<h2>meta data</h2>
<p>title:<br/>{{input value=title}}</p>
<p>description:<br/>{{textarea value=description}}</p>
<p><button {{action "save"}}> ok </button></p>
</script>
<script type="text/x-handlebars" id="create/options">
<h2>options</h2>
</p>
{{#each option in options}}
{{view Ember.TextField valueBinding="option.title"}}<br/>
{{/each}}
</p>
<p><button {{action "moreOptions" target="view"}}> add option </button></p>
<p><button {{action "saveOptions"}}> save </button></p>
</script>
<script type="text/x-handlebars" id="create/settings">
<h2>settings</h2>
<p>answer type:<br/>
{{view Ember.Select
contentBinding="App.AnswerTypes"
optionValuePath="content.id"
optionLabelPath="content.label"
value="YesNo"
prompt="Please define available answers"
valueBinding="answerType"}}
</p>
<p><button {{action "save"}}> ok </button></p>
</script>
<!-- configuration -->
<script type="text/javascript">
// enable ember query-params-new feature
window.ENV = {
FEATURES: {
'query-params-new': true
}
};
</script>
<!-- loading libaries -->
<script src="js/lib/sjcl.js"></script>
<script src="js/lib/jquery.js"></script>
<script src="js/lib/handlebars.js"></script>
<script src="js/lib/ember.js"></script>
<script src="js/lib/ember-data.js"></script>
<script src="js/lib/embedded-adapter.js"></script>
<script src="js/croodle.js"></script>
</body>
</html>