Files
meteor/packages/templating/templating_tests.html
2012-08-21 02:42:00 -04:00

281 lines
6.9 KiB
HTML

<template name="test_assembly_a0">
{{> test_assembly_a1}}
</template>
<template name="test_assembly_a1">
{{> test_assembly_a2}}
</template>
<template name="test_assembly_a2">
{{> test_assembly_a3}}
</template>
<template name="test_assembly_a3">
Hi
</template>
<template name="test_assembly_b0">
{{> test_assembly_b1}}
</template>
<template name="test_assembly_b1">
x{{#if stuff}}y{{/if}}{{> test_assembly_b2}}
</template>
<template name="test_assembly_b2">
hi
</template>
<template name="test_table_a0">
<table>
{{> test_table_a1}}
{{> test_table_a1}}
{{> test_table_a1}}
</table>
</template>
<template name="test_table_a1">
<tr>
{{> test_table_a2}}
</tr>
</template>
<template name="test_table_a2">
<td>
{{> test_table_a3}}
</td>
</template>
<template name="test_table_a3">
Foo.
</template>
<template name="test_table_b0">
<table>
<tbody>
{{> test_table_b1}}
{{> test_table_b1}}
{{> test_table_b1}}
</tbody>
</table>
</template>
<template name="test_table_b1">
<tr>
{{> test_table_b2}}
</tr>
</template>
<template name="test_table_b2">
<td>
{{> test_table_b3}}
</td>
</template>
<template name="test_table_b3">
Foo.
</template>
<template name="test_table_each">
<table>
{{#each foo}}
<tr><td>{{bar}}</td></tr>
{{/each}}
</table>
</template>
<template name="test_event_data_with">
<div>
xxx
{{#with TWO}}
<div>
xxx
{{#with THREE}}
<div>
xxx
</div>
{{/with}}
</div>
{{/with}}
</div>
</template>
<template name="test_safestring_a">
{{foo}} {{{foo}}} {{bar}} {{{bar}}}
{{#foo}}{{/foo}} {{#bar}}{{/bar}}
{{fooprop}} {{{fooprop}}} {{barprop}} {{{barprop}}}
{{#fooprop}}{{/fooprop}} {{#barprop}}{{/barprop}}
</template>
<template name="test_helpers_a">
platypus={{platypus}}
watermelon={{watermelon}}
daisy={{daisy}}
tree={{tree}}
warthog={{warthog}}
</template>
<template name="test_helpers_b">
unknown={{unknown}}
zero={{zero}}
</template>
<template name="test_helpers_c">
platypus.X={{platypus.X}}
watermelon.X={{watermelon.X}}
daisy.X={{daisy.X}}
tree.X={{tree.X}}
warthog.X={{warthog.X}}
</template>
<template name="test_helpers_d">
daisygetter={{daisygetter}}
thisTest={{thisTest}}
{{#with fancy}}
../thisTest={{../thisTest}}
{{/with}}
{{#with "foo"}}
../fancy.currentFruit={{../fancy.currentFruit}}
{{/with}}
</template>
<template name="test_helpers_e">
fancy.foo={{fancy.foo}}
fancy.apple.banana={{fancy.apple.banana}}
fancy.currentFruit={{fancy.currentFruit}}
fancy.currentCountry.name={{fancy.currentCountry.name}}
fancy.currentCountry.population={{fancy.currentCountry.population}}
fancy.currentCountry.unicorns={{fancy.currentCountry.unicorns}}
</template>
<template name="test_helpers_f">
fancyhelper.foo={{fancyhelper.foo}}
fancyhelper.apple.banana={{fancyhelper.apple.banana}}
fancyhelper.currentFruit={{fancyhelper.currentFruit}}
fancyhelper.currentCountry.name={{fancyhelper.currentCountry.name}}
fancyhelper.currentCountry.population={{fancyhelper.currentCountry.population}}
fancyhelper.currentCountry.unicorns={{fancyhelper.currentCountry.unicorns}}
</template>
<template name="test_helpers_g">
platypus={{platypus}}
this.platypus={{this.platypus}}
</template>
<template name="test_helpers_h">
(methodListFour 6 7 8 9={{methodListFour 6 7 8 9}})
(methodListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns={{methodListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns}})
(methodListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns a=platypus b=thisTest c=fancyhelper.currentFruit d=fancyhelper.currentCountry.unicorns={{methodListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns a=platypus b=thisTest c=fancyhelper.currentFruit d=fancyhelper.currentCountry.unicorns}})
(helperListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns={{helperListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns}})
(helperListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns a=platypus b=thisTest c=fancyhelper.currentFruit d=fancyhelper.currentCountry.unicorns={{helperListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns a=platypus b=thisTest c=fancyhelper.currentFruit d=fancyhelper.currentCountry.unicorns}})
</template>
<template name="test_helpers_i">
(uppercase apple={{#uppercase}}apple{{/uppercase}})
(altered banana={{#tr a="o" n="d"}}banana{{/tr}})
(nokeys={{#arg_and_dict "foo" x="foo"}}{{/arg_and_dict}})
(nokeys={{#arg_and_dict tree x="foo"}}{{/arg_and_dict}})
(biggie={{#get_arg helperListFour platypus thisTest fancyhelper.currentFruit fancyhelper.currentCountry.unicorns a=platypus b=thisTest c=fancyhelper.currentFruit d=fancyhelper.currentCountry.unicorns}}{{/get_arg}})
(twoArgBlock={{#two_args "foo" "foo"}}{{/two_args}})
</template>
<template name="test_render_a">
{{foo}}<br><hr>
</template>
<template name="test_render_b">
{{#with 200}}{{foo}}<br><hr>{{/with}}
</template>
<template name="test_render_c">
<br><hr>
</template>
<template name="test_branches_a">
<span>{{var}}</span>
{{#myConstant}}<hr/>{{/myConstant}}
{{#if 1}}
{{#myConstant}}<hr/>{{/myConstant}}
{{/if}}
{{#myConstant}}<hr/>{{/myConstant}}
</template>
<template name="test_listmatching_a0">
<span>{{var}}</span>
<p>
{{#each c}}
{{> test_listmatching_a1}}
{{/each}}
</p>
</template>
<template name="test_listmatching_a1">
{{letter}}
</template>
<template name="test_isolate_a">
{{helper 1}}
{{#isolate}}
{{helper 2}}
{{#isolate}}
{{helper 3}}
{{#isolate}}
{{helper 4}}
{{/isolate}}
{{/isolate}}
{{/isolate}}
</template>
<template name="test_template_arg_a">
<b>Foo</b> <i>Bar</i> <u>Baz</u>
</template>
<template name="test_template_preserve_a">
<span class="a">x</span>
<span class="b">x</span>
<span class="c">x</span>
<span class="d">x</span>
<span class="y">x</span>
<span class="e">x</span>
<span class="z">x</span>
<span class="f">x</span>
<u>{{var}}</u>
</template>
<template name="test_template_helpers_a">
{{foo}}{{bar}}{{baz}}
</template>
<template name="test_template_helpers_b">
{{name}}{{arity}}{{toString}}{{length}}{{var}}
</template>
<template name="test_template_helpers_c">
{{name}}{{arity}}{{toString}}{{length}}{{var}}x
</template>
<template name="test_template_events_a">
<b>foo</b><u>bar</u><i>baz</i>
</template>
<template name="test_template_events_b">
<b>foo</b><u>bar</u><i>baz</i>
</template>
<template name="test_template_eachrender_a">
{{#each entries}}
<div>{{x}}</div>
{{/each}}
</template>
<template name="test_template_eachrender_b">
{{#each entries}}
<div>{{x}}</div>
{{/each}}
</template>