diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/base.html | 6 | ||||
-rw-r--r-- | templates/create.html | 6 | ||||
-rw-r--r-- | templates/post.html | 38 |
3 files changed, 41 insertions, 9 deletions
diff --git a/templates/base.html b/templates/base.html index 48b4d9c..d014cd9 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,11 +1,14 @@ <!DOCTYPE html> <html lang="en"> + <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> - <title>Blog</title> + <title>VibesHome</title> <link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}"> + </head> + <body> <header> <h1><a href="{{ url_for('index') }}">My Blog</a></h1> @@ -14,4 +17,5 @@ {% block content %}{% endblock %} </main> </body> + </html> \ No newline at end of file diff --git a/templates/create.html b/templates/create.html index 4d48992..ccbbc67 100644 --- a/templates/create.html +++ b/templates/create.html @@ -7,7 +7,7 @@ <link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='bower_components/simplemde/dist/simplemde.min.css') }}"> -<h1>Blob Create</h1> +<h1>Write to yourself </h1> @@ -20,7 +20,7 @@ <form method="post" novalidate> {{ form.hidden_tag() }} <p> - {{form.title.label}}: {{form.title}} <br> + {{form.title.label}}: {{form.title}} <br> {{ form.content.label }}<br> {{ form.content(cols="80", rows="24") }} </p> @@ -107,4 +107,4 @@ renderMarkdown(); document.getElementById('document-input').addEventListener('input', renderMarkdown); </script> -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/templates/post.html b/templates/post.html index d759da4..b585cab 100644 --- a/templates/post.html +++ b/templates/post.html @@ -1,6 +1,25 @@ {% extends 'base.html' %} {% block content %} +<script> + function openNav() { + console.log("hello run started") + var coll = document.getElementsByClassName("collapsible"); + var i; + + for (i = 0; i < coll.length; i++) { + console.log("run loop") + coll[i].addEventListener("click", function () { + this.classList.toggle("active"); + var content = this.nextElementSibling; + if (content.style.display === "block") { + content.style.display = "none"; + } else { + content.style.display = "block"; + } + }); + } + } </script> {% if post.parent != 0 %} <a href="{{url_for('post', post_id=post.parent)}}"> Previous</a> <hr> @@ -13,12 +32,21 @@ <a href="{{ url_for('create', reply=post.id)}}"> Reply</a> ~ <a href="{{ url_for('index') }}">Back to posts</a> </div> -<hr> -<h3> Replies to this</h3> -<div class="post-replies"> +<button type="button" class="collapsible" onload="openNav()">Navigation</button> +<div class="content"> + <hr> + <h3>Previously to this </h3> <ul> - <li> {% for reply in replies %} <a href="{{ url_for('post', post_id=reply.id) }}">{{ reply.title }}</a> - {{ - reply.created_at.strftime('%Y-%m-%d') }}</li> {% endfor %} + <li> {% for p in previous %} <a href="{{ url_for('post', post_id=p.id) }}">{{ p.title }}</a> - {{ + p.created_at.strftime('%Y-%m-%d') }}</li> {% endfor %} </ul> + <hr> + <h3> Replies to this</h3> + <div class="post-replies"> + <ul> + <li> {% for reply in replies %} <a href="{{ url_for('post', post_id=reply.id) }}">{{ reply.title }}</a> - {{ + reply.created_at.strftime('%Y-%m-%d') }}</li> {% endfor %} + </ul> + </div> </div> {% endblock %} \ No newline at end of file |