Commit 4a91790e authored by Tino Goratsch's avatar Tino Goratsch

- streamlined the user registration form

- extracted the password form field into a separate template file and use it to reduce code duplication
parent bd8d1fb2
......@@ -241,14 +241,7 @@
</div>
<div id="tab-6" class="tab-pane fade">
{block PASSWORD_FIELDS}
<div class="form-group">
<label for="pwd" class="col-sm-2 control-label required">{lang t="users|pwd"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="pwd" id="pwd" required></div>
</div>
<div class="form-group">
<label for="pwd-repeat" class="col-sm-2 control-label required">{lang t="users|pwd_repeat"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="pwd_repeat" id="pwd-repeat" required></div>
</div>
{include file="asset:Users/Partials/password_fields.tpl"}
{/block}
</div>
</div>
......
{extends file="asset:Users/Admin/index.create.tpl"}
{block PASSWORD_FIELDS}
<div class="form-group">
<label for="new-pwd" class="col-sm-2 control-label">{lang t="users|new_pwd"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="new_pwd" id="new-pwd"></div>
</div>
<div class="form-group">
<label for="new-pwd-repeat" class="col-sm-2 control-label">{lang t="users|new_pwd_repeat"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="new_pwd_repeat" id="new-pwd-repeat"></div>
</div>
{/block}
\ No newline at end of file
{include file="asset:Users/Partials/password_fields.tpl" field_name="new_pwd" translator_phrase="new_pwd"}
{/block}
......@@ -101,18 +101,7 @@
</div>
</div>
<div id="tab-4" class="tab-pane fade">
<div class="form-group">
<label for="new-pwd" class="col-sm-2 control-label">{lang t="users|new_pwd"}</label>
<div class="col-sm-10"><input class="form-control" type="password" name="new_pwd" id="new-pwd">
</div>
</div>
<div class="form-group">
<label for="new-pwd-repeat" class="col-sm-2 control-label">{lang t="users|new_pwd_repeat"}</label>
<div class="col-sm-10">
<input class="form-control" type="password" name="new_pwd_repeat" id="new-pwd-repeat"></div>
</div>
{include file="asset:Users/Partials/password_fields.tpl" field_name='new_pwd' translator_phrase="new_pwd"}
</div>
</div>
</div>
......
......@@ -5,48 +5,21 @@
{$error_msg}
{/if}
<form action="{$REQUEST_URI}" method="post" accept-charset="UTF-8" class="form-horizontal" data-ajax-form="true" data-ajax-form-loading-text="{lang t="system|loading_please_wait"}">
<div class="tabbable">
<ul class="nav nav-tabs">
<li class="active">
<a href="#tab-1" data-toggle="tab">{lang t="users|nickname"} &amp; {lang t="system|email_address"}</a>
</li>
<li><a href="#tab-2" data-toggle="tab">{lang t="users|pwd"}</a></li>
</ul>
<div class="tab-content">
<div id="tab-1" class="tab-pane fade in active">
<div class="form-group">
<label for="nickname" class="col-sm-2 control-label required">{lang t="users|nickname"}</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="nickname" id="nickname" value="{$form.nickname}" maxlength="30" required>
</div>
</div>
<div class="form-group">
<label for="mail" class="col-sm-2 control-label required">{lang t="system|email_address"}</label>
<div class="col-sm-10">
<input class="form-control" type="email" name="mail" id="mail" value="{$form.mail}" maxlength="120" required>
</div>
</div>
</div>
<div id="tab-2" class="tab-pane fade">
<div class="form-group">
<label for="pwd" class="col-sm-2 control-label required">{lang t="users|pwd"}</label>
<div class="form-group">
<label for="nickname" class="col-sm-2 control-label required">{lang t="users|nickname"}</label>
<div class="col-sm-10">
<input class="form-control" type="password" name="pwd" id="pwd" value="" required>
</div>
</div>
<div class="form-group">
<label for="pwd-repeat" class="col-sm-2 control-label required">{lang t="users|pwd_repeat"}</label>
<div class="col-sm-10">
<input class="form-control" type="text" name="nickname" id="nickname" value="{$form.nickname}" maxlength="30" required>
</div>
</div>
<div class="form-group">
<label for="mail" class="col-sm-2 control-label required">{lang t="system|email_address"}</label>
<div class="col-sm-10">
<input class="form-control" type="password" name="pwd_repeat" id="pwd-repeat" value="" required>
</div>
</div>
</div>
<div class="col-sm-10">
<input class="form-control" type="email" name="mail" id="mail" value="{$form.mail}" maxlength="120" required>
</div>
</div>
{include file="asset:Users/Partials/password_fields.tpl"}
{event name="captcha.event.display_captcha"}
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
......
{if empty($field_name)}
{$field_name='pwd'}
{/if}
{if empty($translator_phrase)}
{$translator_phrase='pwd'}
{/if}
<div class="form-group">
<label for="{$field_name|replace:'_':'-'}" class="col-sm-2 control-label required">
{lang t="users|`$translator_phrase`"}
</label>
<div class="col-sm-10">
<input class="form-control" type="password" name="{$field_name}" id="{$field_name|replace:'_':'-'}" value="" required>
</div>
</div>
<div class="form-group">
<label for="{$field_name|replace:'_':'-'}-repeat" class="col-sm-2 control-label required">
{lang t="users|`$translator_phrase`_repeat"}
</label>
<div class="col-sm-10">
<input class="form-control" type="password" name="{$field_name}_repeat" id="{$field_name|replace:'_':'-'}-repeat" value="" required>
</div>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment