From 651367c0d7d6f5e101f2d1bf43657640c8eb144e Mon Sep 17 00:00:00 2001 From: Jason McBrayer Date: Tue, 24 Apr 2018 09:12:13 -0400 Subject: [PATCH] Display boosts correctly --- brutaldon/static/css/brutaldon.css | 5 ++ brutaldon/templates/base.html | 3 +- brutaldon/templates/main/timeline.html | 77 ++------------------ brutaldon/templates/main/toot_partial.html | 83 ++++++++++++++++++++++ requirements.txt | 2 +- 5 files changed, 96 insertions(+), 74 deletions(-) create mode 100644 brutaldon/static/css/brutaldon.css create mode 100644 brutaldon/templates/main/toot_partial.html diff --git a/brutaldon/static/css/brutaldon.css b/brutaldon/static/css/brutaldon.css new file mode 100644 index 0000000..dd77724 --- /dev/null +++ b/brutaldon/static/css/brutaldon.css @@ -0,0 +1,5 @@ +.reblog-icon { + position: relative; + top: -24px; + left: 40px; +} diff --git a/brutaldon/templates/base.html b/brutaldon/templates/base.html index 684f0b7..33c1004 100644 --- a/brutaldon/templates/base.html +++ b/brutaldon/templates/base.html @@ -8,6 +8,7 @@ +
@@ -17,7 +18,7 @@ Title

- My first website with Bulma! + Brutaldon is totally a thing.

{% endblock %} diff --git a/brutaldon/templates/main/timeline.html b/brutaldon/templates/main/timeline.html index 67500e2..8dfd331 100644 --- a/brutaldon/templates/main/timeline.html +++ b/brutaldon/templates/main/timeline.html @@ -8,78 +8,11 @@ {% block content %}

Your {{ timeline }} timeline

{% for toot in toots %} -
-
-
-

- -

-
-
-
-

- {{ toot.account.display_name }} - @{{ toot.account.username }} - {{ toot.created_at |naturaltime }} -

- {% if toot.spoiler_text %} -

- {{ toot.spoiler_text }} -

- {% endif %} -
- {{ toot.content | safe }} -
- - {% if toot.media_attachments %} -
-
- {% for media in toot.media_attachments %} - - 
-                                                      {% if media.text_url  %}
-                                                      {{ media.text_url }}
-                                                      {% else %}
-                                                      {{ media.url  }}
-                                                      {% endif %} - - {% endfor %} -
-
- {% endif %} -


-
- -
-
-
-
-
+ {% if toot.reblog %} + {% include "main/toot_partial.html" with toot=toot.reblog reblog=True reblog_by=toot.account.username reblog_icon=toot.account.avatar %} + {% else %} + {% include "main/toot_partial.html" with toot=toot reblog=False %} + {% endif %} {% endfor %} {% endblock %} diff --git a/brutaldon/templates/main/toot_partial.html b/brutaldon/templates/main/toot_partial.html new file mode 100644 index 0000000..17bf04e --- /dev/null +++ b/brutaldon/templates/main/toot_partial.html @@ -0,0 +1,83 @@ +{% load humanize %} + +
+
+
+

+ +

+ {% if reblog %} +

+ +

+ {% endif %} +
+
+
+

+ {{ toot.account.display_name }} + @{{ toot.account.username }} + {{ toot.created_at |naturaltime }} + {% if reblog %} +
+ Boosted by @{{ reblog_by }} + {% endif %} +

+ {% if toot.spoiler_text %} +

+ {{ toot.spoiler_text }} +

+ {% endif %} +
+ {{ toot.content | safe }} +
+ + {% if toot.media_attachments %} +
+
+ {% for media in toot.media_attachments %} + + 
+                                              {% if media.text_url  %}
+                                              {{ media.text_url }}
+                                              {% else %}
+                                              {{ media.url  }}
+                                              {% endif %} + + {% endfor %} +
+
+ {% endif %} +


+
+ +
+
+
+
+
diff --git a/requirements.txt b/requirements.txt index 18257c1..3a5f5ef 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ certifi==2017.11.5 chardet==3.0.4 decorator==4.1.2 -Django==2.0.1 +Django==2.0.4 django-widget-tweaks==1.4.2 idna==2.6 Mastodon.py==1.2.1