]> git.p6c8.net - pcdenotes.git/blobdiff - notes/templates/note_list.html
Began to write a manager for the Note class to get some logic out of the views
[pcdenotes.git] / notes / templates / note_list.html
index fb2da3323eeb119467cf1c05c1706a8440039364..5647f9c09314e934848dc18798faa7950c7122f4 100644 (file)
@@ -1,26 +1,23 @@
-{% load markdownify %}
-<!DOCTYPE html>
+{% extends "note_base.html" %}
 
 
-<html lang="de">
-<head>
-  <title>Notes</title>
-  <meta charset="UTF-8" />
-  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
-</head>
-<body>
+{% block title %}Notes{% endblock %}
 
 
-    <h1>Notes</h1>
-    {% for note in notes %}
-    <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 %}
+{% block content %}
+  {% for note in notes_page %}
+  {% include "note.html" %}
+  {% empty %}
+  <p>No notes</p>
+  {% endfor %}
 
 
-    <p>Number of notes: {{ notes_count }}</p>
-
-</body>
-</html>
+  {% if page_count > 1 %}
+    <ul class="pagination mt-5">
+      {% for page in pages %}
+        {% if page.number != page_number %}
+          <li class="page-item"><a href="?page={{ page.number }}" class="page-link">{{ page.number }}</a></li>
+        {% else %}
+          <li class="page-item active"><span class="page-link">{{ page.number }}</span></li>
+        {% endif %}
+      {% endfor %}
+    </ul>
+  {% endif %}
+{% endblock %}
\ No newline at end of file

patrick-canterino.de