Skip to content

Commit

Permalink
Show login button when openid is used
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Jan 22, 2024
1 parent 34ad238 commit c957097
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bitpoll/base/templates/base/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@
{% value_from_settings POLL_CREATION_REQUIRES_LOGIN as requires_login %}
{% value_from_settings POLL_CREATION_ACCOUNT_WEBSITE as account_website %}
{% value_from_settings POLL_CREATION_ACCOUNT_NAME as account_name %}
{% value_from_settings OPENID_ENABLED as openid %}
{% if requires_login and request.user.is_anonymous %}
<h1>{% trans 'Login required to create polls' %}</h1>
<hr/>
<p class="lead">{% blocktrans %}This instance is reserved for users of <a href="{{ account_website }}">{{ account_name }}</a>.
If you do not have an account there, please use the public version at <a href="https://bitpoll.de">bitpoll.de</a>.{% endblocktrans %}</p>
{% if openid %}
<a href="{% url 'login' %}" class="action primary"><i class="fa-solid fa-sign-in"></i>&nbsp;{% trans 'Login' %}</a>
{% endif %}
{% else %}
<h1>{% trans 'Create a poll' %}</h1>
<hr/>
Expand Down Expand Up @@ -203,7 +207,6 @@ <h1>{% trans 'Create a poll' %}</h1>
</div>
</div>
</section>
{% value_from_settings OPENID_ENABLED as openid %}
{% if request.user.is_anonymous and not openid %}
<section class="section login">
<div class="container">
Expand Down

0 comments on commit c957097

Please sign in to comment.