Register form tweaked

This commit is contained in:
2023-06-01 15:52:37 +01:00
parent ff871bdbbf
commit 9b229fc6ee
10 changed files with 328 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
{% block input_user_locale %}
{% if site.registration.captcha %}
{% if col_width %}<div class="{{col_width}}">{% endif %}
<div class="form-group">
<label class="sr-only" for="input-register-captcha">{{translate('CAPTCHA.VERIFY')}}</label>
<div class="row">
<div class="col-md-6">
<input type="text" id="input-register-captcha" name="captcha" placeholder="{{translate('CAPTCHA.SPECIFY')}}" class="form-control">
</div>
<div class="col-md-6 form-col-captcha">
<img src="{{site.uri.public}}/account/captcha" id="captcha" data-target="#input-register-captcha">
</div>
</div>
</div>
{% if col_width %}</div>{% endif %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,17 @@
{% block input_register_locale %}
{% if 'locale' not in form.fields.hidden %}
{% if col_width %}<div class="{{col_width}}">{% endif %}
<div class="form-group">
<label for="r-form-locale" class="control-label">{{translate("LOCALE")}}</label>
<select id="r-form-locale" class="form-control js-select2" name="locale">
{% for option, label in locales.available %}
{% if label is not empty %}
<option value="{{option}}" {% if (option == locales.current) %}selected{% endif %}>{{label}}</option>
{% endif %}
{% endfor %}
</select>
<p class="help-block">{{translate("LOCALE.ACCOUNT")}}.</p>
</div>
{% if col_width %}</div>{% endif %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,28 @@
{% block input_user_locale %}
{% if 'locale' not in form.fields.hidden %}
{% if col_width %}<div class="{{col_width}}">{% endif %}
<label for="input-register-first_name">{{translate('NAME_AND_EMAIL')}}</label>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="sr-only control-label" for="input-register-first_name">{{translate('FIRST_NAME')}}</label>
<input type="text" id="input-register-first_name" name="first_name" placeholder="{{translate('FIRST_NAME')}}" class="form-control" autocomplete="off">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="sr-only control-label" for="input-register-last_name">{{translate('LAST_NAME')}}</label>
<input type="text" id="input-register-last_name" name="last_name" placeholder="{{translate('LAST_NAME')}}" class="form-control" autocomplete="off">
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="form-group">
<input type="text" id="input-register-email" name="email" placeholder="{% if site.registration.require_email_verification %}{{translate('EMAIL.VERIFICATION_REQUIRED')}}{% else %}{{translate('EMAIL.YOUR')}}{% endif %}" class="form-control">
</div>
</div>
</div>
{% if col_width %}</div>{% endif %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,14 @@
{% block input_user_password %}
{% if 'password' not in form.fields.hidden %}
{% if col_width %}<div class="{{col_width}}">{% endif %}
<div class="form-group">
<label for="input-register-password" class="control-label">{{translate('PASSWORD')}}</label>
<input type="password" id="input-register-password" name="password" placeholder="{{translate('PASSWORD.BETWEEN', {min: site.password.length.min, max: site.password.length.max})}}" class="form-control">
</div>
<div class="form-group">
<label class="sr-only control-label" for="input-register-passwordc">{{translate('PASSWORD.CONFIRM')}}</label>
<input type="password" id="input-register-passwordc" name="passwordc" placeholder="{{translate('PASSWORD.CONFIRM')}}" class="form-control">
</div>
{% if col_width %}</div>{% endif %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,11 @@
{% block input_register_user_name %}
{% if 'user_name' not in form.fields.hidden %}
{% if col_width %}<div class="{{col_width}}">{% endif %}
<div class="form-group">
<label for="input-register-username" class="control-label">{{translate('USERNAME')}}</label>
<span class="pull-right"><a href="#" id="input-register-username-suggest">[{{translate('SUGGEST')}}]</a></span>
<input type="text" id="input-register-username" name="user_name" placeholder="{{translate('USERNAME.CHOOSE')}}" class="form-control" autocomplete="off">
</div>
{% if col_width %}</div>{% endif %}
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,43 @@
<form id="register" role="form" action="{{site.uri.public}}/account/register" method="post" class="r-form">
{% include "forms/csrf.html.twig" %}
<div class="form-alerts" id="alerts-page"></div>
<div class="row">
{% block register_form %}
{% include "forms/inputs/register-name_email.html.twig" with { 'col_width': 'col-sm-12' } %}
{% include "forms/inputs/register-user_name.html.twig" with { 'col_width': 'col-sm-12' } %}
{% include "forms/inputs/register-password.html.twig" with { 'col_width': 'col-sm-12' } %}
{% include "forms/inputs/register-locale.html.twig" with { 'col_width': 'col-sm-12' } %}
{% include "forms/inputs/register-captcha.html.twig" with { 'col_width': 'col-sm-12' } %}
<div class="col-sm-12 collapse">
<label>Spiderbro: Don't change me bro, I'm tryin'a catch some flies!</label>
<input name="spiderbro" id="spiderbro" value="http://"/>
</div>
<div class="col-sm-12 text-left">
<p>
{{translate('TOS_AGREEMENT', {
'site_title' : site.title,
'link_attributes' : 'class="js-show-tos" href="#" data-toggle="modal"'
}) | raw}}
</p>
</div>
{% endblock %}
</div>
<div>
<button type="submit" class="btn btn-block btn-primary">{{translate('REGISTER_ME')}}</button>
</div>
<div style="padding-top: 10px;">
{{translate('SIGN_IN_HERE', {
'url' : site.uri.public ~'/account/sign-in'
}) | raw}}
</div>
</form>