-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooks-meteor.html
131 lines (99 loc) · 3.92 KB
/
books-meteor.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<head>
<title>books-meteor</title>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/skeleton.css">
<link rel="stylesheet" href="css/layout.css">
<script type="text/javascript" src="js/json2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="js/underscore.js"></script>
<script type="text/javascript" src="js/backbone.js"></script>
</head>
<body>
{{> header}}
{{> tabs}}
{{> main}}
{{> footer}}
</body>
<template name="main">
{{> createBook}}
{{> showBooks}}
{{> activeBook}}
</template>
<template name="createBook">
<div id="create" class="content" style="display: block">
<form id="book-form">
<input type="text" name="title" id="title-field" value="" placeholder="Enter title..."/>
<input type="text" name="author" id="author-field" value="" placeholder="Enter author..."/>
<input type="text" name="date" id="date-field" value="" placeholder="Enter published date..."/>
<input type="text" name="isbn" id="isbn-field" value="" placeholder="Enter ISBN..."/>
</form>
<div class="buttons">
<button id="add-book">Add book</button>
</div>
</div>
</template>
<template name="showBooks">
<div id="manage" class="content" data-sort="author">
<table id="manage-table">
<thead>
<tr>
<th><input id="selectall" type="checkbox" name="selectall"/></th>
<th><a data-sort="title" class="sort" href="javascript:void(0);">Title</a></th>
<th><a data-sort="author" class="sort" href="javascript:void(0);">Author</a></th>
<th><a data-sort="date" class="sort" href="javascript:void(0);">Published</a></th>
<th><a data-sort="isbn" class="sort" href="javascript:void(0);">ISBN</a></th>
<th></th>
</tr>
</thead>
<tbody>
{{#each showBooks}}
{{> books}}
{{/each}}
</tbody>
</table>
</div>
</template>
<template name="activeBook">
<div id="manage-edit" class="content">
<form id="book-edit-form">
{{#with activeBook}}
<input type="text" name="title" id="title-field-edit" value="{{title}}" placeholder="Enter title..."/>
<input type="text" name="author" id="author-field-edit" value="{{author}}" placeholder="Enter author..."/>
<input type="text" name="date" id="date-field-edit" value="{{date}}" placeholder="Enter published date..."/>
<input type="text" name="isbn" id="isbn-field-edit" value="{{isbn}}" placeholder="Enter ISBN..."/>
{{/with}}
</form>
<div class="buttons">
<button id="update-book">update book</button>
</div>
</div>
</template>
<template name="books">
<tr id="">
<td><input class="select" type="checkbox" name="{{_id}}}" data-id="{{_id}}" /></td>
<td>{{title}}</td>
<td>{{author}}</td>
<td>{{date}}</td>
<td>{{isbn}}</td>
<td>
<a class="edit-book" href="javascript:void(0);" name="{{_id}}" data-id="{{_id}}">edit</a>
<a class="delete-book" href="javascript:void(0);" data-id="{{_id}}">delete</a>
</td>
</tr>
</template>
<template name="tabs">
<ul class="tabs">
<li><a id="create-tab" class="active" href="javascript:void(0);">Create</a></li>
<li><a id="manage-tab" href="javascript:void(0);">Manage</a></li>
</ul>
</template>
<template name="header">
<header><h1>Backbone Books</h1></header>
</template>
<template name="footer">
<footer>
Built by <a href='http://www.snowflax.com/' target="_blank">http://snowflax.com/</a> using <a href ="http://seogrady.com" target="_blank">Shane O'Grady'</a>
<span>code at <a href="https://github.com/snowflaxgit/BackboneBooks.git" target="_blank">Github</a></span><br>
<span> Please refer to <a href="http://blog.snowflax.com/" target="_blank">http://blog.snowflax.com</a> for more details</span>
</footer>
</template>