This commit is contained in:
Akira Tempaku 2025-03-02 15:07:48 +09:00
commit 5309e0593b
Signed by: paku
GPG key ID: 5B4E8402BCC50607
22 changed files with 722 additions and 0 deletions

View file

@ -0,0 +1,10 @@
{% extends "layout.html" %}
{% block body %}
<form action="{{ url_for('update_entry', id=entry.id) }}" method="post">
<label for="title">タイトル</label>
<input type="text" id="title" name=title value={{ entry.title }}>
<label for="text">本文</label>
<textarea id="text" name=text rows="3">{{ entry.text | safe }}</textarea>
<button type="submit">更新</button>
</form>
{% endblock %}

View file

@ -0,0 +1,13 @@
{% extends "layout.html" %}
{% block body %}
<ul>
{% for entry in entries %}
<li>
<h5>{{ entry.title }}</h5>
<a href="{{ url_for('show_entry', id=entry.id) }}">続きを読む</a>
</li>
{% else %}
投稿がありません
{% endfor %}
</ul>
{% endblock %}

View file

@ -0,0 +1,10 @@
{% extends "layout.html" %}
{% block body %}
<form action="{{ url_for('add_entry') }}" method="post">
<label for="title">タイトル</label>
<input type="text" id="title" name="title">
<label for="text">本文</label>
<textarea id="text" name="text" rows="3"></textarea>
<button type="submit">作成</button>
</form>
{% endblock %}

View file

@ -0,0 +1,14 @@
{% extends "layout.html" %}
{% block body %}
<h2>{{ entry.title }}</h2>
<br>
{{ entry.text }}
<br><br>
投稿日時 {{ entry.created_at }}
<form action="{{ url_for('edit_entry', id=entry.id) }}" method="GET">
<button type="submit">編集</button>
</form>
<form action="{{ url_for('delete_entry', id=entry.id) }}" method="POST">
<button type="submit">削除</button>
</form>
{% endblock %}