From cd67cbbb2827c161aa6e99c93fe57f5500cbb789 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 10 Nov 2022 16:32:36 -0800 Subject: pds: more web view implementation --- adenosine-pds/templates/account.html | 36 +++++++++++++++ adenosine-pds/templates/adenosine.css | 74 +++++++++++++++++++++++++++++- adenosine-pds/templates/at_collection.html | 7 +-- adenosine-pds/templates/at_record.html | 7 +-- adenosine-pds/templates/at_repo.html | 16 ++++--- adenosine-pds/templates/base.html | 10 ++-- adenosine-pds/templates/macro.html | 41 +++++++++++++++++ adenosine-pds/templates/post.html | 5 -- adenosine-pds/templates/profile.html | 7 --- adenosine-pds/templates/thread.html | 8 ++++ 10 files changed, 179 insertions(+), 32 deletions(-) create mode 100644 adenosine-pds/templates/account.html create mode 100644 adenosine-pds/templates/macro.html delete mode 100644 adenosine-pds/templates/post.html delete mode 100644 adenosine-pds/templates/profile.html create mode 100644 adenosine-pds/templates/thread.html (limited to 'adenosine-pds/templates') diff --git a/adenosine-pds/templates/account.html b/adenosine-pds/templates/account.html new file mode 100644 index 0000000..bd015d5 --- /dev/null +++ b/adenosine-pds/templates/account.html @@ -0,0 +1,36 @@ +{% extends "base.html" %} +{% import "macro.html" as macro %} + +{% block main %} + +
+

+ {% if profile.displayName.is_some() %} + {{ profile.displayName.as_ref().unwrap() }} + {% endif %} + @{{ profile.handle }} +

+{{ profile.did }} + +{% if profile.description.is_some() %} +

{{ profile.description.as_ref().unwrap() }} +{% endif %} + +

+ [{{ profile.followersCount}} followers / + {{ profile.followsCount }} follows] +

+
+ +{% if feed.len() == 0 %} +
--- no posts yet! ---
+{% else %} +
--- showing {{ feed.len() }} of {{ profile.postsCount }} posts ---
+{% endif %} + +{% for item in feed %} + {% call macro::feed_item(item) %} +{% endfor %} + + +{% endblock %} diff --git a/adenosine-pds/templates/adenosine.css b/adenosine-pds/templates/adenosine.css index 0686f9e..9a0f890 100644 --- a/adenosine-pds/templates/adenosine.css +++ b/adenosine-pds/templates/adenosine.css @@ -622,5 +622,75 @@ progress:indeterminate::-moz-progress-bar { } /********** adenosine tweaks **********/ -body { font-family: var(--mono-font); } -a { text-decoration: none; } +body { + font-family: var(--mono-font); +} +a { + text-decoration: none; +} +main { + font-size: smaller; + padding-top: 0px; +} +h2 { + margin-top: 0px; + margin-bottom: 1rem; + font-size: 2.5em; +} +nav.header { + border-bottom: 2px dashed var(--border); +} +nav.header img { + vertical-align: middle; +} +nav.header span { + vertical-align: middle; + color: var(--text); +} +nav.header h1 { + font-weight: normal; + font-size: 2rem; + margin-top: 1rem; + margin-bottom: 0.5rem; +} +.ident, a:hover.ident, a:visited.ident { + color: var(--text-light); +} +.smaller { + font-size: smaller; +} +body footer { + border-top: 2px dashed var(--border); + padding: 1rem 1rem 1rem 1rem; +} +.counts { + color: var(--text-light); +} +.counts a { + color: var(--text-light); +} +p.counts { + margin-bottom: 0px; +} +.display_name { + color: green; + font-weight: normal; +} +.handle { + color: green; + font-weight: bold; +} +.feed_item { + margin-top: 1rem; + margin-bottom: 1rem; +} +.profile h4 { + margin-top: 0px; + margin-bottom: 0px; +} +.repo_aturi, .repo_aturi a, .repo_aturi a:visited { + color: var(--code); + font-size: smaller; + overflow: auto; + font-weight: bold; +} diff --git a/adenosine-pds/templates/at_collection.html b/adenosine-pds/templates/at_collection.html index b4b7036..670cb0d 100644 --- a/adenosine-pds/templates/at_collection.html +++ b/adenosine-pds/templates/at_collection.html @@ -1,12 +1,13 @@ {% extends "base.html" %} {% block main %} -

at://{{ did }}/{{ collection }}/ +

ATP Repository Explorer

+
at://{{ did }}/{{ collection }}/
-

records: +

Records

{% endblock %} diff --git a/adenosine-pds/templates/at_record.html b/adenosine-pds/templates/at_record.html index 10ed838..829ed4a 100644 --- a/adenosine-pds/templates/at_record.html +++ b/adenosine-pds/templates/at_record.html @@ -1,8 +1,9 @@ {% extends "base.html" %} {% block main %} -

at://{{ did }}/{{ collection }}/{{ tid }} +

ATP Repository Explorer

+
at://{{ did }}/{{ collection }}/{{ tid }}
-

record json: -

{{ record }}
+

JSON

+
{{ record|json }}
{% endblock %} diff --git a/adenosine-pds/templates/at_repo.html b/adenosine-pds/templates/at_repo.html index dcf4d87..384b8dc 100644 --- a/adenosine-pds/templates/at_repo.html +++ b/adenosine-pds/templates/at_repo.html @@ -1,18 +1,20 @@ {% extends "base.html" %} {% block main %} -

at://{{ did }}/ +

ATP Repository Explorer

+
at://{{ did }}/
-

collections: +

Collections

-

repo commit: -

{{ "{:?}"|format(commit) }}
+

Describe

+
{{ describe|json }}
+ +

Commit Node

+
{{ commit|json }}
-

repo describe -

{{ "{:?}"|format(describe) }}
{% endblock %} diff --git a/adenosine-pds/templates/base.html b/adenosine-pds/templates/base.html index 0ae2061..cb88c0c 100644 --- a/adenosine-pds/templates/base.html +++ b/adenosine-pds/templates/base.html @@ -9,11 +9,11 @@ {% block head %}{% endblock %} -