Browse Source

stylistic changes

pull/1/head
wes 7 years ago
parent
commit
b2f8535a81
  1. 6
      src/comment.py
  2. 24
      src/scripts/post.tag
  3. 16
      src/templates/index.html
  4. 2
      src/website.py

6
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")
])
}

24
src/scripts/post.tag

@ -14,7 +14,7 @@
<p class="post-content centered text-break">{ this.content }</p>
<div class="divider"></div>
<comments pid={pid}>
<comments pid={this.pid}>
</comments>
</div>
@ -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) });
</script>
</post>

16
src/templates/index.html

@ -1,37 +1,23 @@
{% block head %}
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<meta name="viewport" content="width=device-width, initial-scale=1">
<header class="text-center nav navbar">
<section class="centered page-top navbar-section">
<h1 class="blog-title">nowhere</h1>
</section>
</header>
{% endblock %}
<html>
<body>
{% block content %}
<posts>
<post></post>
</posts>
<editor>
</editor>
{% endblock %}
<footer class="footer">
</footer>
{% block styles %}
<link rel="stylesheet" href="/blog/styles/spectre.min.css">
<link rel="stylesheet" href="/blog/styles/riotblog.min.css">
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="/blog/scripts/riotblog.min.js"></script>
{% endblock %}
</body>
</html>

2
src/website.py

@ -80,7 +80,7 @@ def NeverWhere(configfile=None):
@app.route("/<path:path>")
def page_not_found(path):
return "Custom failure message"
return "Oops, couldn't find that :/"
return app

Loading…
Cancel
Save