From 6656aef10b8518e6f61c1e9ae3ee02f5dbdfd7e6 Mon Sep 17 00:00:00 2001 From: Aevann Date: Fri, 29 Sep 2023 06:43:25 +0300 Subject: [PATCH] use ghostbox macro everywhere --- files/templates/post_listing.html | 54 +++++++++----------------- files/templates/userpage/comments.html | 45 ++++++++++----------- files/templates/userpage/wall.html | 43 ++++++++++---------- 3 files changed, 59 insertions(+), 83 deletions(-) diff --git a/files/templates/post_listing.html b/files/templates/post_listing.html index ba769e1a1..2518e04e9 100644 --- a/files/templates/post_listing.html +++ b/files/templates/post_listing.html @@ -231,44 +231,26 @@ {% endif %} {% else %} -{% if u %} -{% if v and v.id == u.id %} -
-
-
- - - - -
You haven't {% if "/saved/" in request.path %}saved{% elif "/subscribed/" in request.path %}subscribed to{% else %}made{% endif %} a post yet
-

Your {% if "/saved/" in request.path %}saved posts{% elif "/subscribed/" in request.path %}subscribed posts{% else %}posting history{% endif %} will show here.

- {% if "/saved/" not in request.path and "/subscribed/" not in request.path %}Create a post{% endif %} +
+
+
+ {% if u %} + {% if "/saved/" in request.path %} + {% set text = "You haven't saved any posts yet!" %} + {% elif "/subscribed/" in request.path %} + {% set text = "You haven't subscribed to any posts yet!" %} + {% elif v and v.id == u.id %} + {% set text = "You haven't made any posts yet!" %} + {% else %} + {% set text = "@" ~ u.username ~ " hasn't made any posts yet!" %} + {% endif %} + {% else %} + {% set text = "No posts found!" if request.path.startswith('/search') else "" %} + {% endif %} + {{macros.ghost_box(text, '', 1)}} +
-
-{% else %} -
-
-
- - - - -
@{{u.username}} hasn't made a post yet
-

Their posting history will show here.

-
-
-
-{% endif %} - -{% elif request.path != '/notifications/posts' %} -
-
- {{macros.ghost_box(error if request.path.startswith('/search') else '', '', 1)}} -
-
- -{% endif %} {% endfor %} diff --git a/files/templates/userpage/comments.html b/files/templates/userpage/comments.html index 409d15ddd..e3ce0d55f 100644 --- a/files/templates/userpage/comments.html +++ b/files/templates/userpage/comments.html @@ -1,31 +1,26 @@ {% extends "userpage/userpage.html" %} {% block userpage_content %} -
-
- {% if listing %} -
- {% with comments=listing %} - {% include "comments.html" %} - {% endwith %} -
- {% else %} -
- - - - - {% if '/saved/' in request.path %} -
You haven't saved any comments yet
- {% elif v and v.id == u.id %} -
You haven't made any comments yet
-

Your commenting history will show here.

+
+
+ {% if listing %} +
+ {% with comments=listing %} + {% include "comments.html" %} + {% endwith %} +
{% else %} -
@{{u.username}} hasn't made any comments yet
-

Their commenting history will show here.

+
+ {% if '/saved/' in request.path %} + {% set text = "You haven't saved any comments yet!" %} + {% elif v and v.id == u.id %} + {% set text = "You haven't made any comments yet!" %} + {% else %} + {% set text = '@' ~ u.username ~ " hasn't made any comments yet!" %} + {% endif %} + + {{macros.ghost_box(text, '', 1)}} +
{% endif %}
- - {% endif %} -
-
+
{% endblock %} diff --git a/files/templates/userpage/wall.html b/files/templates/userpage/wall.html index bfa6aa120..b41798836 100644 --- a/files/templates/userpage/wall.html +++ b/files/templates/userpage/wall.html @@ -1,29 +1,28 @@ {% extends "userpage/userpage.html" %} {% block userpage_content %} -
- {{macros.comment_reply_box(u.fullname, 'replying-to-' + u.fullname, '', 'mb-3 mt-4', '', enable_cancel_button=false)}} +
+ {{macros.comment_reply_box(u.fullname, 'replying-to-' + u.fullname, '', 'mb-3 mt-4', '', enable_cancel_button=false)}} - {% if comment_info %} - - {% endif %} + {% if comment_info %} + + {% endif %} -
-
-
- {% with comments=listing %} - {% include "comments.html" %} - {% endwith %} -
- {% if not listing %} -
- - - - -
There's no comments on {% if u.id == v.id %}your{% else %}@{{u.username}}'s{% endif %} wall yet!
+
+
+
+ {% with comments=listing %} + {% include "comments.html" %} + {% endwith %}
- {% endif %} + {% if not listing %} + {% if u.id == v.id %} + {% set text = "There's no comments on your wall yet!" %} + {% else %} + {% set text = "There's no comments on @" ~ u.username ~ "'s wall yet!" %} + {% endif %} + {{macros.ghost_box(text, '', 1)}} + {% endif %} +
+
-
-
{% endblock %}