aboutsummaryrefslogtreecommitdiffstats
path: root/src/templates
diff options
context:
space:
mode:
authorConfuSomu2023-07-05 15:14:46 +0200
committerConfuSomu2023-07-05 15:14:46 +0200
commite515ca109faa897e84be8a97a1240c59df612dd4 (patch)
tree2a5e0593bb4387449a9a60fb2aefcc74779b5c67 /src/templates
parent0dfab2456b2dcd33f1879ac7d5606dd65cdb8e40 (diff)
downloadActorViewer-e515ca109faa897e84be8a97a1240c59df612dd4.tar
ActorViewer-e515ca109faa897e84be8a97a1240c59df612dd4.tar.gz
ActorViewer-e515ca109faa897e84be8a97a1240c59df612dd4.zip
Implement a small library of ActivityPub objects
These objects allow, and will allow us, to move HTML rendering out of the archive parser and into separate classes. Each of the derived classes specialise HTML rendering for their specific requirements. Furthermore, these ActivityPub objects will be able to be expanded upon and have support to be written to disk, in a database, for instance. Separating ActivityPub object retrieving from rendering allows us to implement other retrieving sources and methods, such as downloading posts from a configured remote instance.
Diffstat (limited to 'src/templates')
-rw-r--r--src/templates/apactivity.html16
-rw-r--r--src/templates/apattachment.html3
-rw-r--r--src/templates/apattachmentlist_item.html3
-rw-r--r--src/templates/appost.html13
-rw-r--r--src/templates/apreblog.html4
5 files changed, 39 insertions, 0 deletions
diff --git a/src/templates/apactivity.html b/src/templates/apactivity.html
new file mode 100644
index 0000000..298c28c
--- /dev/null
+++ b/src/templates/apactivity.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html lang="en">
+ <head>
+ <meta charset="utf-8">
+ <title>Status info</title>
+ </head>
+ <body>
+ <h1 id="type">{{type}}</h1>
+ <p>Activity info:</p>
+ <ul>
+ <li id="act-publication-date"><b>Published:</b> {{published}}</li>
+ <li id="act-by"><b>By:</b> {{by}}</li>
+ </ul>
+ {{object}}
+ </body>
+</html>
diff --git a/src/templates/apattachment.html b/src/templates/apattachment.html
new file mode 100644
index 0000000..3befd3c
--- /dev/null
+++ b/src/templates/apattachment.html
@@ -0,0 +1,3 @@
+<img src="{{path}}" style="float:none;" width="{{img-width}}"/>
+<p><a href="{{path}}">{{filename}}</a></p>
+<p style="text-indent:5px;"><b>Alt:</b> {{alt-text}}</p>
diff --git a/src/templates/apattachmentlist_item.html b/src/templates/apattachmentlist_item.html
new file mode 100644
index 0000000..dc2fd67
--- /dev/null
+++ b/src/templates/apattachmentlist_item.html
@@ -0,0 +1,3 @@
+<h2>Attachment {{id}}</h2><br/>
+<div>{{attachment}}</div>
+<hr width="80%" />
diff --git a/src/templates/appost.html b/src/templates/appost.html
new file mode 100644
index 0000000..12d2f1e
--- /dev/null
+++ b/src/templates/appost.html
@@ -0,0 +1,13 @@
+<p>Post info:</p>
+<ul>
+ <li id="publication-date"><b>Published:</b> {{published}}</li>
+ <li id="to"><b>To:</b> {{to}}</li>
+ <li id="cc"><b>CC:</b> {{cc}}</li>
+ <li id="by"><b>By:</b> {{by}}</li>
+ <li id="lang"><b>Language:</b> {{lang}}</li>
+ <li>URL to <a href="{{url-status}}">Status</a>, <a href="{{url-id}}">JSON-LD Object</a></li>
+</ul>
+
+<div><tt id="content-warning"><b>CW:</b> {{summary}}</tt></div>
+<div id="content">{{content}}</div>
+<div id="attachments">{{attachment-div}}</div>
diff --git a/src/templates/apreblog.html b/src/templates/apreblog.html
new file mode 100644
index 0000000..da99268
--- /dev/null
+++ b/src/templates/apreblog.html
@@ -0,0 +1,4 @@
+<ul>
+<li>URL to <a href="{{url-status}}">Status</a></li>
+</ul>
+<div id="content">{{content}}</div>