Merge branch '3.0'
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / register.tpl
CommitLineData
3e93caf9 1{capture assign='headContent'}
fe17bd5f 2 <style type="text/css">
78b5eb60 3 #fieldset1 {
5f90b288 4 display: none;
78b5eb60
MW
5 }
6 </style>
3e93caf9 7{/capture}
320f4a6d 8
16a96449 9{include file='header' __disableLoginLink=true __disableAds=true}
320f4a6d 10
320f4a6d 11{if $isExternalAuthentication}
f5f2f408 12 <p class="info">{lang}wcf.user.3rdparty.{$__wcf->session->getVar('__3rdPartyProvider')}.register{/lang}</p>
320f4a6d
MW
13{/if}
14
ee629b22 15{include file='formError'}
320f4a6d 16
320f4a6d 17<form method="post" action="{link controller='Register'}{/link}">
d2d216fb 18 <div class="section">
95961bdf
MW
19 <dl{if $errorType.username|isset} class="formError"{/if}>
20 <dt>
21 <label for="{@$randomFieldNames[username]}">{lang}wcf.user.username{/lang}</label>
22 </dt>
23 <dd>
6f2bc235 24 <input type="text" id="{@$randomFieldNames[username]}" name="{@$randomFieldNames[username]}" value="{$username}" required class="medium">
95961bdf
MW
25 {if $errorType.username|isset}
26 <small class="innerError">
27 {if $errorType.username == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
063bbf46 28 {if $errorType.username == 'invalid'}{lang}wcf.user.username.error.invalid{/lang}{/if}
95961bdf
MW
29 {if $errorType.username == 'notUnique'}{lang}wcf.user.username.error.notUnique{/lang}{/if}
30 </small>
31 {/if}
32 <small>{lang}wcf.user.username.description{/lang}</small>
33 </dd>
34 </dl>
35
36 {event name='usernameFields'}
d2d216fb 37 </div>
95961bdf
MW
38
39 <section class="section" id="fieldset1">
40 <header class="sectionHeader">
41 <h2 class="sectionTitle">{lang}wcf.user.register.honeyPot{/lang}</h2>
114b5320 42 <p class="sectionDescription">{lang}wcf.user.register.honeyPot.description{/lang}</p>
95961bdf
MW
43 </header>
44
45 <dl>
46 <dt>
47 <label for="username">{lang}wcf.user.username{/lang}</label>
48 </dt>
49 <dd>
e5f9b56c 50 <input type="text" id="username" name="username" value="" autocomplete="off" class="medium" tabindex="998">
95961bdf
MW
51 </dd>
52 </dl>
53
54 <dl>
55 <dt>
56 <label for="email">{lang}wcf.user.email{/lang}</label>
57 </dt>
58 <dd>
e5f9b56c 59 <input type="email" id="email" name="email" value="" autocomplete="off" class="medium" tabindex="999">
95961bdf
MW
60 </dd>
61 </dl>
62
63 {event name='honeyPotFields'}
64 </section>
65
66 <section class="section">
67 <h2 class="sectionTitle">{lang}wcf.user.email{/lang}</h2>
68
69 <dl{if $errorType.email|isset} class="formError"{/if}>
70 <dt>
71 <label for="{@$randomFieldNames[email]}">{lang}wcf.user.email{/lang}</label>
72 </dt>
73 <dd>
6f2bc235 74 <input type="email" id="{@$randomFieldNames[email]}" name="{@$randomFieldNames[email]}" value="{$email}" required class="medium">
95961bdf
MW
75 {if $errorType.email|isset}
76 <small class="innerError">
77 {if $errorType.email == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
063bbf46 78 {if $errorType.email == 'invalid'}{lang}wcf.user.email.error.invalid{/lang}{/if}
95961bdf
MW
79 {if $errorType.email == 'notUnique'}{lang}wcf.user.email.error.notUnique{/lang}{/if}
80 </small>
81 {/if}
82 </dd>
83 </dl>
84
85 <dl{if $errorType.confirmEmail|isset} class="formError"{/if}>
86 <dt>
87 <label for="{@$randomFieldNames[confirmEmail]}">{lang}wcf.user.confirmEmail{/lang}</label>
88 </dt>
89 <dd>
6f2bc235 90 <input type="email" id="{@$randomFieldNames[confirmEmail]}" name="{@$randomFieldNames[confirmEmail]}" value="{$confirmEmail}" required class="medium">
95961bdf
MW
91 {if $errorType.confirmEmail|isset}
92 <small class="innerError">
93 {if $errorType.confirmEmail == 'notEqual'}{lang}wcf.user.confirmEmail.error.notEqual{/lang}{/if}
94 </small>
95 {/if}
96 </dd>
97 </dl>
98
99 {event name='emailFields'}
100 </section>
101
102 {if !$isExternalAuthentication}
103 <section class="section">
104 <h2 class="sectionTitle">{lang}wcf.user.password{/lang}</h2>
320f4a6d 105
95961bdf 106 <dl{if $errorType.password|isset} class="formError"{/if}>
320f4a6d 107 <dt>
95961bdf 108 <label for="{@$randomFieldNames[password]}">{lang}wcf.user.password{/lang}</label>
320f4a6d
MW
109 </dt>
110 <dd>
6f2bc235 111 <input type="password" id="{@$randomFieldNames[password]}" name="{@$randomFieldNames[password]}" value="{$password}" required class="medium">
95961bdf 112 {if $errorType.password|isset}
320f4a6d 113 <small class="innerError">
95961bdf
MW
114 {if $errorType.password == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
115 {if $errorType.password == 'notSecure'}{lang}wcf.user.password.error.notSecure{/lang}{/if}
320f4a6d
MW
116 </small>
117 {/if}
95961bdf 118 <small>{lang}wcf.user.password.description{/lang}</small>
78b5eb60
MW
119 </dd>
120 </dl>
121
95961bdf 122 <dl{if $errorType.confirmPassword|isset} class="formError"{/if}>
78b5eb60 123 <dt>
95961bdf 124 <label for="{@$randomFieldNames[confirmPassword]}">{lang}wcf.user.confirmPassword{/lang}</label>
78b5eb60
MW
125 </dt>
126 <dd>
6f2bc235 127 <input type="password" id="{@$randomFieldNames[confirmPassword]}" name="{@$randomFieldNames[confirmPassword]}" value="{$confirmPassword}" required class="medium">
95961bdf 128 {if $errorType.confirmPassword|isset}
320f4a6d 129 <small class="innerError">
95961bdf 130 {if $errorType.confirmPassword == 'notEqual'}{lang}wcf.user.confirmPassword.error.notEqual{/lang}{/if}
320f4a6d
MW
131 </small>
132 {/if}
133 </dd>
134 </dl>
135
95961bdf
MW
136 {event name='passwordFields'}
137 </section>
138 {/if}
139
140 {if $availableLanguages|count > 1}
141 <section class="section">
142 <h2 class="sectionTitle">{lang}wcf.user.language{/lang}</h2>
143
144 <dl>
145 <dt><label for="languageID">{lang}wcf.user.language{/lang}</label></dt>
5432feb3
MW
146 <dd id="languageIDContainer">
147 <script data-relocate="true">
148 $(function() {
149 var $languages = {
150 {implode from=$availableLanguages item=language}
151 '{@$language->languageID}': {
152 iconPath: '{@$language->getIconPath()|encodeJS}',
153 languageName: '{@$language|encodeJS}'
154 }
155 {/implode}
156 };
157
158 require(['WoltLabSuite/Core/Language/Chooser'], function(LanguageChooser) {
159 LanguageChooser.init('languageIDContainer', 'languageID', {@$languageID}, $languages);
160
161 var small = elCreate('small');
162 small.innerHTML = '{lang}wcf.user.language.description{/lang}';
163 elById('languageIDContainer').appendChild(small);
164 });
165 });
166 </script>
167 <noscript>
168 <select name="languageID" id="languageID">
169 {foreach from=$availableLanguages item=language}
170 <option value="{@$language->languageID}"{if $language->languageID == $languageID} selected{/if}>{$language}</option>
171 {/foreach}
172 </select>
173 </noscript>
320f4a6d
MW
174 </dd>
175 </dl>
176
95961bdf 177 {hascontent}
320f4a6d 178 <dl>
95961bdf
MW
179 <dt><label>{lang}wcf.user.visibleLanguages{/lang}</label></dt>
180 <dd class="floated">
181 {content}
182 {foreach from=$availableContentLanguages item=language}
6f2bc235 183 <label><input name="visibleLanguages[]" type="checkbox" value="{@$language->languageID}"{if $language->languageID|in_array:$visibleLanguages} checked{/if}> {$language}</label>
95961bdf
MW
184 {/foreach}
185 {/content}
186 <small>{lang}wcf.user.visibleLanguages.description{/lang}</small></dd>
320f4a6d 187 </dl>
95961bdf
MW
188 {/hascontent}
189
190 {event name='languageFields'}
191 </section>
192 {/if}
193
194 {foreach from=$optionTree item=category}
195 <section class="section">
196 <h2 class="sectionTitle">{lang}wcf.user.option.category.{@$category[object]->categoryName}{/lang}</h2>
197
198 {include file='userOptionFieldList' options=$category[options] langPrefix='wcf.user.option.'}
199 </section>
200 {/foreach}
201
202 {event name='sections'}
203
6b3d5c38 204 {include file='captcha' supportsAsyncCaptcha=true}
320f4a6d
MW
205
206 <div class="formSubmit">
e5f9b56c 207 <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s">
ee629b22 208 {@SECURITY_TOKEN_INPUT_TAG}
320f4a6d
MW
209 </div>
210</form>
211
3e93caf9 212<script data-relocate="true">
3e93caf9
MW
213 $(function() {
214 WCF.Language.addObject({
215 'wcf.global.form.error.empty': '{lang}wcf.global.form.error.empty{/lang}',
063bbf46 216 'wcf.user.username.error.invalid': '{lang}wcf.user.username.error.invalid{/lang}',
3e93caf9 217 'wcf.user.username.error.notUnique': '{lang}wcf.user.username.error.notUnique{/lang}',
063bbf46 218 'wcf.user.email.error.invalid' : '{lang}wcf.user.email.error.invalid{/lang}',
3e93caf9
MW
219 'wcf.user.email.error.notUnique' : '{lang}wcf.user.email.error.notUnique{/lang}',
220 'wcf.user.confirmEmail.error.notEqual' : '{lang}wcf.user.confirmEmail.error.notEqual{/lang}',
221 'wcf.user.password.error.notSecure' : '{lang}wcf.user.password.error.notSecure{/lang}',
222 'wcf.user.confirmPassword.error.notEqual' : '{lang}wcf.user.confirmPassword.error.notEqual{/lang}'
223 });
224
225 new WCF.User.Registration.Validation.EmailAddress($('#{@$randomFieldNames[email]}'), $('#{@$randomFieldNames[confirmEmail]}'), null);
226 new WCF.User.Registration.Validation.Password($('#{@$randomFieldNames[password]}'), $('#{@$randomFieldNames[confirmPassword]}'), null);
e3b0902b 227 new WCF.User.Registration.Validation.Username($('#{@$randomFieldNames[username]}'), null, {
3e93caf9
MW
228 minlength: {@REGISTER_USERNAME_MIN_LENGTH},
229 maxlength: {@REGISTER_USERNAME_MAX_LENGTH}
e3b0902b 230 });
3e93caf9 231 });
3e93caf9 232</script>
320f4a6d 233
b3463f2a 234{include file='footer' __disableAds=true}