Skip to content

Commit 9aad1bc

Browse files
committed
Now showing movies (fake data).
1 parent d3c1f2e commit 9aad1bc

File tree

3 files changed

+204
-3
lines changed

3 files changed

+204
-3
lines changed
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
movies_temp = {
2+
"keyword": "top_10",
3+
"hits": [
4+
{
5+
"imdb_code": "tt0691996",
6+
"title": "Towering Inferno",
7+
"director": "John Blanchard",
8+
"keywords": [],
9+
"duration": 65,
10+
"genres": [
11+
"comedy"
12+
],
13+
"rating": "",
14+
"year": 0,
15+
"imdb_score": 9.5
16+
},
17+
{
18+
"imdb_code": "tt0111161",
19+
"title": "The Shawshank Redemption",
20+
"director": "Frank Darabont",
21+
"keywords": [
22+
"wrongful imprisonment",
23+
"escape from prison",
24+
"prison",
25+
"first person narration",
26+
"prison cell search"
27+
],
28+
"duration": 142,
29+
"genres": [
30+
"drama",
31+
"crime"
32+
],
33+
"rating": "R",
34+
"year": 1994,
35+
"imdb_score": 9.3
36+
},
37+
{
38+
"imdb_code": "tt0068646",
39+
"title": "The Godfather",
40+
"director": "Francis Ford Coppola",
41+
"keywords": [
42+
"organized crime",
43+
"mafia",
44+
"rise to power",
45+
"patriarch",
46+
"crime family"
47+
],
48+
"duration": 175,
49+
"genres": [
50+
"drama",
51+
"crime"
52+
],
53+
"rating": "R",
54+
"year": 1972,
55+
"imdb_score": 9.2
56+
},
57+
{
58+
"imdb_code": "tt0092337",
59+
"title": "Dekalog",
60+
"director": "",
61+
"keywords": [
62+
"meaning of life",
63+
"search for meaning",
64+
"morality",
65+
"moral challenge",
66+
"ten commandments"
67+
],
68+
"duration": 55,
69+
"genres": [
70+
"drama"
71+
],
72+
"rating": "TV-MA",
73+
"year": 0,
74+
"imdb_score": 9.1
75+
},
76+
{
77+
"imdb_code": "tt3082898",
78+
"title": "Kickboxer: Vengeance",
79+
"director": "John Stockwell",
80+
"keywords": [],
81+
"duration": 90,
82+
"genres": [
83+
"action"
84+
],
85+
"rating": "",
86+
"year": 2016,
87+
"imdb_score": 9.1
88+
},
89+
{
90+
"imdb_code": "tt0468569",
91+
"title": "The Dark Knight",
92+
"director": "Christopher Nolan",
93+
"keywords": [
94+
"psychopath",
95+
"urban setting",
96+
"based on comic book",
97+
"star died before release",
98+
"dc comics"
99+
],
100+
"duration": 152,
101+
"genres": [
102+
"drama",
103+
"thriller",
104+
"action",
105+
"crime"
106+
],
107+
"rating": "PG-13",
108+
"year": 2008,
109+
"imdb_score": 9.0
110+
},
111+
{
112+
"imdb_code": "tt0071562",
113+
"title": "The Godfather: Part II",
114+
"director": "Francis Ford Coppola",
115+
"keywords": [
116+
"corrupt politician",
117+
"revenge",
118+
"lake tahoe nevada",
119+
"1950s",
120+
"melancholy"
121+
],
122+
"duration": 220,
123+
"genres": [
124+
"drama",
125+
"crime"
126+
],
127+
"rating": "R",
128+
"year": 1974,
129+
"imdb_score": 9.0
130+
},
131+
{
132+
"imdb_code": "tt2802850",
133+
"title": "Fargo",
134+
"director": "",
135+
"keywords": [
136+
"anthology",
137+
"minnesota",
138+
"insurance salesman",
139+
"police officer",
140+
"death"
141+
],
142+
"duration": 53,
143+
"genres": [
144+
"drama",
145+
"thriller",
146+
"crime"
147+
],
148+
"rating": "TV-MA",
149+
"year": 0,
150+
"imdb_score": 9.0
151+
},
152+
{
153+
"imdb_code": "tt0167260",
154+
"title": "The Lord of the Rings: The Return of the King",
155+
"director": "Peter Jackson",
156+
"keywords": [
157+
"epic",
158+
"battle",
159+
"king",
160+
"orc",
161+
"ring"
162+
],
163+
"duration": 192,
164+
"genres": [
165+
"drama",
166+
"action",
167+
"adventure",
168+
"fantasy"
169+
],
170+
"rating": "PG-13",
171+
"year": 2003,
172+
"imdb_score": 8.9
173+
},
174+
{
175+
"imdb_code": "tt0108052",
176+
"title": "Schindler's List",
177+
"director": "Steven Spielberg",
178+
"keywords": [
179+
"nazi",
180+
"german soldier",
181+
"jew",
182+
"german",
183+
"jewish"
184+
],
185+
"duration": 185,
186+
"genres": [
187+
"drama",
188+
"history",
189+
"biography"
190+
],
191+
"rating": "R",
192+
"year": 1993,
193+
"imdb_score": 8.9
194+
}
195+
],
196+
"truncated_results": true
197+
}

days/093-096-vuejs/movie_exploder/js/site.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ app = new Vue({
44
el: '#app',
55
data: {
66
search_text: "initial value",
7+
movies: movies_temp.hits
78
}
89
})

days/093-096-vuejs/movie_exploder/views/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,16 @@
1414
<h1>Movie Exploder</h1>
1515

1616
<input type="text" v-model="search_text">
17-
<div style="color: green;">
18-
{{search_text}}
19-
</div>
2017

18+
<div class="movies">
19+
<div class="movie" v-for="m in movies">
20+
<div class="title">{{m.title.toLocaleUpperCase()}}</div>
21+
</div>
22+
</div>
2123
</div>
2224

2325
<script src="../js/vue/vue.js"></script>
26+
<script src="../js/fake_data.js"></script>
2427
<script src="../js/site.js"></script>
2528

2629
</body>

0 commit comments

Comments
 (0)