node-simple-router
Version:
Yet another minimalistic router for node.js
43 lines (40 loc) • 1.79 kB
HTML
<div class="row" style="margin-top: 3em;">
<div class="col-xs-5" style="padding: 0.5em; margin: 0.5em; background: #ededed; border-radius: 7px; border: solid 1px;">
<h3 style="text-align: center;">Template Settings</h3>
<form class="form" method="post">
<label for="txt-context">Context Object</label><br>
<textarea rows="7" style="position: relative; max-width: 100%; min-width: 100%;" id="txt-context" name="txt_context">
{name: "Sandy",
hasHobbies: true,
hobbies: [{title: "Playing Chess"},{title: "Programming computers"},{title: "Riding my bike"}],
bg: '#cceaff', pad: 1.5, radius: 10}
</textarea>
<hr/>
<label for="txt-template">Template Text</label><br>
<textarea rows="8" style="position: relative; max-width: 100%; min-width: 100%;" id="txt-template" name="txt_template">
<div style="background: {{bg}}; padding: {{pad}}em; border-radius: {{radius}}px;">
<h3>Hi, I am <span class="nsr">{{name}}</span></h3>
{{#hasHobbies}}
<p>and my hobbies are:</p>
<ul class="list-group">
{{#hobbies}}
<li class="list-group-item">{{title}}</li>
{{/hobbies}}
</ul>
{{/hasHobbies}}
{{^hasHobbies}}
<p>Regretably, no hobbies... :-(</p>
{{/hasHobbies}}
</div>
</textarea>
<button class="btn btn-primary" style="margin-top: 3px;" type="submit">Show Result</button>
<button class="btn btn-danger" style="margin-top: 3px;" type="reset">Reset</button>
</form>
</div>
<div class="col-xs-6" style="padding: 0.5em; margin: 0.5em; border-radius: 7px; border: solid 1px;">
<h3 style="text-align: center;">Template Result</h3>
<hr/>
<div id="template-result">
</div>
</div>
</div>