-
Notifications
You must be signed in to change notification settings - Fork 0
/
flash-cards.html
101 lines (88 loc) · 2.51 KB
/
flash-cards.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
92
93
94
95
96
97
98
99
100
101
<template name="home">
<head>
<title>FlashCards</title>
</head>
<body>
<div class="container">
<header>
<h1>Decks</h1>
</header>
{{> loginButtons}}
{{#if currentUser}}
<form class="new-deck">
<input type="text" name="name" placeholder="Type to start a new deck"/>
<li>
<span>
<input id="checkbox-make-public" name="checkbox" checked="{{checked}}" type="checkbox" />
<label class="inline-text">Make public</label>
</span>
</li>
</form>
{{/if}}
<ul>
{{#each decks}}
{{> deck}}
{{/each}}
</ul>
</div>
</body>
</template>
<template name="deck">
<li>
{{#if isOwner}}
<button class="delete">×</button>
{{/if}}
<span class="text">{{deck_name}} - {{deck_cards.length}} Cards {{#if isPublic}} - Public{{else}} - Private{{/if}}</span>
<button class="play">Play!</button>
</li>
</template>
<template name="deckDetail">
{{> notifications}}
<div class="container">
<header>
<h1>Cards for {{currentDeck}}</h1>
</header>
{{#if isOwner}}
{{#if isAdding}}
<form class="new-card" id="new-card">
<input type="text" name="question" placeholder="Question"/>
<input type="text" name="answer" placeholder="Answer"/>
<input type="text" name="option1" placeholder="Option 1"/>
<input type="text" name="option2" placeholder="Option 2"/>
<input type="text" name="option3" placeholder="Option 3"/>
<input type="submit" value="Create Card"/>
</form>
<button class="cancel-button">Cancel</button>
{{else}}
<button class="add-button">New Card</button>
{{/if}}
{{/if}}
<button class="play">Play!</button>
<ul>
{{#each cards}}
{{> card}}
{{/each}}
</ul>
</div>
</template>
<template name="card">
<li>
<!--{{#if this.parent.isOwner}}-->
<button class="delete">×</button>
<!--{{/if}}-->
<span class="text">{{card_question}} {{#if currentUser}} -- Score: {{cardScore}}{{/if}}</span>
</li>
</template>
<template name="player">
{{> notifications}}
<div class="container">
<header>
<h1>Playing {{deck_name}}</h1>
</header>
<span><p>{{currentCard.card_question}}</p></span>
{{#each answerChoices}}
<button class="answer" text="{{this}}">{{this}}</button>
{{/each}}
<button class="skip">Skip</button>
</div>
</template>