summaryrefslogtreecommitdiffstats
path: root/adenosine-pds/src/web.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-11-07 02:56:46 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-11-07 02:56:46 -0800
commit2f414df00e378728701e4061cdb3bebad5df798a (patch)
tree01a262f07dbfb3ba999ebb803dc33063262c6f9f /adenosine-pds/src/web.rs
parent73bb6f114d3fe9233af4f9ab91c8fc2b09b3c6c0 (diff)
downloadadenosine-2f414df00e378728701e4061cdb3bebad5df798a.tar.gz
adenosine-2f414df00e378728701e4061cdb3bebad5df798a.zip
pds: initial pass at crude web interface
Diffstat (limited to 'adenosine-pds/src/web.rs')
-rw-r--r--adenosine-pds/src/web.rs66
1 files changed, 66 insertions, 0 deletions
diff --git a/adenosine-pds/src/web.rs b/adenosine-pds/src/web.rs
new file mode 100644
index 0000000..81e62be
--- /dev/null
+++ b/adenosine-pds/src/web.rs
@@ -0,0 +1,66 @@
+
+use adenosine_cli::identifiers::{Did, Nsid, Tid};
+use serde_json;
+use askama::Template;
+use crate::repo::RepoCommit;
+use crate::models::*;
+
+#[derive(Template)]
+#[template(path = "home.html")]
+pub struct GenericHomeView {
+ pub domain: String,
+}
+
+#[derive(Template)]
+#[template(path = "about.html")]
+pub struct AboutView {
+ pub domain: String,
+}
+
+#[derive(Template)]
+#[template(path = "profile.html")]
+pub struct ProfileView {
+ pub domain: String,
+ pub did: Did,
+ pub profile: serde_json::Value,
+ pub feed: Vec<serde_json::Value>,
+}
+
+#[derive(Template)]
+#[template(path = "post.html")]
+pub struct PostView {
+ pub domain: String,
+ pub did: Did,
+ pub collection: Nsid,
+ pub tid: Tid,
+ pub post_text: String,
+ pub post_created_at: String,
+}
+
+#[derive(Template)]
+#[template(path = "at_repo.html")]
+pub struct RepoView {
+ pub domain: String,
+ pub did: Did,
+ pub commit: RepoCommit,
+ pub describe: RepoDescribe,
+}
+
+#[derive(Template)]
+#[template(path = "at_collection.html")]
+pub struct CollectionView {
+ pub domain: String,
+ pub did: Did,
+ pub collection: Nsid,
+ pub records: Vec<serde_json::Value>,
+}
+
+#[derive(Template)]
+#[template(path = "at_record.html")]
+pub struct RecordView {
+ pub domain: String,
+ pub did: Did,
+ pub collection: Nsid,
+ pub tid: Tid,
+ pub record: serde_json::Value,
+}