Changeset View
Changeset View
Standalone View
Standalone View
autotests/folding/test.mustache.fold
- This file was added.
1 | <beginfold id='24'><!--</beginfold id='24'> Mustache / Handlebars / Ractive template <endfold id='24'>--></endfold id='24'> | ||||
---|---|---|---|---|---|
2 | <beginfold id='4'><!DOCTYPE </beginfold id='4'>html<endfold id='4'>></endfold id='4'> | ||||
3 | <html> | ||||
4 | <head> | ||||
5 | <meta charset="UTF-8" /> | ||||
6 | <title>{{title}}</title> | ||||
7 | </head> | ||||
8 | <beginfold id='24'><!--</beginfold id='24'> CSS <endfold id='24'>--></endfold id='24'> | ||||
9 | <beginfold id='1'><style</beginfold id='1'>> | ||||
10 | <beginfold id='33'>/*</beginfold id='33'> Mustache variable support in CSS is incomplete <endfold id='33'>*/</endfold id='33'> | ||||
11 | {{mustache}} | ||||
12 | [ {{other}} ] | ||||
13 | body <beginfold id='27'>{</beginfold id='27'> | ||||
14 | {{{other}}} | ||||
15 | font-size: 15pt; | ||||
16 | font-family: Verdana; | ||||
17 | <endfold id='27'>}</endfold id='27'> | ||||
18 | <endfold id='1'></style</endfold id='1'>> | ||||
19 | <beginfold id='24'><!--</beginfold id='24'> JavaScript <endfold id='24'>--></endfold id='24'> | ||||
20 | <beginfold id='2'><script</beginfold id='2'>> | ||||
21 | var foo = {{bar}}; | ||||
22 | `template {{foo}} ${ var a = {{b}} }` | ||||
23 | <endfold id='2'></script</endfold id='2'>> | ||||
24 | | ||||
25 | <body> | ||||
26 | <beginfold id='6'>{{#movie</beginfold id='6'>}} | ||||
27 | <beginfold id='10'><div</beginfold id='10'>> | ||||
28 | <h1>{{title}}</h1> | ||||
29 | <img src="{{poster}}" alt="{{title}}"/> | ||||
30 | <endfold id='10'></div</endfold id='10'>> | ||||
31 | <beginfold id='10'><div</beginfold id='10'>> | ||||
32 | Rating - {{ratings.critics_rating}} | ||||
33 | <endfold id='10'></div</endfold id='10'>> | ||||
34 | <endfold id='6'>{{/movie}}</endfold id='6'> | ||||
35 | <beginfold id='6'>{{^movie</beginfold id='6'>}} | ||||
36 | <beginfold id='10'><div</beginfold id='10'>> | ||||
37 | Movie Does Not Exist :( | ||||
38 | <endfold id='10'></div</endfold id='10'>> | ||||
39 | <endfold id='6'>{{/movie}}</endfold id='6'> | ||||
40 | <beginfold id='8'>{{!</beginfold id='8'> this is a comment TODO ALERT <endfold id='8'>}}</endfold id='8'> | ||||
41 | | ||||
42 | This is a partial {{> partial1 }} | ||||
43 | <beginfold id='6'>{{#block</beginfold id='6'> | ||||
44 | param=foo | ||||
45 | param2=bar}} | ||||
46 | {{block foo=bar}} | ||||
47 | <endfold id='6'>{{/block}}</endfold id='6'> | ||||
48 | | ||||
49 | <beginfold id='24'><!--</beginfold id='24'> Handlebars <endfold id='24'>--></endfold id='24'> | ||||
50 | | ||||
51 | <beginfold id='6'>{{#list</beginfold id='6'> people}}{{firstName}} {{lastName}}<endfold id='6'>{{/list}}</endfold id='6'> | ||||
52 | <beginfold id='6'>{{#noop</beginfold id='6'>}}{{body}}<endfold id='6'>{{/noop}}</endfold id='6'> | ||||
53 | <beginfold id='6'>{{#with</beginfold id='6'> story}} | ||||
54 | <beginfold id='10'><div</beginfold id='10'> class="intro">{{{intro}}}<endfold id='10'></div</endfold id='10'>> | ||||
55 | <beginfold id='10'><div</beginfold id='10'> class="body">{{{body}}}<endfold id='10'></div</endfold id='10'>> | ||||
56 | <endfold id='6'>{{/with}}</endfold id='6'> | ||||
57 | <beginfold id='6'>{{#each</beginfold id='6'> comments}} | ||||
58 | <beginfold id='10'><div</beginfold id='10'> class="comment"> | ||||
59 | <h2>{{subject}}</h2> | ||||
60 | {{{body}}} | ||||
61 | <endfold id='10'></div</endfold id='10'>> | ||||
62 | <endfold id='6'>{{/each}}</endfold id='6'> | ||||
63 | <beginfold id='6'>{{#list</beginfold id='6'> nav}} | ||||
64 | <a href="{{url}}">{{title}}</a> | ||||
65 | <endfold id='6'>{{/list}}</endfold id='6'> | ||||
66 | | ||||
67 | <beginfold id='7'>{{!--</beginfold id='7'> Conditionals <endfold id='7'>--}}</endfold id='7'> | ||||
68 | <beginfold id='6'>{{#if</beginfold id='6'> isActive}} | ||||
69 | <img src="star.gif" alt="Active"> | ||||
70 | {{else if isInactive}} | ||||
71 | <img src="cry.gif" alt="Inactive"> | ||||
72 | {{else}} | ||||
73 | <img src="cry.gif" alt=""> | ||||
74 | <endfold id='6'>{{/if}}</endfold id='6'> | ||||
75 | | ||||
76 | <beginfold id='7'>{{!--</beginfold id='7'> Escaping <endfold id='7'>--}}</endfold id='7'> | ||||
77 | \{{escaped}} | ||||
78 | <beginfold id='5'>{{{{raw}}}}</beginfold id='5'> | ||||
79 | {{escaped}} | ||||
80 | <endfold id='5'>{{{{/raw}}}}</endfold id='5'> | ||||
81 | | ||||
82 | <beginfold id='7'>{{!--</beginfold id='7'> Whitespace Control <endfold id='7'>--}}</endfold id='7'> | ||||
83 | <beginfold id='6'>{{#each</beginfold id='6'> nav ~}} | ||||
84 | <a href="{{url}}"> | ||||
85 | <beginfold id='6'>{{~#if</beginfold id='6'> test}} | ||||
86 | {{~title}} | ||||
87 | {{~^~}} | ||||
88 | Empty | ||||
89 | {{~/if~<endfold id='6'>}}</endfold id='6'> | ||||
90 | </a> | ||||
91 | <endfold id='6'>{{~/each}}</endfold id='6'> | ||||
92 | | ||||
93 | <beginfold id='7'>{{!--</beginfold id='7'> Helpers <endfold id='7'>--}}</endfold id='7'> | ||||
94 | {{link "See more..." story.url}} | ||||
95 | {{log "Look at me!" level="error"}} | ||||
96 | | ||||
97 | <beginfold id='7'>{{!--</beginfold id='7'> Partial <endfold id='7'>--}}</endfold id='7'> | ||||
98 | {{> myPartial name=../name }} | ||||
99 | <beginfold id='6'>{{#> myPartial</beginfold id='6'> }} | ||||
100 | Failover content | ||||
101 | <endfold id='6'>{{/myPartial}}</endfold id='6'> | ||||
102 | <beginfold id='6'>{{#*inline</beginfold id='6'> "myPartial"}} | ||||
103 | My Content | ||||
104 | <endfold id='6'>{{/inline}}</endfold id='6'> | ||||
105 | <beginfold id='6'>{{#each</beginfold id='6'> children}} | ||||
106 | {{> myPartial}} | ||||
107 | <endfold id='6'>{{/each}}</endfold id='6'> | ||||
108 | | ||||
109 | </body> | ||||
110 | </html> |