diff --git a/aleksis/core/static/style.scss b/aleksis/core/static/style.scss index 06db64f9613d3c4d6b840b7e2fcf5c68686349f7..b288befaff58e9e66776db4a0c2f657d57cf0d34 100644 --- a/aleksis/core/static/style.scss +++ b/aleksis/core/static/style.scss @@ -691,3 +691,18 @@ main .alert p:first-child, main .alert div:first-child { background-color: inherit !important; color: inherit !important; } + +.card .card-action-light { + background-color: inherit; + border-top: 1px solid rgba(160, 160, 160, 0.2); + position: relative; + padding: 16px 24px; +} + +.margin-top { + margin-top: 0.7rem !important; +} + +.margin-bottom { + margin-bottom: 0.7rem !important; +} diff --git a/aleksis/core/templates/account/password_reset.html b/aleksis/core/templates/account/password_reset.html index 04d4ee1a110d908646871b3df8c5c773eee0bac2..4e93262643e0e28919e405c9b2f0465bf2a2bcf8 100644 --- a/aleksis/core/templates/account/password_reset.html +++ b/aleksis/core/templates/account/password_reset.html @@ -3,30 +3,34 @@ {% load i18n material_form %} {% block browser_title %}{% trans "Reset password" %}{% endblock %} -{% block page_title %}{% trans "Reset password" %}{% endblock %} +{% block no_page_title %}{% endblock %} {% block content %} - <div class="alert warning"> - <p> - <i class="material-icons left">warning</i> - {% blocktrans %}Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.{% endblocktrans %} - </p> - </div> + <div class="row"> + <div class="col m1 l2 xl3"></div> + <div class="col s12 m10 l8 xl6"> + <div class="card"> + <form method="post" action="{% url 'account_reset_password' %}" class="password_reset"> + <div class="card-content"> + <div class="card-title">{% trans "Reset password" %}</div> + <p class="margin-bottom"> + {% blocktrans %}Forgotten your password? Enter your e-mail address below, and we'll send you an e-mail allowing you to reset it.{% endblocktrans %} + </p> + {% csrf_token %} + {% form form=form %}{% endform %} + </div> + <div class="card-action-light"> + {% trans "Reset password" as caption %} + {% include "core/partials/save_button.html" with caption=caption icon="priority_high" %} + </div> + </form> + </div> - <div class="alert warning"> - <p> - <i class="material-icons left">warning</i> - {% blocktrans %}Please contact one of your site administrators, if you - have any troblue resetting your password:{% endblocktrans %} - </p> + <div class="grey-text text-darken-2"> + {% blocktrans %}Please contact one of your site administrators, if you + have any trouble resetting your password:{% endblocktrans %} + {% include "core/partials/admins_list.html" %} + </div> + </div> </div> - {% include "core/partials/admins_list.html" %} - - <form method="post" action="{% url 'account_reset_password' %}" class="password_reset"> - {% csrf_token %} - {% form form=form %}{% endform %} - {% trans "Reset password" as caption %} - {% include "core/partials/save_button.html" with caption=caption icon="priotity_high" %} - </form> - {% endblock %} diff --git a/aleksis/core/templates/account/password_reset_done.html b/aleksis/core/templates/account/password_reset_done.html index b1a4a482a3ee64b0f2c6339e76ed44c66b29ef50..ddd8b3871c242e8ee2eb9b22cc472778a3b096b9 100644 --- a/aleksis/core/templates/account/password_reset_done.html +++ b/aleksis/core/templates/account/password_reset_done.html @@ -3,15 +3,17 @@ {% load i18n %} {% block browser_title %}{% trans "Reset password" %}{% endblock %} -{% block page_title %}{% trans "Reset password" %}{% endblock %} +{% block no_page_title %}{% endblock %} {% block content %} <div class="container"> <div class="card green"> <div class="card-content white-text"> - <div class="material-icons small left">success</div> - <span class="card-title">{% blocktrans %}Password reset mail sent!{% endblocktrans %}</span> + <div class="card-title"> + <i class="material-icons small left">check_circle</i> + {% blocktrans %}Password reset mail sent{% endblocktrans %} + </div> <p> {% blocktrans %} We have sent you an e-mail. Please contact one of your site diff --git a/aleksis/core/templates/account/password_reset_from_key.html b/aleksis/core/templates/account/password_reset_from_key.html index 5b3d7c7ae59b19ffed2f2d098daccdef8a6900ba..4b2b91a28c875e7c1337fd0543646eae881da356 100644 --- a/aleksis/core/templates/account/password_reset_from_key.html +++ b/aleksis/core/templates/account/password_reset_from_key.html @@ -3,19 +3,22 @@ {% load i18n material_form %} {% block browser_title %}{% trans "Change password" %}{% endblock %} -{% block page_title %}{% trans "Change password" %}{% endblock %} +{% block no_page_title %}{% endblock %} {% block content %} {% if token_fail %} <div class="container"> <div class="card red"> <div class="card-content white-text"> - <div class="material-icons small left">error_outline</div> - <span class="card-title">{% blocktrans %}Bad token!{% endblocktrans %}</span> + <div class="card-title"> + <i class="material-icons small left">error_outline</i> + {% blocktrans %}Bad token{% endblocktrans %} + </div> <p> {% url 'account_reset_password' as passwd_reset_url %} {% blocktrans %} - The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}">new password reset</a>. + The password reset link was invalid, possibly because it has already been used. Please request a <a href="{{ passwd_reset_url }}" + class="blue-text text-lighten-2">new password reset</a>. {% endblocktrans %} </p> <p> @@ -29,14 +32,24 @@ </div> </div> {% else %} - {% if form %} - <form method="post" action="{{ action_url }}"> - {% csrf_token %} - {% form form=form %}{% endform %} - {% trans "Change password" as caption %} - {% include "core/partials/save_button.html" with caption=caption icon="priotity_high" %} - </form> - {% else %} + <div class="row"> + <div class="col m1 l2 xl3"></div> + <div class="col s12 m10 l8 xl6"> + <div class="card"> + {% if form %} + <form method="post" action="{{ action_url }}"> + <div class="card-content"> + <div class="card-title">{% trans "Change password" %}</div> + {% csrf_token %} + {% form form=form %}{% endform %} + <div class="card-action-light"> + {% trans "Change password" as caption %} + {% include "core/partials/save_button.html" with caption=caption icon="priority_high" %} + </div> + </div> + </form> + {% else %} + </div> <div class="alert success"> <p> <i class="material-icons left">success</i> @@ -44,6 +57,9 @@ Your password is now changed! {% endblocktrans %} </p> + <div class="card-action"> + <a href="{% url "login" %}">{% trans "Back to login" %}</a> + </div> </div> {% endif %} {% endif %} diff --git a/aleksis/core/templates/core/partials/alternative_login_options.html b/aleksis/core/templates/core/partials/alternative_login_options.html deleted file mode 100644 index 24d36e9ef76f3da11554169106fc1eafd3c7ac46..0000000000000000000000000000000000000000 --- a/aleksis/core/templates/core/partials/alternative_login_options.html +++ /dev/null @@ -1,10 +0,0 @@ -{% if ALTERNATIVE_LOGIN_VIEWS %} - <p> - {% for backend, url, icon, text in ALTERNATIVE_LOGIN_VIEWS %} - <a class="btn-large waves-effect waves-light primary" href="{% url url %}"> - <i class="material-icons left">{{ icon }}</i> - {{ text }} - </a> - {% endfor %} - </p> -{% endif %} diff --git a/aleksis/core/templates/socialaccount/snippets/provider_list.html b/aleksis/core/templates/socialaccount/snippets/provider_list.html index 3e6d5fde7da0fb5ec5ed0f8bb1484dbad9f94579..9f35d0a3b84a5ff7a4fd76fe812e099d86f4c8bf 100644 --- a/aleksis/core/templates/socialaccount/snippets/provider_list.html +++ b/aleksis/core/templates/socialaccount/snippets/provider_list.html @@ -1,31 +1,27 @@ {% load i18n socialaccount %} - +<p> {% get_providers as socialaccount_providers %} {% if socialaccount_providers %} {% for provider in socialaccount_providers %} {% if provider.id == "openid" %} {% for brand in provider.get_brands %} - <li> <a title="{{brand.name}}" - class="socialaccount_provider {{provider.id}} {{brand.id}}" + class="socialaccount_provider {{provider.id}} {{brand.id}} + btn-large waves-effect waves-light primary-color" href="{% provider_login_url provider.id openid=brand.openid_url process=process %}"> - {{brand.name}} + {% blocktrans with name=brand.name %} + Login with {{ name }} + {% endblocktrans %} </a> - </li> {% endfor %} {% endif %} - <li> - <a title="{{provider.name}}" class="socialaccount_provider {{provider.id}}" + <a title="{{provider.name}}" class="socialaccount_provider {{provider.id}} + btn hundred-percent waves-effect waves-light primary-color" href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}"> - {{provider.name}} + {% blocktrans with name=provider.name %} + Login with {{ name }} + {% endblocktrans %} </a> - </li> {% endfor %} - {% else %} - <div class="alert warning"> - <p> - <i class="material-icons left">warning</i> - {% blocktrans %}Currently there are no providers configured.{% endblocktrans %} - </p> - </div> {% endif %} +</p> \ No newline at end of file diff --git a/aleksis/core/templates/two_factor/core/login.html b/aleksis/core/templates/two_factor/core/login.html index cee1bc752422d3743ba975830ed941c43ea6f44e..1656532325ed77d81b0cad5ceb7a940bcd434b82 100644 --- a/aleksis/core/templates/two_factor/core/login.html +++ b/aleksis/core/templates/two_factor/core/login.html @@ -9,100 +9,101 @@ {% block content %} {% get_providers as socialaccount_providers %} - <h4>{% trans "Login" %}</h4> - - {% if wizard.steps.current == "auth" and user.is_authenticated %} - <div class="alert warning"> - <p> - <i class="material-icons left">warning</i> - {% blocktrans %}You have no permission to view this page. Please login with an other account.{% endblocktrans %} - </p> - </div> - {% elif wizard.steps.current == 'auth' %} - <div class="alert primary"> - <p> - <i class="material-icons left">info</i> - - {% blocktrans %}Please login to see this page.{% endblocktrans %} - </p> - </div> - <div class="alert primary"> - <p> - <i class="material-icons left">info</i> - - {% trans "Forgot your current password? Click here to reset it:" %} <a href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a> - </p> - </div> - - {% include "socialaccount/snippets/provider_list.html" with process="login" %} - {% endif %} - - {% if wizard.steps.current == 'auth' and ALTERNATIVE_LOGIN_VIEWS %} - <h5>{% trans "Login with username and password" %}</h5> - {% endif %} - - {% if not wizard.steps.current == "auth" %} - <div class="alert primary"> - <p> - <i class="material-icons left">info</i> - - {% if wizard.steps.current == 'token' %} - {% if device.method == 'call' %} - {% blocktrans %}We are calling your phone right now, please enter the - digits you hear.{% endblocktrans %} - {% elif device.method == 'sms' %} - {% blocktrans %}We sent you a text message, please enter the tokens we - sent.{% endblocktrans %} - {% else %} - {% blocktrans %}Please enter the tokens generated by your token - generator.{% endblocktrans %} - {% endif %} - {% elif wizard.steps.current == 'backup' %} - {% blocktrans %}Use this form for entering backup tokens for logging in. - These tokens have been generated for you to print and keep safe. Please - enter one of these backup tokens to login to your account.{% endblocktrans %} + <div class="row"> + <div class="col m1 l2 xl3"></div> + <div class="col s12 m10 l8 xl6"> + <div class="card"> + <div class="card-content"> + {% if wizard.steps.current == 'auth' and socialaccount_providers %} + <div class="card-title">{% trans "Login with username and password" %}</div> + {% else %} + <div class="card-title">{% trans "Login" %}</div> + {% endif %} + {% if wizard.steps.current == "auth" and user.is_authenticated %} + <div class="alert warning"> + <p> + <i class="material-icons left">warning</i> + {% blocktrans %}You have no permission to view this page. Please login with an other account.{% endblocktrans %} + </p> + </div> + {% elif wizard.steps.current == 'auth' %} + <div class="alert primary"> + <p> + <i class="material-icons left">info</i> + {% blocktrans %}Please login to see this page.{% endblocktrans %} + </p> + </div> {% endif %} - </div> - {% endif %} - - - <form action="" method="post"> - {% csrf_token %} - {% include "two_factor/_wizard_forms.html" %} - - {# hidden submit button to enable [enter] key #} - <div style="margin-left: -9999px"> - <input type="submit" value=""/> - </div> - {% if other_devices %} - <p>{% trans "Or, alternatively, use one of your backup phones:" %}</p> - <p> - {% for other in other_devices %} - <button name="challenge_device" value="{{ other.persistent_id }}" - class="btn" type="submit"> - {{ other|device_action }} - </button> - {% endfor %}</p> - {% endif %} - {% if backup_tokens %} - <p>{% trans "As a last resort, you can use a backup token:" %}</p> - <p> - <button name="wizard_goto_step" type="submit" value="backup" - class="btn">{% trans "Use Backup Token" %}</button> - </p> + {% if not wizard.steps.current == "auth" %} + <div class="alert primary"> + <p> + <i class="material-icons left">info</i> + + {% if wizard.steps.current == 'token' %} + {% if device.method == 'call' %} + {% blocktrans %}We are calling your phone right now, please enter the + digits you hear.{% endblocktrans %} + {% elif device.method == 'sms' %} + {% blocktrans %}We sent you a text message, please enter the tokens we + sent.{% endblocktrans %} + {% else %} + {% blocktrans %}Please enter the tokens generated by your token + generator.{% endblocktrans %} + {% endif %} + {% elif wizard.steps.current == 'backup' %} + {% blocktrans %}Use this form for entering backup tokens for logging in. + These tokens have been generated for you to print and keep safe. Please + enter one of these backup tokens to login to your account.{% endblocktrans %} + {% endif %} + </div> {% endif %} - <button type="submit" class="btn green waves-effect waves-light"> - {% trans "Login" %} - <i class="material-icons right">send</i> - </button> - - </form> - - {% if wizard.steps.current == 'auth' and ALTERNATIVE_LOGIN_VIEWS %} - <h5>{% trans "Use alternative login options" %}</h5> - {% include "core/partials/alternative_login_options.html" %} - {% endif %} + <form action="" method="post"> + {% csrf_token %} + {% include "two_factor/_wizard_forms.html" %} + + {% if other_devices %} + <p>{% trans "Or, alternatively, use one of your backup phones:" %}</p> + <p> + {% for other in other_devices %} + <button name="challenge_device" value="{{ other.persistent_id }}" class="btn" type="submit"> + {{ other|device_action }} + </button> + {% endfor %} + </p> + {% endif %} + {% if backup_tokens %} + <p>{% trans "As a last resort, you can use a backup token:" %}</p> + <p> + <button name="wizard_goto_step" type="submit" value="backup" + class="btn">{% trans "Use Backup Token" %} + </button> + </p> + {% endif %} + <div class="card-action-light"> + <button type="submit" class="btn green waves-effect waves-light"> + {% trans "Login" %} + <i class="material-icons right">send</i> + </button> + {% if request.site.preferences.auth__allow_password_change %} + <a href="{% url "account_reset_password" %}" class="btn-flat right waves-effect waves-light"> + {% trans "Reset password" %} + </a> + {% endif %} + </div> + </form> + </div> + + <div class="card"> + <div class="card-content"> + {% if wizard.steps.current == 'auth' and socialaccount_providers %} + <div class="card-title"> + {% trans "Use alternative login options" %} + </div> + {% include "socialaccount/snippets/provider_list.html" with process="login" %} + {% endif %} + </div> + </div> {% endblock %}