Skip to content

Commit

Permalink
Enhance login screen options (#159)
Browse files Browse the repository at this point in the history
* Enhance login screen options
* update login layout

---------

Co-authored-by: Tri Truong <[email protected]>
Co-authored-by: Mario Behling <[email protected]>
Co-authored-by: lcduong <[email protected]>
  • Loading branch information
4 people authored Jul 31, 2024
1 parent 4f22b3c commit b2b3f01
Showing 1 changed file with 62 additions and 46 deletions.
108 changes: 62 additions & 46 deletions src/pretalx/common/templates/common/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,76 @@

{% bootstrap_form_errors form %}
{% if no_form %}
<div id="auth-form" class="password-input-form d-md-flex flex-row">
<div id="auth-form" class="password-input-form">
{% else %}
<form id="auth-form" class="password-input-form d-md-flex flex-row" method="post" autocomplete="off">
<form id="auth-form" class="password-input-form" method="post" autocomplete="off">
{% endif %}
{% csrf_token %}
{% compress js %}
<script defer src="{% static 'vendored/zxcvbn.js' %}"></script>
<script defer src="{% static 'common/js/password_strength.js' %}"></script>
{% endcompress %}
{% if not hide_login %}
<div class="auth-form-block flex-grow-1">
{% if not hide_login and not hide_register %}
<h4 class="text-center">{% translate "I already have an account" %}</h4>
{% endif %}
{% bootstrap_field form.login_email layout="inline" %}
{% bootstrap_field form.login_password layout="inline" %}
{% if not no_buttons %}
<button type="submit" class="btn btn-lg btn-success btn-block">
{% translate "Log in" %}
</button>
{% endif %}
<div class="panel-group" id="accordion">
{% if not hide_login %}
{% if request.event and request.event.organiser and request.event.organiser.slug %}
{% socialapp_exists request.event.organiser.slug as eventyay_exists %}
{% if eventyay_exists %}
{% if not no_buttons %}
<div class="text-center">
<a class="btn btn-lg btn-primary btn-block mt-3" href="{% provider_login_url request.event.organiser.slug %}?next=/{{ request.event.slug }}/schedule/">
{% translate "Login with Eventyay-ticket" %}
</a>
</div>
{% socialapp_exists request.event.organiser.slug as eventyay_exists %}
{% if eventyay_exists %}
{% if not no_buttons %}
<div class="text-center">
<a class="btn btn-lg btn-primary btn-block mt-3" href="{% provider_login_url request.event.organiser.slug %}?next=/{{ request.event.slug }}/schedule/">
{% translate "Login as Attendee with Eventyay-Ticket" %}
</a>
</div>
<hr>
{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% if password_reset_link or request.event %}
<a class="btn btn-block btn-link" href="{% if password_reset_link %}{{ password_reset_link }}{% else %}{{ request.event.urls.reset }}{% endif %}">
{% translate "Reset password" %}
</a>
{% endif %}
</div>
{% endif %}
{% if not hide_register %}
<div class="auth-form-block flex-grow-1">
{% if not hide_login and not hide_register %}
<h4 class="text-center">{% translate "I need a new account" %}</h4>
{% endif %}
{% bootstrap_field form.register_name layout="inline" %}
{% bootstrap_field form.register_email layout="inline" %}
{% bootstrap_field form.register_password layout="inline" %}
{% bootstrap_field form.register_password_repeat layout="inline" %}
{% if not no_buttons %}
<button type="submit" class="btn btn-lg btn-info btn-block">
{% translate "Register" %}
</button>
{% endif %}
</div>
{% endif %}
<div class="panel panel-default">
<div class="panel-heading text-center" id="headingOne">
<a class="btn btn-lg btn-primary btn-block mt-3" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne">
{% translate "Login with Speaker Account" %}
</a>
</div>
<div id="collapseOne" class="auth-form-block panel-collapse collapse in" aria-labelledby="headingOne">
<div class="panel-body">
{% bootstrap_field form.login_email layout="inline" %}
{% bootstrap_field form.login_password layout="inline" %}
{% if not no_buttons %}
<button type="submit" class="btn btn-lg btn-success btn-block">
{% translate "Log in" %}
</button>
{% endif %}
{% if password_reset_link or request.event %}
<a class="btn btn-block btn-link" href="{% if password_reset_link %}{{ password_reset_link }}{% else %}{{ request.event.urls.reset }}{% endif %}">
{% translate "Reset password" %}
</a>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% if not hide_register %}
<hr>
<div class="panel panel-default">
<div class="panel-heading text-center" id="headingTwo">
<a class="btn btn-lg btn-primary btn-block mt-3" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
{% translate "Register Speaker Account" %}
</a>
</div>
<div id="collapseTwo" class="auth-form-block panel-collapse collapse in" aria-labelledby="headingTwo">
<div class="panel-body">
{% bootstrap_field form.register_name layout="inline" %}
{% bootstrap_field form.register_email layout="inline" %}
{% bootstrap_field form.register_password layout="inline" %}
{% bootstrap_field form.register_password_repeat layout="inline" %}
{% if not no_buttons %}
<button type="submit" class="btn btn-lg btn-info btn-block">
{% translate "Register" %}
</button>
{% endif %}
</div>
</div>
</div>
{% endif %}
</div>
{% if no_form %}</div>{% else %}</form>{% endif %}

0 comments on commit b2b3f01

Please sign in to comment.