From 4cfeb71763abea68026b29589301d5f1a5ef24ab Mon Sep 17 00:00:00 2001 From: mb Date: Wed, 8 Jul 2020 11:50:25 +0200 Subject: [PATCH] overriding register_user template added the variable and html for sigup page. --- invenio_theme_tugraz/config.py | 3 + .../invenio_theme_tugraz/accounts/login.html | 6 +- .../accounts/register_user.html | 55 +++++++++++++++++++ 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html diff --git a/invenio_theme_tugraz/config.py b/invenio_theme_tugraz/config.py index f8664eb..f4118e5 100644 --- a/invenio_theme_tugraz/config.py +++ b/invenio_theme_tugraz/config.py @@ -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 diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login.html index 56f5898..659a929 100644 --- a/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login.html +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/login.html @@ -19,7 +19,7 @@ {%- endblock form_header %} - {%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH == 'True' %} + {%- if config.INVENIO_CONFIG_TUGRAZ_SHIBBOLETH %}
@@ -28,7 +28,7 @@

— OR —

{%- endif %} - + {%- block form_outer %} {%- with form = login_user_form %}
{{ _('Forgot password?') }} {%- endif %} {%- endblock recoverable %} -{% endblock page_body %} \ No newline at end of file +{% endblock page_body %} diff --git a/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html b/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html new file mode 100644 index 0000000..3e2b9b7 --- /dev/null +++ b/invenio_theme_tugraz/templates/invenio_theme_tugraz/accounts/register_user.html @@ -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 %} + +
+
+ + + {%- block form_header %} +

+ {% trans sitename=config.ACCOUNTS_SITENAME %}Sign up for an {{ sitename }} account!{% endtrans %} +

+ {%- endblock form_header %} + + {%- with form = 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 %} +
{{ form.recaptcha() }}
+ {%- endif %} + + + + {%- endwith %} + +
+ +
+ {{ _('Already have an account?') }} + {{ _('Log In') }} +
+
+ +{% endblock page_body %}