mirror of
https://github.com/Cian-H/invenio-theme-iform.git
synced 2025-12-22 20:51:58 +00:00
login_user: extended user login template
adds support for oauth and new configs
This commit is contained in:
@@ -10,6 +10,7 @@
|
|||||||
|
|
||||||
|
|
||||||
{% from "invenio_accounts/_macros.html" import render_field, form_errors %}
|
{% from "invenio_accounts/_macros.html" import render_field, form_errors %}
|
||||||
|
{%- from "invenio_oauthclient/_macros.html" import oauth_button %}
|
||||||
{% block page_body %}
|
{% block page_body %}
|
||||||
<div class="spacer-long"></div>
|
<div class="spacer-long"></div>
|
||||||
<div class="spacer-long"></div>
|
<div class="spacer-long"></div>
|
||||||
@@ -24,16 +25,31 @@
|
|||||||
{%- endblock form_header %}
|
{%- endblock form_header %}
|
||||||
<div class="ui divider"></div>
|
<div class="ui divider"></div>
|
||||||
<!--Log in with SSO-->
|
<!--Log in with SSO-->
|
||||||
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
|
{% if config.OAUTHCLIENT_REMOTE_APPS or config.SSO_SAML_IDPS %}
|
||||||
<a href="{{ url_for('sso_saml.sso', idp='idp') }}" class="login-page-button ui fluid large button">
|
<div class="ui form">
|
||||||
{% trans type='TUGRAZ' %} Log in with {{ type }}{% endtrans %}
|
{% for name in config.OAUTHCLIENT_REMOTE_APPS.keys() %}
|
||||||
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="20px" />
|
{{ oauth_button(name, next=request.args.get('next')) }}
|
||||||
</a>
|
{% endfor %}
|
||||||
<div class="spacer-long"></div>
|
</div>
|
||||||
<div class="ui inverted horizontal divider"><span class="text-color">{{_ ("Or")}}</span></div>
|
{% for name in config.SSO_SAML_IDPS.keys() %}
|
||||||
{%- endif %}
|
<div class="field">
|
||||||
|
<a class="fluid ui basic button large" href="{{ url_for('sso_saml.sso', idp=name) }}">
|
||||||
|
<i class="{{ name|lower() }} icon"></i>
|
||||||
|
{{
|
||||||
|
_('Sign in with %(title)s', title=config.SSO_SAML_IDPS[name]['title']|default("SAML", true))
|
||||||
|
}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
{%- if config.ACCOUNTS_LOCAL_LOGIN_ENABLED %}
|
||||||
|
<div class="ui horizontal divider">
|
||||||
|
Or
|
||||||
|
</div>
|
||||||
|
{%- endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{%- block form_outer %}
|
{%- block form_outer %}
|
||||||
|
{%- if config.ACCOUNTS_LOCAL_LOGIN_ENABLED %}
|
||||||
{%- with form = login_user_form %}
|
{%- with form = login_user_form %}
|
||||||
<div style="padding-bottom: 20px;padding-top: 6px;">
|
<div style="padding-bottom: 20px;padding-top: 6px;">
|
||||||
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form" class="ui big form">
|
<form action="{{ url_for_security('login') }}" method="POST" name="login_user_form" class="ui big form">
|
||||||
@@ -47,6 +63,7 @@
|
|||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
{%- endwith %}
|
{%- endwith %}
|
||||||
|
{%- endif %}
|
||||||
{%- endblock form_outer %}
|
{%- endblock form_outer %}
|
||||||
<div class="divider hidden"></div>
|
<div class="divider hidden"></div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user