-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
128 lines (98 loc) · 3.52 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>TownSquare Admin</title>
<link href="/css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div>
<h1>TownSquare Admin</h1>
<h2>Volunteers</h2>
<div id="volunteers-search">
</div>
<table class="table table-striped table-bordered records-list">
<thead>
<tr>
<th>id</th>
<th>First Name</th>
<th>Last Name</th>
<th>Active</th>
</tr>
</thead>
<tbody id="volunteers">
</tbody>
</table>
</div>
<!-- templates -->
<script type="text/template" id="user-row-t">
<td>
<%= id %>
</td>
<td>
<%= first_name %>
</td>
<td>
<%= last_name %>
</td>
<td>
<% if (active) { %>
<span class="glyphicon glyphicon-ok" aria-hidden="true"></span>
<% } %>
</td>
</script>
<script type="text/template" id="filter-t">
<div>
<form class="form-inline">
<div class="form-group">
<label for="search-box"><%= field_name %></label>
<input type="text" id="search-box" class="form-control" />
</div>
</form>
<button class="btn filter-btn">Search</button>
<button class="btn filter-clear">Clear</button>
</div>
</script>
<!-- external libraries -->
<script src="/lib/jquery-2.1.3.min.js"></script>
<script src="/lib/bootstrap.min.js"></script>
<script src="/lib/underscore-min.js"></script>
<script src="/lib/underscore.string.min.js"></script>
<script src="/lib/backbone-min.js"></script>
<!-- townsquare javascript -->
<script src="/js/events.js"></script>
<script src="/js/townsquarecollection.js"></script>
<script src="/js/user.js"></script>
<script src="/js/users.js"></script>
<script src="/js/userrow.js"></script>
<script src="/js/usertable.js"></script>
<script src="/js/filter.js"></script>
<script src="/js/filterinput.js"></script>
<script>
var volunteer_filter_attributes = new townsquare_admin.
models.FilterAttributes({field_name: 'Name'});
var volunteer_filter_view = new townsquare_admin.views.FilterView({
model: volunteer_filter_attributes,
el: '#volunteers-search'
});
volunteer_filter_view.render();
var all_users = new townsquare_admin.collections.Users();
var users_table = new townsquare_admin.views.UserTable({
collection: all_users,
el: '#volunteers'
});
var filterer = new townsquare_admin.TableFilterer(
users_table
);
all_users.fetch({success: function() {
users_table.render();
}})
</script>
</body>
</html>