Conclude example
This commit is contained in:
parent
13aacc3b6b
commit
78ef2762e7
21 changed files with 1809 additions and 6 deletions
15
simpler_text_board/templates/base.html.tera
Normal file
15
simpler_text_board/templates/base.html.tera
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<title>simpler text board</title>
|
||||
</head>
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="/">home</a></li>
|
||||
<li><a href="/create">create post</a></li>
|
||||
</ul>
|
||||
{% block content %} {% endblock %}
|
||||
</body>
|
||||
</html>
|
23
simpler_text_board/templates/create.html.tera
Normal file
23
simpler_text_board/templates/create.html.tera
Normal file
|
@ -0,0 +1,23 @@
|
|||
{% extends "base" %}
|
||||
|
||||
{% block content %}
|
||||
<h1> simpler text board</h1>
|
||||
<h2>create a post</h2>
|
||||
{% if flash %}<p>{{ flash }}</p>{% endif %}
|
||||
<form action="/create" method="post" accept-charset="utf-8">
|
||||
<label for="author">author name</label>
|
||||
<input type="text" placeholder="author" name="author" required>
|
||||
|
||||
<label for="email">email</label>
|
||||
<input type="text" placeholder="email" name="email">
|
||||
|
||||
<label for="title">title</label>
|
||||
<input type="text" placeholder="title" name="title" required>
|
||||
|
||||
<label for="content">content</label>
|
||||
<textarea type="text" placeholder="content" name="content" rows="8" cols="50" required>
|
||||
</textarea>
|
||||
|
||||
<button type="submit">create</button>
|
||||
</form>
|
||||
{% endblock content %}
|
10
simpler_text_board/templates/index.html.tera
Normal file
10
simpler_text_board/templates/index.html.tera
Normal file
|
@ -0,0 +1,10 @@
|
|||
{% extends "base" %}
|
||||
|
||||
{% block content %}
|
||||
<h1> simpler text board</h1>
|
||||
<ul>
|
||||
{% for post in posts %}
|
||||
<li>{{ loop.index }} - {{ post.title }} - {{ post.author }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock content %}
|
Loading…
Add table
Add a link
Reference in a new issue