forked from barryclark/jekyll-now
/
level.html
89 lines (67 loc) · 2.64 KB
/
level.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
---
layout: default
---
<div class="page">
<h1 class="page-title">You're in: Sustainability Level 1</h1>
<p class="lead">Here they are.
<a href="../topic">back to Topic home</a>
<div id="app">
<h1>Chapters in Sustainability Level 1:</h1>
<div class="content-callout">
<a href="../chapter">View an example Chapter</a>
</div>
<ul>
<li v-for="item in items">
<img :src="item['fields']['Image'][0]['thumbnails']['large']['url']" alt="" v-if="item['fields']['Image']" width="350">
<h3>{{ item['fields']['Name'] }}</h3>
<h3>{{ item['fields']['Notes'] }}</h3>
<p>{{ item['fields']['Description'] }}</p>
<p>{{ item['fields']['Topic'] }}</p>
</li>
</ul>
</div><!--app-->
</div>
</main>
<footer class="footer">
<small>
© <time datetime="2018-12-20T14:53:49-05:00">2018</time>. All rights reserved.
</small>
</footer>
</div>
<script type="text/javascript" src="https://unpkg.com/vue"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.2/axios.min.js"></script>
<!-- Include Dependancy Scripts -->
<script type="text/javascript" src="https://unpkg.com/vue"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.16.2/axios.min.js"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: {
items: []
},
mounted: function(){
this.loadItems();
},
methods: {
loadItems: function(){
// Init variables
var self = this
var app_id = "appA0hzRA8nSRa1Zj";
var app_key = "keyp5rln1VzhFyTTW";
this.items = []
axios.get(
"https://api.airtable.com/v0/"+app_id+"/Chapters?view=Grid%20view",
{
headers: { Authorization: "Bearer "+app_key }
}
).then(function(response){
self.items = response.data.records
}).catch(function(error){
console.log(error)
})
}
}
})
</script>
</body>
</html>