-
Notifications
You must be signed in to change notification settings - Fork 0
/
main-category-raw.html
91 lines (58 loc) · 2.72 KB
/
main-category-raw.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>RC Get Prepared</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<!-- Makes your prototype chrome-less once bookmarked to your phone's home screen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!-- Include the compiled Ratchet CSS -->
<link href="css\ratchet.css" rel="stylesheet">
</head>
<body>
<div class="content-padded">
<div class="resultsSubCategories"> </div>
</div>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="app.js"></script>
<script>
$(function () {
//PopulateRecommendedTasks();
PopulateAllSubCategories();
});
function PopulateRecommendedTasks() {
var mainCategoryName = getParameterByName("category-name");
GetKenticoCloudRowsByPath(mainCategoryName).then(function (data) {
var mainCategory = data.item;
var recommendedTasks = data.modular_content;
for (var recommendedTaskName in recommendedTasks) {
var subItemTitle = "" + recommendedTasks[recommendedTaskName].elements.title.value + CSVSEPERATOR;
var subItemSummary = "" + recommendedTasks[recommendedTaskName].elements.description.value + CSVSEPERATOR;
var html_2 = '<br />';
$('.results').text(html_1 + subItemTitle + subItemSummary + html_2);
}
});
}
function PopulateAllSubCategories() {
GetKenticoCloudRowsbyType("sub_category").then(function (data) {
var subCategories = data.items;
var tasks = data.modular_content;
var htmlString = "[" + BREAKLINE;
var htmlString = " {" + BREAKLINE;
for(var subCategory of subCategories) {
for(var subCategoryTask of subCategory.elements.tasks.value) {
var task = tasks[subCategoryTask];
htmlString += " " + LABEL_ID;
htmlString += subCategory.elements.title.value;
htmlString += task.elements.title.value + CSVSEPERATOR + htmlEscape(task.elements.description.value) ;
htmlString += "<br />";
}
}
$('.resultsSubCategories').append(htmlString);
});
}
</script>
</body>
</html>