forked from tutsplus/parse-js-blog
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
207 lines (181 loc) · 7.46 KB
/
index.html
File metadata and controls
207 lines (181 loc) · 7.46 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<!DOCTYPE html>
<html lang="en">
<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>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/blog.css" rel="stylesheet">
<link href="css/bootstrap-wysihtml5-0.0.2.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[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 class="blog-masthead">
<div class="container">
<nav class="blog-nav">
<a class="blog-nav-item" href="">Home</a>
<a class="blog-nav-item" href="#/admin">Admin</a>
</nav>
</div>
</div>
<div class="container">
<div class="blog-header">
<h1 class="blog-title">The Bootstrap Blog</h1>
<p class="lead blog-description">The official example template of creating a blog with Bootstrap.</p>
</div>
<div class="row">
<div class="col-sm-8 blog-main">
<div class="main-container"></div>
</div><!-- /.blog-main -->
<div class="col-sm-3 col-sm-offset-1 blog-sidebar">
</div><!-- /.blog-sidebar -->
</div><!-- /.row -->
</div><!-- /.container -->
<div class="blog-footer">
<p>Blog template built for <a href="http://getbootstrap.com">Bootstrap</a> by <a href="https://twitter.com/mdo">@mdo</a>.</p>
<p>
<a href="#">Back to top</a>
</p>
</div>
<script id="blogs-tpl" type="text/x-handlebars-template">
{{#each blog}}
<div class="blog-post">
<h2 class="blog-post-title"><a href="#/blog/{{id}}">{{attributes.title}}</a></h2>
<p class="blog-post-meta">At {{attributes.time}} by {{attributes.authorName}}</p>
<div>{{attributes.summary}}</div>
</div>
{{/each}}
</script>
<script id="categories-tpl" type="text/x-handlebars-template">
<div class="sidebar-module">
<h4>Categories</h4>
<ol class="list-unstyled">
{{#each category}}
<li><a href="#/category/{{id}}">{{attributes.name}}</a></li>
{{/each}}
</ol>
</div>
</script>
<script id="blog-tpl" type="text/x-handlebars-template">
<div class="blog-post">
<!-- Blog content -->
<h2 class="blog-post-title">{{blog.attributes.title}}</h2>
<p class="blog-post-meta">At {{blog.attributes.time}} by {{blog.attributes.authorName}}</p>
<div>{{{blog.attributes.content}}}</div>
<!-- Comment Form -->
<h2>Leave a Comment</h2>
<form class="form-comment" role="form">
<div class="form-group">
<label for="comment-author-name">Name</label>
<input name="authorName" type="text" class="form-control" id="comment-author-name" placeholder="Your name">
</div>
<div class="form-group">
<label for="comment-email">Email address</label>
<input name="email" type="email" class="form-control" id="comment-email" placeholder="Your email">
</div>
<div class="form-group">
<label for="comment-content">Comment</label>
<textarea name="content" class="form-control" rows="3" id="comment-content"></textarea>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form>
<!-- Comments -->
{{#if comment}}
<h2>Comments</h2>
<ul class="blog-comments list-unstyled">
{{#each comment}}
<li class="blog-comment">
<div><a href="mailto:{{attributes.email}}">{{attributes.authorName}}</a> said:</div>
<div>{{attributes.content}}</div>
</li>
{{/each}}
</ul>
{{/if}}
</div>
</script>
<script id="login-tpl" type="text/x-handlebars-template">
<form class="form-signin" role="form">
<h2 class="form-signin-heading">Please sign in</h2>
<input type="text" name="username" class="form-control" placeholder="Username" required="" autofocus="">
<input type="password" name="password" class="form-control" placeholder="Password" required="">
<button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
</form>
</script>
<script id="admin-tpl" type="text/x-handlebars-template">
<h2>Welcome, {{user.attributes.username}}!</h2>
<a href="#/add" class="add-blog btn btn-lg btn-primary">Add a New Blog</a>
<a href="#/logout" class="add-blog btn btn-lg btn-default">Logout</a>
<table>
<thead>
<tr>
<th>Title</th>
<th>Author</th>
<th>Time</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{{#each blog}}
<tr>
<td><a class="app-link" href="#/edit/{{id}}">{{attributes.title}}</a></td>
<td>{{attributes.authorName}}</td>
<td>{{attributes.time}}</td>
<td>
<a class="app-link app-edit" href="#/edit/{{id}}">Edit</a> |
<a class="app-link" href="#/del/{{id}}">Delete</a>
</td>
</tr>
{{/each}}
</tbody>
</table>
</script>
<script id="write-tpl" type="text/x-handlebars-template">
<h2>{{form_title}}</h2>
<form class="form-write" role="form">
<div class="form-group">
<label for="title">Title</label>
<input name="title" type="text" class="form-control" id="title" value="{{blog.attributes.title}}"></input>
</div>
<div class="form-group">
<label for="category">Category</label>
<select name="category" class="form-control">
{{#each category}}
<option value="{{id}}" {{#if selected}}selected{{/if}}>{{attributes.name}}</option>
{{/each}}
</select>
</div>
<div class="form-group">
<label for="summary">Summary</label>
<textarea name="summary" class="form-control" rows="3">{{{blog.attributes.summary}}}</textarea>
</div>
<div class="form-group">
<label for="content">Content</label>
<textarea name="content" class="form-control write-content" rows="20">{{{blog.attributes.content}}}</textarea>
</div>
<button class="btn btn-lg btn-primary btn-block" type="submit">Submit</button>
</form>
</script>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Lodash -->
<script src="//cdn.jsdelivr.net/lodash/4.17.3/lodash.min.js"></script>
<!-- Backbone.js -->
<script src="//cdnjs.cloudflare.com/ajax/libs/backbone.js/1.3.3/backbone-min.js"></script>
<!-- Parse.js -->
<script src="//npmcdn.com/parse/dist/parse.min.js"></script>
<!-- Handlebars.js -->
<script src="//cdnjs.cloudflare.com/ajax/libs/handlebars.js/2.0.0/handlebars.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="js/bootstrap.min.js"></script>
<script src="js/wysihtml5-0.3.0.min.js"></script>
<script src="js/bootstrap-wysihtml5-0.0.2.min.js"></script>
<script src="js/blog.js"></script>
</body>
</html>