overriding register_user template

added the variable and html for sigup page.
This commit is contained in:
mb
2020-07-08 11:50:25 +02:00
parent 0e47201fd1
commit 4cfeb71763
3 changed files with 61 additions and 3 deletions

View File

@@ -43,6 +43,9 @@ THEME_FRONTPAGE_TITLE = _('Frontpage Title')
THEME_SITENAME = _('Application Name')
"""Site name."""
SECURITY_REGISTER_USER_TEMPLATE = \
'invenio_theme_tugraz/accounts/register_user.html'
# Invenio-I18N
# ============
# See https://invenio-i18n.readthedocs.io/en/latest/configuration.html

View File

@@ -19,7 +19,7 @@
{%- endblock form_header %}
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH == 'True' %}
{%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
<div class="ui raised segment">
<img src="{{ url_for('static', filename=config.INVENIO_THEME_TUGRAZ_ICON)}}" height="25px" align="left">
<a href="{{ url_for('sso_saml.sso', idp='idp') }}">
@@ -28,7 +28,7 @@
</div>
<h3 align="center">— OR —</h3>
{%- endif %}
{%- block form_outer %}
{%- with form = login_user_form %}
<form action="{{ url_for_security('login') }}" method="POST"
@@ -63,4 +63,4 @@
href="{{ url_for('security.forgot_password') }}">{{ _('Forgot password?') }}</a>
{%- endif %}
{%- endblock recoverable %}
{% endblock page_body %}
{% endblock page_body %}

View File

@@ -0,0 +1,55 @@
{# -*- coding: utf-8 -*-
This file is part of Invenio.
Copyright (C) 2015-2020 CERN.
Invenio is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.
#}
{%- extends config.ACCOUNTS_COVER_TEMPLATE %}
{% from "invenio_accounts/_macros.html" import render_field, form_errors %}
{% block page_body %}
<div class="ui padded segments big form">
<div class="ui segment padded relaxed">
<div class="divider hidden"></div>
{%- block form_header %}
<h3 class="ui header">
{% trans sitename=config.ACCOUNTS_SITENAME %}Sign up for an {{ sitename }} account!{% endtrans %}
</h3>
{%- endblock form_header %}
{%- with form = register_user_form %}
<form action="{{ url_for_security('register') }}" method="POST"
name="register_user_form">
{{ form_errors(form) }}
{{ form.hidden_tag() }}
{%- block registration_form_fields scoped %}
{{ render_field(form.email, icon="user icon", autofocus=True, errormsg=False) }}
{{ render_field(form.password, icon="lock icon", errormsg=False) }}
{%- if form.password_confirm %}
{{ render_field(form.password_confirm, icon="lock icon", errormsg=False) }}
{%- endif %}
{%- endblock registration_form_fields %}
{%- if form.recaptcha %}
<div class="grouped fields">{{ form.recaptcha() }}</div>
{%- endif %}
<button type="submit" class="ui fluid large signup submit button">
<i class="ui edit outline icon"></i>{{ _('Sign Up') }}
</button>
</form>
{%- endwith %}
<div class="divider hidden"></div>
</div>
<div class="ui secondary segment padded">
{{ _('Already have an account?') }}
<a href="{{ url_for_security('login') }}">{{ _('Log In') }}</a>
</div>
</div>
{% endblock page_body %}