Skip to content

Commit 813aab6

Browse files
committed
DRYer templates.
1 parent 750ded5 commit 813aab6

File tree

9 files changed

+43
-69
lines changed

9 files changed

+43
-69
lines changed

templates/color-release.hbs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<ul>
2+
<li>{{release "jQuery Color" this}}</li>
3+
{{#if svgNames}}
4+
<li>{{release "jQuery Color SVG Color Names" svgNames}}</li>
5+
{{/if}}
6+
{{#if plusNames}}
7+
<li>{{release "jQuery Color With Names (last two together)" plusNames}}</li>
8+
{{/if}}
9+
</ul>

templates/color.hbs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,5 @@
44

55
{{#each color.all}}
66
<h2>{{version}}</h2>
7-
<ul>
8-
<li>{{release "jQuery Color" this}}</li>
9-
{{#if svgNames}}
10-
<li>{{release "jQuery Color SVG Color Names" svgNames}}</li>
11-
{{/if}}
12-
{{#if plusNames}}
13-
<li>{{release "jQuery Color With Names (last two together)" plusNames}}</li>
14-
{{/if}}
15-
</ul>
7+
{{include "color-release"}}
168
{{/each}}

templates/index.hbs

Lines changed: 5 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -36,31 +36,11 @@
3636
</p>
3737

3838
{{#with ui.[0]}}
39-
<h3>jQuery UI {{major}}</h3>
40-
{{#with latestStable}}
41-
<ul>
42-
<li>{{release "jQuery UI" this}}</li>
43-
<li>Themes:
44-
{{#each themes}}
45-
<a href="/ui/{{../version}}/themes/{{this}}/jquery-ui.css">{{this}}</a>
46-
{{/each}}
47-
</li>
48-
</ul>
49-
{{/with}}
39+
{{include "ui-latest"}}
5040
{{/with}}
5141

5242
{{#with ui.[1]}}
53-
<h3>jQuery UI {{major}}</h3>
54-
{{#with latestStable}}
55-
<ul>
56-
<li>{{release "jQuery UI" this}}</li>
57-
<li>Themes:
58-
{{#each themes}}
59-
<a href="/ui/{{../version}}/themes/{{this}}/jquery-ui.css">{{this}}</a>
60-
{{/each}}
61-
</li>
62-
</ul>
63-
{{/with}}
43+
{{include "ui-latest"}}
6444
{{/with}}
6545

6646
{{#with color.latestStable}}
@@ -69,15 +49,7 @@
6949
Showing the latest stable release for jQuery Color.
7050
<a href="/color/">See all versions of jQuery Color</a>.
7151
</p>
72-
<ul>
73-
<li>{{release "jQuery Color" this}}</li>
74-
{{#if svgNames}}
75-
<li>{{release "jQuery Color SVG Color Names" svgNames}}</li>
76-
{{/if}}
77-
{{#if plusNames}}
78-
<li>{{release "jQuery Color With Names (last two together)" plusNames}}</li>
79-
{{/if}}
80-
</ul>
52+
{{include "color-release"}}
8153
{{/with}}
8254

8355
{{#with mobile.latestStable}}
@@ -87,15 +59,7 @@
8759
<a href="/mobile/">See all versions of jQuery Mobile</a>.
8860
</p>
8961
<ul>
90-
<li>
91-
jQuery Mobile {{version}} -
92-
<a href="/mobile/{{version}}/{{filename}}">uncompressed</a>,
93-
<a href="/mobile/{{version}}/{{minified}}">minfied</a>,
94-
<a href="/mobile/{{version}}/{{minifiedCss}}">theme</a>
95-
{{#if minifiedStructure}}
96-
(<a href="/mobile/{{version}}/{{minifiedStructure}}">structure only</a>)
97-
{{/if}}
98-
</li>
62+
{{include "mobile-release"}}
9963
</ul>
10064
{{/with}}
10165

@@ -107,10 +71,6 @@
10771

10872
{{#with qunit.latestStable}}
10973
<ul>
110-
<li>
111-
QUnit {{version}} -
112-
<a href="/{{filename}}">uncompressed</a>,
113-
<a href="/{{theme}}">theme</a>
114-
</li>
74+
{{include "qunit-release"}}
11575
</ul>
11676
{{/with}}

templates/jquery-git.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h3>jQuery - Live git versions</h3>
1+
<h2>jQuery Core &amp; Migrate - Git Builds</h2>
22
<p>UNSTABLE, NOT FOR PRODUCTION</p>
33

44
<ul>

templates/mobile-release.hbs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<li>
2+
jQuery Mobile {{version}} -
3+
<a href="/mobile/{{version}}/{{filename}}">uncompressed</a>,
4+
<a href="/mobile/{{version}}/{{minified}}">minfied</a>,
5+
<a href="/mobile/{{version}}/{{minifiedCss}}">theme</a>
6+
{{#if minifiedStructure}}
7+
(<a href="/mobile/{{version}}/{{minifiedStructure}}">structure only</a>)
8+
{{/if}}
9+
</li>

templates/mobile.hbs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,5 @@
33
}</script>
44

55
{{#each mobile.all}}
6-
<li>
7-
jQuery Mobile {{version}} -
8-
<a href="/mobile/{{version}}/{{filename}}">uncompressed</a>,
9-
<a href="/mobile/{{version}}/{{minified}}">minfied</a>,
10-
<a href="/mobile/{{version}}/{{minifiedCss}}">theme</a>
11-
{{#if minifiedStructure}}
12-
(<a href="/mobile/{{version}}/{{minifiedStructure}}">structure only</a>)
13-
{{/if}}
14-
</li>
6+
{{include "mobile-release"}}
157
{{/each}}

templates/qunit-release.hbs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<li>
2+
QUnit {{version}} -
3+
<a href="/{{filename}}">uncompressed</a>,
4+
<a href="/{{theme}}">theme</a>
5+
</li>

templates/qunit.hbs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,5 @@
33
}</script>
44

55
{{#each qunit.all}}
6-
<li>
7-
QUnit {{version}} -
8-
<a href="/{{filename}}">uncompressed</a>,
9-
<a href="/{{theme}}">theme</a>
10-
</li>
6+
{{include "qunit-release"}}
117
{{/each}}

templates/ui-latest.hbs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<h3>jQuery UI {{major}}</h3>
2+
{{#with latestStable}}
3+
<ul>
4+
<li>{{release "jQuery UI" this}}</li>
5+
<li>Themes:
6+
{{#each themes}}
7+
<a href="/ui/{{../version}}/themes/{{this}}/jquery-ui.css">{{this}}</a>
8+
{{/each}}
9+
</li>
10+
</ul>
11+
{{/with}}

0 commit comments

Comments
 (0)