Skip to content

Commit

Permalink
templates: overwrite sign up template
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Panero committed Mar 25, 2020
1 parent 642d76a commit dff2c48
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions invenio_app_rdm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def _(x):
THEME_SITENAME = _('InvenioRDM')
"""Site name."""

SECURITY_REGISTER_USER_TEMPLATE = 'invenio_app_rdm/sign_up.html'
"""Default template for user registration."""


# Invenio-Mail / Flask-Mail
# =========================
Expand Down
45 changes: 45 additions & 0 deletions invenio_app_rdm/theme/templates/invenio_app_rdm/sign_up.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{# -*- coding: utf-8 -*-

This file is part of Invenio.
Copyright (C) 2020 CERN.
Copyright (C) 2020 Northwestern University.

Invenio-App-RDM 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 panel %}
{%- with form = register_user_form %}
<div class="col-md-6 col-md-offset-3">
<div class="panel panel-default">
<div class="panel-body">
<h3 class="text-center panel-free-title">{% trans sitename=config.ACCOUNTS_SITENAME %}Sign up for an {{ sitename }} account!{% endtrans %}</h3>
<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="glyphicon glyphicon-user", autofocus=True, errormsg=False) }}
{{ render_field(form.password, icon="glyphicon glyphicon-lock", errormsg=False) }}
{%- if form.password_confirm %}
{{ render_field(form.password_confirm, icon="glyphicon glyphicon-lock", errormsg=False) }}
{%- endif %}
{%- endblock registration_form_fields %}
{%- if form.recaptcha %}
<div class="form-group form-group-lg">{{ form.recaptcha() }}</div>
{%- endif %}
<button type="submit" class="btn btn-warning btn-lg btn-block"><i class="fa fa-edit"></i> {{ _('Sign Up') }}</button>
</form>
</div>
<div class="panel-footer text-center">
<h4 class="text-muted">
{{ _('Already have an account?') }}
<a href="{{ url_for_security('login') }}">{{ _('Log In') }}</a>
</h4>
</div>
</div>
</div>
{%- endwith %}
{% endblock panel %}

0 comments on commit dff2c48

Please sign in to comment.