diff --git a/src/comment.py b/src/comment.py
index 9ea817d..f4b1b18 100644
--- a/src/comment.py
+++ b/src/comment.py
@@ -14,5 +14,11 @@ testcomments = {
comment("Anonymous Coward 0", "Some comment?", "super duper awesome comment here"),
comment("Anonymous Coward 1", "Something? IDEK", "super duper worse comment here"),
comment("Anonymous Coward 2", "Some other comment?", "super duper dang terrible comment here")
+ ]),
+ 2 : dumps(
+ [
+ comment("Anonymous Coward 3", "Some comment?", "super duper awesome comment here"),
+ comment("Anonymous Coward 4", "Something? IDEK", "super duper worse comment here"),
+ comment("Anonymous Coward 5", "Some other comment?", "super duper dang terrible comment here")
])
}
diff --git a/src/scripts/post.tag b/src/scripts/post.tag
index 45e7170..7e0091e 100644
--- a/src/scripts/post.tag
+++ b/src/scripts/post.tag
@@ -14,7 +14,7 @@
{ this.content }
-
+
@@ -51,14 +51,11 @@ prev(ev) {
}
next(ev) {
- console.log("next event fired");
ev.preventDefault();
if (self.nextloading || self.prevloading) {
return;
}
self.nextloading = " loading";
- console.log(self.pid);
- console.log(self.nomore);
if (!self.nomore) {
self.pid++;
self.setPost(self.pid);
@@ -66,20 +63,13 @@ next(ev) {
}
}
-this.setPost = function(pid) {
- console.log("trying to change the post");
- console.log(fetch);
+setPost(pid) {
this.update();
- console.log("updated");
this.loading = true;
- fetch("/blog/switchpost/"+pid)
+ fetch(`/blog/switchpost/${pid}`)
+ .then((resp) => resp.text())
.then(
- function(resp) {
- console.log("got a response");
- return resp.text();
- })
- .then(
- function(body) {
+ (body) => {
if (body === "false") {
self.nomore = true;
route("/");
@@ -87,7 +77,7 @@ this.setPost = function(pid) {
}
else {
self.content = R.join(" ")(R.repeat(body, 20));
- route("/"+pid);
+ route(`/${pid}`);
}
self.loading = false;
@@ -97,7 +87,7 @@ this.setPost = function(pid) {
});
}
-this.on("mount", function() { this.setPost(self.pid) });
+this.on("mount", () => { this.setPost(self.pid) });
diff --git a/src/templates/index.html b/src/templates/index.html
index dbd15ed..21061bf 100644
--- a/src/templates/index.html
+++ b/src/templates/index.html
@@ -1,37 +1,23 @@
-{% block head %}
+
-{% endblock %}
- {% block content %}
-
-
- {% endblock %}
-
-{% block styles %}
-
-
-{% endblock %}
-
-{% block scripts %}
-{% endblock %}
-
diff --git a/src/website.py b/src/website.py
index 5f6ef5b..a953308 100755
--- a/src/website.py
+++ b/src/website.py
@@ -80,7 +80,7 @@ def NeverWhere(configfile=None):
@app.route("/")
def page_not_found(path):
- return "Custom failure message"
+ return "Oops, couldn't find that :/"
return app