Created
January 17, 2012 02:11
-
-
Save vybs/1624114 to your computer and use it in GitHub Desktop.
Reuse partials in dust with override contexts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form class="standard-form" id="{name}_id" name="{name}" method="{method}" action="{action}"> | |
<fieldset> | |
<p class="task-content">Worked from</p> | |
<ul> | |
{! showStartDate !} | |
<li class="start-date" style="display:none"> | |
{#startDateMonth choose="Choose"} | |
{>singleSelect/} | |
{/startDateMonth} | |
{>inputText:startDateYear/} | |
</li> | |
{! showEndDate !} | |
<li class="end-date" id="date-past"> | |
{#endDateMonth choose="Choose"} | |
{>singleSelect/} | |
{/endDateMonth} | |
// reuse the same partial with a different context in the JSON | |
{>inputText:endDateYear/} | |
</li> | |
</ul> | |
</form> | |
Partial for input text :inputText.dust | |
----------------------------- | |
<input type="text" id="{.id}" value="{.value|s}" name="{.name}" {.extras} {+formExtras/}/> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://engineering.linkedin.com/frontend/client-side-templating-throwdown-mustache-handlebars-dustjs-and-more