use ghostbox macro everywhere

master
Aevann 2023-09-29 06:43:25 +03:00
parent c4f9086068
commit 6656aef10b
3 changed files with 59 additions and 83 deletions

View File

@ -231,44 +231,26 @@
{% endif %}
</div>
{% else %}
{% if u %}
{% if v and v.id == u.id %}
<div class="row no-gutters">
<div class="col">
<div class="text-center px-3 my-3">
<span class="fa-stack fa-2x text-muted mb-4">
<i class="fas fa-square text-gray-500 opacity-25 fa-stack-2x"></i>
<i class="fas text-gray-500 fa-ghost fa-stack-1x text-lg"></i>
</span>
<h5>You haven't {% if "/saved/" in request.path %}saved{% elif "/subscribed/" in request.path %}subscribed to{% else %}made{% endif %} a post yet</h5>
<p class="text-muted mb-md-5">Your {% if "/saved/" in request.path %}saved posts{% elif "/subscribed/" in request.path %}subscribed posts{% else %}posting history{% endif %} will show here.</p>
{% if "/saved/" not in request.path and "/subscribed/" not in request.path %}<a href="/submit" class="btn btn-primary">Create a post</a>{% endif %}
<div class="row no-gutters">
<div class="col">
<div class="text-center px-3 my-3">
{% 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)}}
</div>
</div>
</div>
</div>
{% else %}
<div class="row no-gutters">
<div class="col">
<div class="text-center px-3 my-3">
<span class="fa-stack fa-2x text-muted mb-4">
<i class="fas fa-square text-gray-500 opacity-25 fa-stack-2x"></i>
<i class="fas text-gray-500 fa-scroll-old fa-stack-1x text-lg"></i>
</span>
<h5>@{{u.username}} hasn't made a post yet</h5>
<p class="text-muted mb-1">Their posting history will show here.</p>
</div>
</div>
</div>
{% endif %}
{% elif request.path != '/notifications/posts' %}
<div class="row no-gutters">
<div class="col">
{{macros.ghost_box(error if request.path.startswith('/search') else '', '', 1)}}
</div>
</div>
{% endif %}
{% endfor %}
<script src="{{'js/new_comments.js' | asset}}"></script>

View File

@ -1,31 +1,26 @@
{% extends "userpage/userpage.html" %}
{% block userpage_content %}
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %} userpage-comments">
<div class="col">
{% if listing %}
<div class="posts p-3 p-md-0">
{% with comments=listing %}
{% include "comments.html" %}
{% endwith %}
</div>
{% else %}
<div class="text-center px-3 my-3">
<span class="fa-stack fa-2x text-muted mb-4">
<i class="fas fa-square text-gray-500 opacity-25 fa-stack-2x"></i>
<i class="fas text-gray-500 fa-scroll-old fa-stack-1x text-lg"></i>
</span>
{% if '/saved/' in request.path %}
<h5>You haven't saved any comments yet</h5>
{% elif v and v.id == u.id %}
<h5>You haven't made any comments yet</h5>
<p class="text-muted mb-md-5">Your commenting history will show here.</p>
<div class="row no-gutters {% if listing %}mt-md-3{% elif not listing %}my-md-3{% endif %} userpage-comments">
<div class="col">
{% if listing %}
<div class="posts p-3 p-md-0">
{% with comments=listing %}
{% include "comments.html" %}
{% endwith %}
</div>
{% else %}
<h5>@{{u.username}} hasn't made any comments yet</h5>
<p class="text-muted">Their commenting history will show here.</p>
<div class="text-center px-3 my-3">
{% 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)}}
</div>
{% endif %}
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}

View File

@ -1,29 +1,28 @@
{% extends "userpage/userpage.html" %}
{% block userpage_content %}
<div class="userpage-wall">
{{macros.comment_reply_box(u.fullname, 'replying-to-' + u.fullname, '', 'mb-3 mt-4', '', enable_cancel_button=false)}}
<div class="userpage-wall">
{{macros.comment_reply_box(u.fullname, 'replying-to-' + u.fullname, '', 'mb-3 mt-4', '', enable_cancel_button=false)}}
{% if comment_info %}
<div class="total mt-1"><a href="/@{{u.username}}">View entire wall <i class="fas fa-long-arrow-right ml-1"></i></a></div>
{% endif %}
{% if comment_info %}
<div class="total mt-1"><a href="/@{{u.username}}">View entire wall <i class="fas fa-long-arrow-right ml-1"></i></a></div>
{% endif %}
<div class="row no-gutters px-3 p-md-0 userpage-wall" style="margin-top: 10px">
<div class="col">
<div class="comment-section" id="replies-of-{{u.fullname}}">
{% with comments=listing %}
{% include "comments.html" %}
{% endwith %}
</div>
{% if not listing %}
<div id="ghost-town-box" class="text-center px-3 my-3">
<span class="fa-stack fa-2x text-muted mb-4">
<i class="fas fa-square text-gray-500 opacity-25 fa-stack-2x"></i>
<i class="fas text-gray-500 fa-scroll-old fa-stack-1x text-lg"></i>
</span>
<h5>There's no comments on {% if u.id == v.id %}your{% else %}@{{u.username}}'s{% endif %} wall yet!</h5>
<div class="row no-gutters px-3 p-md-0 userpage-wall" style="margin-top: 10px">
<div class="col">
<div class="comment-section" id="replies-of-{{u.fullname}}">
{% with comments=listing %}
{% include "comments.html" %}
{% endwith %}
</div>
{% 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 %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}