Hide the profile sidebar when there's no content for it.
This commit is contained in:
parent
3146b3bc88
commit
e14db1a133
1 changed files with 52 additions and 46 deletions
|
@ -105,8 +105,13 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="profile__container">
|
<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">
|
<div class="profile__container__side">
|
||||||
{% if is_editing and perms.edit_background %}
|
{% if show_background_settings %}
|
||||||
<div class="container profile__background-settings">
|
<div class="container profile__background-settings">
|
||||||
{{ container_title('Background') }}
|
{{ 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!
|
You must <a href="/auth.php?m=login" class="profile__accounts__link">log in</a> to view full profiles!
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% elseif is_editing ? perms.edit_profile : profile_fields|default([])|length > 0 %}
|
{% elseif show_profile_fields %}
|
||||||
<div class="container profile__accounts">
|
<div class="container profile__accounts">
|
||||||
{{ container_title('Elsewhere') }}
|
{{ container_title('Elsewhere') }}
|
||||||
|
|
||||||
|
@ -159,6 +164,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="profile__container__main">
|
<div class="profile__container__main">
|
||||||
{% if (is_editing and perms.edit_about) or profile.user_about_content|length > 0 %}
|
{% if (is_editing and perms.edit_about) or profile.user_about_content|length > 0 %}
|
||||||
|
|
Loading…
Reference in a new issue