From 36adf5a904883155ab004e0584d6e28a11e68f04 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 11 Dec 2023 20:23:20 +0100 Subject: [PATCH] Add detail page for webpages --- vrobbler/apps/webpages/models.py | 1 + vrobbler/settings-testing.py | 1 + vrobbler/settings.py | 1 + .../templates/webpages/webpage_detail.html | 48 +++++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 vrobbler/templates/webpages/webpage_detail.html diff --git a/vrobbler/apps/webpages/models.py b/vrobbler/apps/webpages/models.py index a875970..dcff57e 100644 --- a/vrobbler/apps/webpages/models.py +++ b/vrobbler/apps/webpages/models.py @@ -4,6 +4,7 @@ from typing import Dict import trafilatura from uuid import uuid4 +from django.apps import apps from django.contrib.auth import get_user_model from django.conf import settings from django.db import models diff --git a/vrobbler/settings-testing.py b/vrobbler/settings-testing.py index 345c830..abb4c89 100644 --- a/vrobbler/settings-testing.py +++ b/vrobbler/settings-testing.py @@ -93,6 +93,7 @@ INSTALLED_APPS = [ "django.contrib.humanize", "django_filters", "django_extensions", + "markdownify", "imagekit", "storages", "taggit", diff --git a/vrobbler/settings.py b/vrobbler/settings.py index 4f19387..6c18865 100644 --- a/vrobbler/settings.py +++ b/vrobbler/settings.py @@ -101,6 +101,7 @@ INSTALLED_APPS = [ "django.contrib.humanize", "django_filters", "django_extensions", + "markdownify", "imagekit", "storages", "taggit", diff --git a/vrobbler/templates/webpages/webpage_detail.html b/vrobbler/templates/webpages/webpage_detail.html new file mode 100644 index 0000000..cd42ff1 --- /dev/null +++ b/vrobbler/templates/webpages/webpage_detail.html @@ -0,0 +1,48 @@ +{% extends "base_list.html" %} +{% load static %} + +{% block title %}{{object.title}}{% endblock %} + +{% block head_extra %} + +{% endblock %} + +{% block lists %} +
+ +
+

Source: {{object.url}}

+
+ {% if object.extract %} +
+ {{object.extract|linebreaks}} +
+ {% endif %} +
+
+
+
+

Last scrobbles

+
+ + + + + + + + {% for scrobble in object.scrobble_set.all %} + + + + {% endfor %} + +
Date
{{scrobble.timestamp}}
+
+
+
+{% endblock %}