From e8314f4fa77c876702d477fa7b35d25a235a9d7a Mon Sep 17 00:00:00 2001
From: eric
Date: Thu, 30 Mar 2023 14:35:15 -0400
Subject: [PATCH] add publisher reports
---
doab_check/models.py | 4 +++
doab_check/templates/index.html | 3 +++
doab_check/templates/publisher.html | 39 ++++++++++++++++++++++++++++
doab_check/templates/publishers.html | 15 +++++++++++
doab_check/urls.py | 2 ++
doab_check/views.py | 23 +++++++++++++++-
6 files changed, 85 insertions(+), 1 deletion(-)
create mode 100644 doab_check/templates/publisher.html
create mode 100644 doab_check/templates/publishers.html
diff --git a/doab_check/models.py b/doab_check/models.py
index a974670..5f481c4 100644
--- a/doab_check/models.py
+++ b/doab_check/models.py
@@ -21,6 +21,10 @@ class Item(models.Model):
def __str__(self):
return self.doab.split('/')[1] if '/' in self.doab else self.doab
+ @property
+ def url(self):
+ return f'https://directory.doabooks.org/handle/{self.doab}'
+
class Link(models.Model):
''' these are the links we're going to check '''
url = models.URLField(max_length=1024, unique=True)
diff --git a/doab_check/templates/index.html b/doab_check/templates/index.html
index d338872..84f7105 100644
--- a/doab_check/templates/index.html
+++ b/doab_check/templates/index.html
@@ -24,6 +24,9 @@ When a link is checked we record the status code returned by the web server. "40
View the list of host names we've checked.
+
+View the list of publishers whose links we've checked.
+
We'll be adding more views of the link checking data as the project develops.
+
+DOAB Linkchecking for
+{{ publisher.publisher }} ({{ items.count }} records)
+
+
+{% for item in items %}
+-
+{{ item.doab }} - {{ item.title }}
+{% for link in item.links.all %}
+
+
+
+ {{ link.url }}
+ |
+
+
+
+ {% for check in link.checks.all %}
+
+ {{ check.created }} |
+ {{ check.return_code }} |
+ {{ check.content_type }} |
+
+ {% endfor %}
+
+ |
+
+ {% endfor %}
+
+
+{% endfor %}
+
+
diff --git a/doab_check/templates/publisher.html b/doab_check/templates/publisher.html
new file mode 100644
index 0000000..6d4a2a6
--- /dev/null
+++ b/doab_check/templates/publisher.html
@@ -0,0 +1,39 @@
+
+