Commit 17e13dbd authored by erdnaxe's avatar erdnaxe 🎇

Fix left sidebar dynamic content

parent b01613d9
{% extends "base.html" %}
{% block sidebar %}
{% block sidebar_nav %}
<div class="card list-group mt-3 border-info">
<a class="list-group-item list-group-item-action" href="{% url "media:index" %}">
<span class="oi oi-list"></span>
......
......@@ -30,7 +30,13 @@
</main>
{# Left sidebar #}
{% include "sidebar.html" %}
<nav class="col-lg-2 bg-light sidebar shadow order-lg-1">
{# Let pages put content here #}
{% block sidebar_nav %}{% endblock %}
{# Other sidebar content #}
{% include "sidebar.html" with sidebar_nav=sidebar_nav %}
</nav>
</div>
</div>
</body>
......
{% load i18n %}
<nav class="col-lg-2 bg-light sidebar shadow order-lg-1">
{# Let pages put content here #}
{% block sidebar %}{% endblock %}
{# Card for user profile #}
{% if request_user.is_authenticated %}
<div class="card mt-3 border-success">
<h5 class="card-header">{{ request_user.name }} {{ request_user.surname }}</h5>
<div class="card-body">
<dl>
<dt>Pseudo</dt>
<dd>{{ request_user.pseudo }}</dd>
</dl>
<div class="card-text text-center">
<a href="{% url "users:profile" %}" class="btn btn-outline-success mb-2">
<span class="oi oi-person"></span>
{% trans "My profile" %}
</a>
<a href="{% url 'logout' %}" class="btn btn-outline-secondary">
<span class="oi oi-account-logout"></span>
{% trans "Log out" %}
</a>
</div>
</div>
</div>
{% else %}
<div class="card mt-3 border-warning">
<div class="card-body text-center">
<p class="card-text">
{% trans "You are not log in yet." %}
</p>
<a href="{% url 'login' %}" class="btn btn-outline-success">
<span class="oi oi-account-login"></span>
{% trans "Log in" %}
{# Card for user profile #}
{% if request_user.is_authenticated %}
<div class="card mt-3 border-success">
<h5 class="card-header">{{ request_user.name }} {{ request_user.surname }}</h5>
<div class="card-body">
<dl>
<dt>Pseudo</dt>
<dd>{{ request_user.pseudo }}</dd>
</dl>
<div class="card-text text-center">
<a href="{% url "users:profile" %}" class="btn btn-outline-success mb-2">
<span class="oi oi-person"></span>
{% trans "My profile" %}
</a>
<a href="{% url 'logout' %}" class="btn btn-outline-secondary">
<span class="oi oi-account-logout"></span>
{% trans "Log out" %}
</a>
</div>
</div>
{% endif %}
</div>
{% else %}
<div class="card mt-3 border-warning">
<div class="card-body text-center">
<p class="card-text">
{% trans "You are not log in yet." %}
</p>
<a href="{% url 'login' %}" class="btn btn-outline-success">
<span class="oi oi-account-login"></span>
{% trans "Log in" %}
</a>
</div>
</div>
{% endif %}
{# Footer #}
<footer class="footer mt-auto py-3">
<div class="container">
{# Footer #}
<footer class="footer mt-auto py-3">
<div class="container">
<span class="text-muted">
Méd 2019 &mdash; Codé avec <span class="oi oi-heart"></span> par des médeux fous
</span>
</div>
</footer>
</nav>
</div>
</footer>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment