grav-theme-learn2-git-sync
grav-theme-learn2-git-sync copied to clipboard
Missing logout link
This may be more of a feature request than an issue.
When you login to the site as a normal user (NOT the admin panel), there is no way to logout again. The quark theme has a logout link, but Learn2/Learn2-git-sync do not.
See this for more info.
While I have already added a custom theme which inherits this theme with the suggested changes, it might be handy to have it show up by default (or perhaps an option).
This is what I added to put the logout link in the sidebar, just above the "Built with" text:
templates/partials/sidebar.html.twig (added between the footer and feed link):
{# Added by Tim M. - adds a logout link to the sidebar #}
{% if config.plugins.login.enabled and grav.user.username %} <span class="login-status-wrapper"><i class="fa fa-user"></i> {% include 'partials/login-status.html.twig' %}</span><br><br> {% endif %}
{# Ends the logout link code #}
The bottom part of the file looks like this:
<a class="padding" href="#" data-clear-history-toggle><i
class="fa fa-fw fa-history"></i> {{ 'THEME_LEARN2_CLEAR_HISTORY'|t }}</a><br/>
<section id="footer">
{# Added by Timinator - adds a logout link to the sidebar #}
{% if config.plugins.login.enabled and grav.user.username %} <span class="login-status-wrapper"><i class="fa fa-user"></i> {% include 'partials/login-status.html.twig' %}</span><br><br> {% endif %}
{# Ends the logout link code #}
{% if config.plugins.feed.enabled and pages.find('/feed') %}
<a class="button" href="{{ base_url }}/feed.atom"><i class="fa fa-rss-square"></i> Atom 1.0</a>
<a class="button" href="{{ base_url }}/feed.rss"><i class="fa fa-rss-square"></i> RSS</a><br><br>
{% endif %}
<p>{{ 'THEME_LEARN2_BUILT_WITH_GRAV'|t|raw }}</p>
</section>
</div>
</div>