Updated registration form.
This commit is contained in:
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"subject": "Thank you for contacting us",
|
"subject": "Thank you for contacting us",
|
||||||
|
"forms": {
|
||||||
|
"registration": {
|
||||||
|
"application_description": "Present yourself in a few lines, otherwise your application is likely to be rejected."
|
||||||
|
}
|
||||||
|
},
|
||||||
"recaptcha": {
|
"recaptcha": {
|
||||||
"site_key":"6Lex9RMTAAAAAKleC4x6TaRlFcpLbEWgH_U7MSiD",
|
"site_key":"6Lex9RMTAAAAAKleC4x6TaRlFcpLbEWgH_U7MSiD",
|
||||||
"secret_key":"6Lex9RMTAAAAAAkBczvX5DUiyg_xoM_EthVVgRRx"
|
"secret_key":"6Lex9RMTAAAAAAkBczvX5DUiyg_xoM_EthVVgRRx"
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
<div>
|
<div>
|
||||||
<form action="{$site_url/}account/roc-register" method="post">
|
<form action="{$site_url/}account/roc-register" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Registration</legend>
|
<legend>Registration</legend>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" id="name" name="name" value="{$name/}" required autofocus />
|
<input type="text" id="name" name="name" value="{$name/}" required autofocus />
|
||||||
<label for="name">Name</label>
|
<label for="name">Name</label>
|
||||||
{if isset="$error_name"}
|
{if isset="$error_name"}
|
||||||
<span><i>{$error_name/}</i></span> <br>
|
<span><i>{$error_name/}</i></span> <br>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="password" id="password" name="password" value="" required/>
|
<input type="password" id="password" name="password" value="" required/>
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
{if isset="$error_email"}
|
{if isset="$error_email"}
|
||||||
<span><i>{$error_email/}</i></span> <br>
|
<span><i>{$error_email/}</i></span> <br/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<textarea rows="4" cols="50" name="personal_information" id="personal_information" required>
|
<textarea rows="4" cols="50" name="personal_information" id="personal_information" required>{$personal_information/}</textarea>
|
||||||
{$personal_information/}
|
<label for="personal_information">Tell us why you want to register an account</label>
|
||||||
</textarea>
|
{if isset="$error_application"}
|
||||||
<label for="personal_information">Tell us why you want to register an account</label>
|
<span><i>{$error_application/}</i></span><br/>
|
||||||
{if isset="$error_application"}
|
{/if}
|
||||||
<span><i>{$error_application/}</i></span> <br>
|
{if isset="$application_description"}
|
||||||
{/if}
|
<br/>
|
||||||
</div>
|
<p class="description">{$application_description/}</p>
|
||||||
{unless isempty="$recaptcha_site_key"}
|
{/if}
|
||||||
<div class="g-recaptcha" data-sitekey="{$recaptcha_site_key/}"></div>
|
</div>
|
||||||
<br/>
|
{unless isempty="$recaptcha_site_key"}<div class="g-recaptcha" data-sitekey="{$recaptcha_site_key/}"></div><br/>{/unless}
|
||||||
{/unless}
|
<button type="submit">Register</button>
|
||||||
<button type="submit">Register</button>
|
</fieldset>
|
||||||
</fieldset>
|
</form>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -831,7 +831,7 @@ feature -- Handler
|
|||||||
|
|
||||||
block_list: ITERABLE [like {CMS_BLOCK}.name]
|
block_list: ITERABLE [like {CMS_BLOCK}.name]
|
||||||
do
|
do
|
||||||
Result := <<"register", "reactivate", "new_password", "reset_password", "registration">>
|
Result := <<"register", "reactivate", "new_password", "reset_password">>
|
||||||
end
|
end
|
||||||
|
|
||||||
get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
get_block_view (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
||||||
@@ -847,8 +847,6 @@ feature -- Handler
|
|||||||
get_block_view_new_password (a_block_id, a_response)
|
get_block_view_new_password (a_block_id, a_response)
|
||||||
elseif a_block_id.is_case_insensitive_equal_general ("reset_password") and then loc.starts_with ("account/reset-password") then
|
elseif a_block_id.is_case_insensitive_equal_general ("reset_password") and then loc.starts_with ("account/reset-password") then
|
||||||
get_block_view_reset_password (a_block_id, a_response)
|
get_block_view_reset_password (a_block_id, a_response)
|
||||||
elseif a_block_id.is_case_insensitive_equal_general ("registration") and then loc.starts_with ("admin/pending-registrations") then
|
|
||||||
get_block_view_registration (a_block_id, a_response)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -947,8 +945,19 @@ feature {NONE} -- Block views
|
|||||||
get_block_view_register (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
get_block_view_register (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
||||||
do
|
do
|
||||||
if a_response.has_permission ("account register") then
|
if a_response.has_permission ("account register") then
|
||||||
if a_response.request.is_get_request_method then
|
if
|
||||||
|
a_response.request.is_get_request_method
|
||||||
|
or else (
|
||||||
|
a_response.values.has ("error_name")
|
||||||
|
or else a_response.values.has ("error_email")
|
||||||
|
)
|
||||||
|
then
|
||||||
if attached template_block (a_block_id, a_response) as l_tpl_block then
|
if attached template_block (a_block_id, a_response) as l_tpl_block then
|
||||||
|
-- l_tpl_block.set_value (a_response.values.item ("error_name"), "error_name")
|
||||||
|
-- l_tpl_block.set_value (a_response.values.item ("error_email"), "error_email")
|
||||||
|
-- l_tpl_block.set_value (a_response.values.item ("email"), "email")
|
||||||
|
-- l_tpl_block.set_value (a_response.values.item ("name"), "name")
|
||||||
|
l_tpl_block.set_value (form_registration_application_description (a_response.api), "application_description")
|
||||||
if attached recaptcha_site_key (a_response.api) as l_recaptcha_site_key then
|
if attached recaptcha_site_key (a_response.api) as l_recaptcha_site_key then
|
||||||
l_tpl_block.set_value (l_recaptcha_site_key, "recaptcha_site_key")
|
l_tpl_block.set_value (l_recaptcha_site_key, "recaptcha_site_key")
|
||||||
end
|
end
|
||||||
@@ -959,28 +968,11 @@ feature {NONE} -- Block views
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif a_response.request.is_post_request_method then
|
elseif a_response.request.is_post_request_method then
|
||||||
if a_response.values.has ("error_name") or else a_response.values.has ("error_email") then
|
if attached template_block ("post_register", a_response) as l_tpl_block then
|
||||||
if attached template_block (a_block_id, a_response) as l_tpl_block then
|
a_response.add_block (l_tpl_block, "content")
|
||||||
-- l_tpl_block.set_value (a_response.values.item ("error_name"), "error_name")
|
|
||||||
-- l_tpl_block.set_value (a_response.values.item ("error_email"), "error_email")
|
|
||||||
-- l_tpl_block.set_value (a_response.values.item ("email"), "email")
|
|
||||||
-- l_tpl_block.set_value (a_response.values.item ("name"), "name")
|
|
||||||
if attached recaptcha_site_key (a_response.api) as l_recaptcha_site_key then
|
|
||||||
l_tpl_block.set_value (l_recaptcha_site_key, "recaptcha_site_key")
|
|
||||||
end
|
|
||||||
a_response.add_block (l_tpl_block, "content")
|
|
||||||
else
|
|
||||||
debug ("cms")
|
|
||||||
a_response.add_warning_message ("Error with block [" + a_block_id + "]")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
if attached template_block ("post_register", a_response) as l_tpl_block then
|
debug ("cms")
|
||||||
a_response.add_block (l_tpl_block, "content")
|
a_response.add_warning_message ("Error with block [" + a_block_id + "]")
|
||||||
else
|
|
||||||
debug ("cms")
|
|
||||||
a_response.add_warning_message ("Error with block [" + a_block_id + "]")
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1092,11 +1084,19 @@ feature {NONE} -- Block views
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
get_block_view_registration (a_block_id: READABLE_STRING_8; a_response: CMS_RESPONSE)
|
feature -- Access: configuration
|
||||||
do
|
|
||||||
end
|
|
||||||
|
|
||||||
feature -- Recaptcha
|
form_registration_application_description (api: CMS_API): detachable READABLE_STRING_8
|
||||||
|
-- Get recaptcha security key.
|
||||||
|
local
|
||||||
|
utf: UTF_CONVERTER
|
||||||
|
do
|
||||||
|
if attached api.module_configuration (Current, Void) as cfg then
|
||||||
|
if attached cfg.text_item ("forms.registration.application_description") as l_desc and then not l_desc.is_whitespace then
|
||||||
|
Result := utf.utf_32_string_to_utf_8_string_8 (l_desc)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
recaptcha_secret_key (api: CMS_API): detachable READABLE_STRING_8
|
recaptcha_secret_key (api: CMS_API): detachable READABLE_STRING_8
|
||||||
-- Get recaptcha security key.
|
-- Get recaptcha security key.
|
||||||
@@ -1129,6 +1129,7 @@ feature -- Response Alter
|
|||||||
a_response.add_javascript_url ("https://www.google.com/recaptcha/api.js")
|
a_response.add_javascript_url ("https://www.google.com/recaptcha/api.js")
|
||||||
a_response.add_style (a_response.url ("/module/" + name + "/files/css/auth.css", Void), Void)
|
a_response.add_style (a_response.url ("/module/" + name + "/files/css/auth.css", Void), Void)
|
||||||
end
|
end
|
||||||
|
|
||||||
feature {NONE} -- Implementation
|
feature {NONE} -- Implementation
|
||||||
|
|
||||||
is_captcha_verified (a_secret, a_response: READABLE_STRING_8): BOOLEAN
|
is_captcha_verified (a_secret, a_response: READABLE_STRING_8): BOOLEAN
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"subject": "Thank you for contacting us",
|
"subject": "Thank you for contacting us",
|
||||||
|
"forms": {
|
||||||
|
"registration": {
|
||||||
|
"application_description": "Present yourself in a few lines, otherwise your application is likely to be rejected."
|
||||||
|
}
|
||||||
|
},
|
||||||
"recaptcha": {
|
"recaptcha": {
|
||||||
"site_key":"6Lex9RMTAAAAAKleC4x6TaRlFcpLbEWgH_U7MSiD",
|
"site_key":"6Lex9RMTAAAAAKleC4x6TaRlFcpLbEWgH_U7MSiD",
|
||||||
"secret_key":"6Lex9RMTAAAAAAkBczvX5DUiyg_xoM_EthVVgRRx"
|
"secret_key":"6Lex9RMTAAAAAAkBczvX5DUiyg_xoM_EthVVgRRx"
|
||||||
|
|||||||
@@ -1,39 +1,38 @@
|
|||||||
<div>
|
<div>
|
||||||
<form action="{$site_url/}account/roc-register" method="post">
|
<form action="{$site_url/}account/roc-register" method="post">
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>Registration</legend>
|
<legend>Registration</legend>
|
||||||
<div>
|
<div>
|
||||||
<input type="text" id="name" name="name" value="{$name/}" required autofocus />
|
<input type="text" id="name" name="name" value="{$name/}" required autofocus />
|
||||||
<label for="name">Name</label>
|
<label for="name">Name</label>
|
||||||
{if isset="$error_name"}
|
{if isset="$error_name"}
|
||||||
<span><i>{$error_name/}</i></span> <br>
|
<span><i>{$error_name/}</i></span> <br>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="password" id="password" name="password" value="" required/>
|
<input type="password" id="password" name="password" value="" required/>
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input type="email" id="email" name="email" value="{$email/}" required/>
|
<input type="email" id="email" name="email" value="{$email/}" required/>
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
{if isset="$error_email"}
|
{if isset="$error_email"}
|
||||||
<span><i>{$error_email/}</i></span> <br>
|
<span><i>{$error_email/}</i></span> <br/>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<textarea rows="4" cols="50" name="personal_information" id="personal_information" required>
|
<textarea rows="4" cols="50" name="personal_information" id="personal_information" required>{$personal_information/}</textarea>
|
||||||
{$personal_information/}
|
<label for="personal_information">Tell us why you want to register an account</label>
|
||||||
</textarea>
|
{if isset="$error_application"}
|
||||||
<label for="personal_information">Tell us why you want to register an account</label>
|
<span><i>{$error_application/}</i></span><br/>
|
||||||
{if isset="$error_application"}
|
{/if}
|
||||||
<span><i>{$error_application/}</i></span> <br>
|
{if isset="$application_description"}
|
||||||
{/if}
|
<br/>
|
||||||
</div>
|
<p class="description">{$application_description/}</p>
|
||||||
{unless isempty="$recaptcha_site_key"}
|
{/if}
|
||||||
<div class="g-recaptcha" data-sitekey="{$recaptcha_site_key/}"></div>
|
</div>
|
||||||
<br/>
|
{unless isempty="$recaptcha_site_key"}<div class="g-recaptcha" data-sitekey="{$recaptcha_site_key/}"></div><br/>{/unless}
|
||||||
{/unless}
|
<button type="submit">Register</button>
|
||||||
<button type="submit">Register</button>
|
</fieldset>
|
||||||
</fieldset>
|
</form>
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user