From 23b0d953a49146b5ebea43ad4f03a356c16e8757 Mon Sep 17 00:00:00 2001 From: James Ravenscroft Date: Sat, 7 Dec 2024 21:50:30 +0000 Subject: [PATCH] start building dashboard --- penparse/webui/templates/dashboard.html | 52 +++++++++++++++++++++++++ penparse/webui/urls.py | 2 + penparse/webui/views.py | 10 ++++- 3 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 penparse/webui/templates/dashboard.html diff --git a/penparse/webui/templates/dashboard.html b/penparse/webui/templates/dashboard.html new file mode 100644 index 0000000..3194160 --- /dev/null +++ b/penparse/webui/templates/dashboard.html @@ -0,0 +1,52 @@ +{% extends "main.html" %} {% block content %} +
+

Your Dashboard

+

+ View and manage your analyzed documents +

+ + + +
+ {% for document in documents %} +
+

{{ document.title }}

+

+ Analyzed on: {{ document.analysis_date }} +

+
+ View + Download +
+
+ {% empty %} +

+ You haven't uploaded any documents yet. +

+ {% endfor %} +
+
+ +
+

Upload a New Document

+ Upload Document +
+{% endblock %} diff --git a/penparse/webui/urls.py b/penparse/webui/urls.py index 72734bb..6204aff 100644 --- a/penparse/webui/urls.py +++ b/penparse/webui/urls.py @@ -5,5 +5,7 @@ from . import views urlpatterns = [ path("", views.index, name="index"), path("dashboard", views.dashboard, name="dashboard"), + path("settings", views.settings, name='settings'), + path("documents/upload", views.upload_document, name="upload_document"), path("auth/register", views.register, name="register"), ] diff --git a/penparse/webui/views.py b/penparse/webui/views.py index 714f5fb..49a381c 100644 --- a/penparse/webui/views.py +++ b/penparse/webui/views.py @@ -21,7 +21,15 @@ def index(request): def dashboard(request): - return HttpResponse("Hello, world. You're at the polls index.") + return render(request, 'dashboard.html') + + +def settings(request): + return render(request, 'settings.html') + + +def upload_document(request): + return render(request, 'upload.html') def register(request: HttpRequest):