forked from schn4ck/schnack
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
145 additions
and
145 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"admins": [], | ||
"date_format": "MMMM DD, YYYY" | ||
"admins": [], | ||
"date_format": "MMMM DD, YYYY" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<form class="schnack-post"> | ||
<textarea></textarea><br> | ||
<button>Send comment</button> | ||
<textarea></textarea><br> | ||
<button>Send comment</button> | ||
</form> | ||
<ul class="schnack-comments"> | ||
<% comments.forEach((comment) => { %> | ||
<li class="schnack-comment"> | ||
<div class="schnack-author"> | ||
<%= comment.name %> <span class="schnack-date"><%= comment.created_at_s %></span> | ||
</div> | ||
<blockquote class="schnack-body"> | ||
<p><%= comment.comment %></p> | ||
</blockquote> | ||
</li> | ||
<% }) %> | ||
<% comments.forEach((comment) => { %> | ||
<li class="schnack-comment"> | ||
<div class="schnack-author"> | ||
<%= comment.name %> <span class="schnack-date"><%= comment.created_at_s %></span> | ||
</div> | ||
<blockquote class="schnack-body"> | ||
<p><%= comment.comment %></p> | ||
</blockquote> | ||
</li> | ||
<% }) %> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
CREATE TABLE comment ( | ||
id INTEGER PRIMARY KEY NOT NULL, | ||
user_id NOT NULL, | ||
slug CHAR(128) NOT NULL, | ||
created_at TEXT NOT NULL, | ||
comment CHAR(4000) NOT NULL, | ||
rejected BOOLEAN, | ||
approved BOOLEAN | ||
id INTEGER PRIMARY KEY NOT NULL, | ||
user_id NOT NULL, | ||
slug CHAR(128) NOT NULL, | ||
created_at TEXT NOT NULL, | ||
comment CHAR(4000) NOT NULL, | ||
rejected BOOLEAN, | ||
approved BOOLEAN | ||
); | ||
|
||
CREATE TABLE user ( | ||
id INTEGER PRIMARY KEY NOT NULL, | ||
name CHAR(128), | ||
twitter_id CHAR(20), | ||
facebook_id CHAR(20), | ||
created_at TIMESTAMP NOT NULL, | ||
blocked BOOLEAN, | ||
trusted BOOLEAN | ||
id INTEGER PRIMARY KEY NOT NULL, | ||
name CHAR(128), | ||
twitter_id CHAR(20), | ||
facebook_id CHAR(20), | ||
created_at TIMESTAMP NOT NULL, | ||
blocked BOOLEAN, | ||
trusted BOOLEAN | ||
); | ||
|
||
-- test data | ||
INSERT INTO user(name, created_at, trusted, blocked) | ||
VALUES | ||
("Normal User",datetime(), 0, 0), | ||
("Trusted User",datetime(), 1, 0), | ||
("Blocked User",datetime(), 0, 1); | ||
VALUES | ||
("Normal User",datetime(), 0, 0), | ||
("Trusted User",datetime(), 1, 0), | ||
("Blocked User",datetime(), 0, 1); | ||
|
||
INSERT INTO comment(user_id, slug, created_at, comment, approved, rejected) | ||
VALUES | ||
(1,"foo", datetime(), "This comment was written by a normal user and was approved", 1, 0), | ||
(1,"foo", datetime(), "This comment was written by a normal user and was rejected", 0, 1), | ||
(1,"foo", datetime(), "This comment was written by a normal user and was neither approved nor rejected", 0, 0), | ||
(2,"foo", datetime(), "This comment was written by a trusted user and was approved", 1, 0), | ||
(2,"foo", datetime(), "This comment was written by a trusted user and was rejected", 0, 1), | ||
(2,"foo", datetime(), "This comment was written by a trusted user and was neither approved nor rejected", 0, 0), | ||
(3,"foo", datetime(), "This comment was written by a blocked user and was approved", 1, 0), | ||
(3,"foo", datetime(), "This comment was written by a blocked user and was rejected", 0, 1), | ||
(3,"foo", datetime(), "This comment was written by a blocked user and was neither approved nor rejected", 0, 0); | ||
VALUES | ||
(1,"foo", datetime(), "This comment was written by a normal user and was approved", 1, 0), | ||
(1,"foo", datetime(), "This comment was written by a normal user and was rejected", 0, 1), | ||
(1,"foo", datetime(), "This comment was written by a normal user and was neither approved nor rejected", 0, 0), | ||
(2,"foo", datetime(), "This comment was written by a trusted user and was approved", 1, 0), | ||
(2,"foo", datetime(), "This comment was written by a trusted user and was rejected", 0, 1), | ||
(2,"foo", datetime(), "This comment was written by a trusted user and was neither approved nor rejected", 0, 0), | ||
(3,"foo", datetime(), "This comment was written by a blocked user and was approved", 1, 0), | ||
(3,"foo", datetime(), "This comment was written by a blocked user and was rejected", 0, 1), | ||
(3,"foo", datetime(), "This comment was written by a blocked user and was neither approved nor rejected", 0, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters