From ee38ff5eec83ee81d518125d2894c631da45c3f9 Mon Sep 17 00:00:00 2001 From: Patrick Canterino <patrick@patrick-canterino.de> Date: Sun, 23 Jan 2022 15:04:54 +0100 Subject: [PATCH 1/1] Added basic bootstrap layout --- notes/templates/note_base.html | 6 ++++++ notes/templates/note_detail.html | 12 ++++++------ notes/templates/note_list.html | 13 +++++++------ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/notes/templates/note_base.html b/notes/templates/note_base.html index 93f3dc7..d85e875 100644 --- a/notes/templates/note_base.html +++ b/notes/templates/note_base.html @@ -6,9 +6,15 @@ <title>{% block title %}{% endblock %}</title> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet"> + <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script> </head> <body> + <div class="container-fluid p-5 bg-primary text-white text-center"> + <h1><a href="/" class="link-light">Notes</a></h1> + </div> + {% block content %}{% endblock %} </body> </html> \ No newline at end of file diff --git a/notes/templates/note_detail.html b/notes/templates/note_detail.html index 1fdfae9..f760e4b 100644 --- a/notes/templates/note_detail.html +++ b/notes/templates/note_detail.html @@ -1,12 +1,12 @@ {% extends "note_base.html" %} {% load markdownify %} -{% block title %}{{ note.title }}{% endblock %} +{% block title %}Notes - {{ note.title }}{% endblock %} {% block content %} - <h1>{{ note.title }}</h1> - - <div>{{ note.content|linebreaksbr|markdownify }}</div> - - <p>Date: {{ note.created_at|date:"Y-m-d H:i" }}</p> + <article class="container mt-5"> + <h2>{{ note.title }}</h2> + {{ note.content|linebreaksbr|markdownify }} + <p>Date: {{ note.created_at|date:"Y-m-d H:i" }}</p> + </article> {% endblock %} \ No newline at end of file diff --git a/notes/templates/note_list.html b/notes/templates/note_list.html index 9f1554c..e996fb2 100644 --- a/notes/templates/note_list.html +++ b/notes/templates/note_list.html @@ -4,16 +4,17 @@ {% block title %}Notes{% endblock %} {% block content %} - <h1>Notes</h1> - {% for note in notes %} + {% for note in notes %} + <article class="container mt-5"> <h2>{{ note.title }}</h2> <p>ID: {{ note.id }}</p> <div>{{ note.content|linebreaksbr|markdownify }}</div> <p>Link: <a href="{{ note.get_absolute_url }}">View</a></p> <p>Date: {{ note.created_at|date:"Y-m-d H:i" }}</p> - {% empty %} - <p>No notes</p> - {% endfor %} + </article> + {% empty %} + <p>No notes</p> + {% endfor %} - <p>Number of notes: {{ notes_count }}</p> + <p>Number of notes: {{ notes_count }}</p> {% endblock %} \ No newline at end of file -- 2.43.0