From 3ba18380d6dec7e0b17a4221789dc37309605716 Mon Sep 17 00:00:00 2001 From: Ayo Ayco Date: Sun, 26 May 2024 10:44:55 +0200 Subject: [PATCH] refactor: extract to card.html template --- templates/card.html | 75 +++++++++++++++++ templates/mock.html | 3 + templates/threads.html | 183 +++-------------------------------------- 3 files changed, 89 insertions(+), 172 deletions(-) create mode 100644 templates/card.html create mode 100644 templates/mock.html diff --git a/templates/card.html b/templates/card.html new file mode 100644 index 0000000..78fb786 --- /dev/null +++ b/templates/card.html @@ -0,0 +1,75 @@ + +
+
+ {% if thread.account.avatar is defined %} + avatar of {{ thread.account.display_name }} + {% endif %} +
+ +
+
+ + + +
+ +
+ {{thread.content | safe}} + {% if thread.descendants is defined %} + {% for media in thread.media_attachments %} + {% if media.type == 'image'%} + + {{ media.description or 'media attachment' }} + + {% elif media.type == 'gifv' %} + + {% endif %} + {% endfor %} + {% endif %} + {% if thread.media_attachments|length <= 0 and thread.card %} + + + + {% endif %} + +
+ {% if is_thread %} + Read full thread + {% endif %} +
+ diff --git a/templates/mock.html b/templates/mock.html new file mode 100644 index 0000000..6b3be45 --- /dev/null +++ b/templates/mock.html @@ -0,0 +1,3 @@ +
+ hey {{ data }} +
diff --git a/templates/threads.html b/templates/threads.html index 2d3dcda..b930aeb 100644 --- a/templates/threads.html +++ b/templates/threads.html @@ -74,7 +74,7 @@ } main.thread { - & li:not(:last-of-type) .card_avatar::after { + & .card:not(:last-of-type) .card_avatar::after { content: " "; display: block; height: 100%; @@ -91,13 +91,6 @@ width: 50px; } - ul { - list-style: none; - padding-left: 0; - display: grid; - gap: 1em; - } - .card { grid-template-columns: 55px auto; display: grid; @@ -188,13 +181,6 @@ } - & .action { - color: var(--color-link); - margin: 1em 0; - cursor: pointer; - margin-top: 1em; - } - & .link_card { color: var(--text-color-dark-faded); text-decoration: underline; @@ -220,7 +206,7 @@ } main.thread { - & li:not(:last-of-type) .card_avatar::after { + & .card:not(:last-of-type) .card_avatar::after { border-right: 2px solid rgba(197, 209, 222, 0.15); } } @@ -266,165 +252,18 @@
Back
- - Top