Hide the profile sidebar when there's no content for it.

This commit is contained in:
flash 2018-12-28 17:52:15 +01:00
parent 3146b3bc88
commit e14db1a133

View file

@ -105,8 +105,13 @@
{% endif %}
<div class="profile__container">
{% set show_profile_fields = is_editing ? perms.edit_profile : profile_fields|default([])|length > 0 %}
{% set show_background_settings = is_editing and perms.edit_background %}
{% set show_sidebar = current_user is not defined or show_profile_fields or show_background_settings %}
{% if show_sidebar %}
<div class="profile__container__side">
{% if is_editing and perms.edit_background %}
{% if show_background_settings %}
<div class="container profile__background-settings">
{{ container_title('Background') }}
@ -129,7 +134,7 @@
You must <a href="/auth.php?m=login" class="profile__accounts__link">log in</a> to view full profiles!
</div>
</div>
{% elseif is_editing ? perms.edit_profile : profile_fields|default([])|length > 0 %}
{% elseif show_profile_fields %}
<div class="container profile__accounts">
{{ container_title('Elsewhere') }}
@ -159,6 +164,7 @@
</div>
{% endif %}
</div>
{% endif %}
<div class="profile__container__main">
{% if (is_editing and perms.edit_about) or profile.user_about_content|length > 0 %}