-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwine-list.html
69 lines (63 loc) · 2.63 KB
/
wine-list.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Concise Handlebars.js</title>
<!-- 0a. CSS -->
<link href="//mikeozornin.ru/blog/themes/plain/styles/main.css" rel="stylesheet">
<link href="//mikeozornin.ru/blog/themes/my/styles/style.css" rel="stylesheet">
<!-- 0a. JS -->
<script src="//code.jquery.com/jquery-2.0.3.min.js"></script><!-- online jquery.js -->
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/1.1.2/handlebars.min.js"></script><!-- online handlebars.js-->
</head>
<body>
<div id="anchor"> </div>
<script id="tpl" type="text/template">
<div class="e2-text-table" style="font-size: 80%; line-height: 1.4; margin-left: -20px; margin-right: -20px;">
<table cellpadding="0" cellspacing="0" border="0" class="sticky-header parfenon-table">
<thead>
<tr>
<td>Выпуск</td>
<td>Требования к вину</td>
<td>Вино Парфенова</td>
<td>Магазины</td>
</tr>
</thead>
<tbody>
{{#wines}}
<tr>
<td data-label="Выпуск">{{#if release.show-release}}<a href="{{release.video-url}}"><img class="parfenon-cover"
src="{{release.cover-url}}"/><span
class="parfenon-release-title">{{release.title}}</span></a>
{{/if}}
</td>
<td data-label="Требования к вину">{{requirements}}</td>
<td data-label="Вино Парфенова">{{#if wine.title}}<a href="{{wine.vivino-url}}">{{#if wine.cover-url}}<img
style="align: right; max-height: 117.5px; max-width: 35px; float: left; margin-right: 30px;"
src="//mikeozornin.ru/parfenon-wine/assets/wine-covers/{{wine.cover-url}}"/>{{/if}}{{wine.title}}</a>{{#if
wine.vivino-rating}}· {{wine.vivino-rating}} ★{{/if}}<br/>{{wine.color}}<br/>Регион: {{wine.region}}<br/>Виноград:
{{wine.grape}}{{/if}}
</td>
<td data-label="Магазины">{{#shops}}
<a href="{{url}}" style="white-space: nowrap;">{{title}}</a> {{price}}</br>
{{/shops}}
{{#unless shops.length}} {{/unless}}
</td>
</tr>
{{/wines}}
</tbody>
</table>
</div>
</script>
<script>
var slingshot = function (url, tplId, anchor) {
$.getJSON(url, function (data) {
let template = $(tplId).html();
let stone = Handlebars.compile(template)(data);
$(anchor).append(stone);
});
}
slingshot('/src/assets/data/data.json', '#tpl', '#anchor');
</script>
</body>
</html>