Skip to content

Instantly share code, notes, and snippets.

@karlwestin
Created November 19, 2013 16:00
Show Gist options
  • Save karlwestin/7547640 to your computer and use it in GitHub Desktop.
Save karlwestin/7547640 to your computer and use it in GitHub Desktop.
nightmare nested handlebars example
{{#when-eq frequency "bi-weekly"}}
every other {{formatDate ../deliverBy "dddd"}}, starting on {{formatDate ../deliverBy "MMM d, yyyy"}}.
{{/when-eq}}
{{#when-eq frequency "monthly"}}
on the {{englishDay ../day }} every month, starting on {{formatDate ../deliverBy "MMM d, yyyy"}}.
{{/when-eq}}
{{#when-eq frequency "one-time"}}
on {{formatDate ../deliverBy "MMM d, yyyy"}}.
{{/when-eq}}
{{#when-eq type "type-c"}}
<small data-qa="review-special-transaction">
This is a special type c transaction.
</small>
{{else}}
{{#when-eq frequency "one-time"}}
<small data-qa="review-slow-message">This is a transaction of type b {{formatDate ../collectBy "MMM d, yyyy"}}.</small>
{{else}}
<small data-qa="review-slow-message">This is a transaction of type a</small>
{{/when-eq}}
<small>
{{#if mayQualify}}
<b data-qa="review-qualify-message">
These accounts will qualify for other transactions types after this payment is successful.
</b>
{{else}}
<b data-qa="review-blocked-message">
These accounts do not qualify for special transaction types.
</b>
{{/if}}
</small>
{{/when-eq}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment