template error logging, css, better rendering
This commit is contained in:
parent
2e7a81d7c7
commit
0a85a81950
9 changed files with 51 additions and 39 deletions
|
@ -7,7 +7,7 @@
|
|||
{% endblock head %}
|
||||
|
||||
{% block content %}
|
||||
<h1>Hi, I'm {{ username }}</h1>
|
||||
<h1><a class="hidden-link" href="/">Hi, I'm {{ username }}</a></h1>
|
||||
<p style="text-align: right">
|
||||
<a href="/">Back to the blog</a>
|
||||
</p>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{% macro article(id, title, body, publish_date) %}
|
||||
<article>
|
||||
<article class="blog-article">
|
||||
<div class="post-content">
|
||||
<a href="/id/{{ id }}" class="post-link">
|
||||
<h2 class="post-title">{{ title }}</h2>
|
||||
|
|
|
@ -12,7 +12,10 @@
|
|||
</head>
|
||||
|
||||
<body>
|
||||
<div id="content">{% block content %}{% endblock content %}</div>
|
||||
<div id="content">
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
|
||||
{% block content %}
|
||||
<h1><a href="/" class="post-link" style="text-decoration:none;color:black;">{{ username }} blog</a></h1>
|
||||
<h1><a href="/" class="hidden-link">{{ username }} blog</a></h1>
|
||||
<p style="text-align: right">
|
||||
<a href="/about">About</a>
|
||||
<a href="/">Last 5 posts</a>
|
||||
|
|
|
@ -1,28 +1,21 @@
|
|||
{% extends "base.html" %}
|
||||
{% import "article.html.macro" as article_macro %}
|
||||
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<meta property="og:title" content=" {{ post.title }} | {{ username }}' blog" />
|
||||
<meta property="og:title" content=" {{ post.title }} | {{ username }} blog" />
|
||||
<meta property="og:description" content="{{ post.body | striptags }}" />
|
||||
<title> {{ post.title }} | {{ username }}' blog </title>
|
||||
{% endblock head %}
|
||||
|
||||
{% block content %}
|
||||
<h1><a href="/" class="post-link" style="text-decoration:none;color:black;">{{ username }} blog</a></h1>
|
||||
<p style="text-align: right">
|
||||
<h1><a href="/" class="hidden-link">{{ username }} blog</a></h1>
|
||||
<aside class="side-nav">
|
||||
<a href="/">Home</a>
|
||||
<a href="/about">About</a>
|
||||
<a href="/all">All Posts</a>
|
||||
</p>
|
||||
<ul>
|
||||
<article>
|
||||
<div class="post-content">
|
||||
<a href="/id/{{ post.id }}" class="post-link">
|
||||
<h2 class="post-title">{{ post.title }}</h2>
|
||||
</a>
|
||||
<sub class="post-publish-date"> {{ post.publish_date | date(format="%Y-%m-%d at %H:%M") }}</sub>
|
||||
<p class="post-body">{{ post.body }}</p>
|
||||
</div>
|
||||
</article>
|
||||
</ul>
|
||||
</aside>
|
||||
|
||||
{{ article_macro::article(id=post.id,title=post.title,body=post.body,publish_date=post.publish_date) }}
|
||||
|
||||
{% endblock content %}
|
|
@ -9,7 +9,7 @@
|
|||
{% endblock head %}
|
||||
|
||||
{% block content %}
|
||||
<h1><a href="/" class="post-link">{{ username }} blog</a></h1>
|
||||
<h1><a href="/" class="hidden-link">{{ username }} blog</a></h1>
|
||||
<p style="text-align: right">
|
||||
<a href="/about">About</a>
|
||||
<a href="/all">All Posts</a>
|
||||
|
|
|
@ -2,30 +2,31 @@
|
|||
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
<title>Edit '{{ title }}'</title>
|
||||
<meta property="og:title" content="Edit '{{ title }}'" />
|
||||
<title>Edit '{{ post.title }}'</title>
|
||||
<meta property="og:title" content="Edit '{{ post.title }}'" />
|
||||
{% endblock head %}
|
||||
|
||||
{% block content %}
|
||||
<form id="submit-form" action="/api/blog/posts/edit/{{ id }}" method=POST>
|
||||
<h1><a href="/" class="hidden-link">{{ username }} blog</a></h1>
|
||||
<form id="submit-form" action="/api/blog/posts/edit/{{ post.id }}" method=POST>
|
||||
<label for="token">Password</label>
|
||||
<br />
|
||||
<input id="token" type="password" name="token">
|
||||
<br />
|
||||
<label for="title">Title</label>
|
||||
<textarea id="submit-title" type="text" name="title">{{ title }}</textarea>
|
||||
<textarea id="submit-title" type="text" name="title">{{ post.title }}</textarea>
|
||||
<br />
|
||||
<label for="submit-body">Content</label>
|
||||
<textarea id="submit-body" type="text" name="body">{{ body }}</textarea>
|
||||
<textarea id="submit-body" type="text" name="body">{{ post.body }}</textarea>
|
||||
<br />
|
||||
<button id="submit-button" type="submit">Edit post</button>
|
||||
</form>
|
||||
|
||||
<form action="/api/blog/posts/hide/{{ id }}" method="POST">
|
||||
<form action="/api/blog/posts/hide/{{ post.id }}" method="POST">
|
||||
<input class="token" type="text" name="token" hidden>
|
||||
<button type="submit">Hide post</button>
|
||||
</form>
|
||||
<form action="/api/blog/posts/delete/{{ id }}" method="POST">
|
||||
<form action="/api/blog/posts/delete/{{ post.id }}" method="POST">
|
||||
<input class="token" type="text" name="token" hidden>
|
||||
<button type="submit">Delete post</button>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue