aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-02-22 13:04:48 +0100
committerMario Vavti <mario@mariovavti.com>2016-02-22 13:04:48 +0100
commitdd6e3d873d2ff04cb2549530fa838ad58b06cdbc (patch)
tree0264f166d307c3b5422f4666f4f124e1ff59140c /view
parentf9b092c6194fe2a2812cb0ae687e19b1f5680c98 (diff)
downloadvolse-hubzilla-dd6e3d873d2ff04cb2549530fa838ad58b06cdbc.tar.gz
volse-hubzilla-dd6e3d873d2ff04cb2549530fa838ad58b06cdbc.tar.bz2
volse-hubzilla-dd6e3d873d2ff04cb2549530fa838ad58b06cdbc.zip
some work on mod/register
Diffstat (limited to 'view')
-rw-r--r--view/css/mod_register.css86
-rw-r--r--view/js/mod_new_channel.js10
-rw-r--r--view/js/mod_register.js58
-rw-r--r--view/pdl/mod_register.pdl1
-rwxr-xr-xview/tpl/field_password.tpl2
-rwxr-xr-xview/tpl/new_channel.tpl2
-rwxr-xr-xview/tpl/register.tpl139
7 files changed, 98 insertions, 200 deletions
diff --git a/view/css/mod_register.css b/view/css/mod_register.css
deleted file mode 100644
index 68ccac131..000000000
--- a/view/css/mod_register.css
+++ /dev/null
@@ -1,86 +0,0 @@
-
-h2 {
- margin: 20px 0 20px 5%;
-}
-
-.generic-content-wrapper-styled {
- margin-left: auto;
- margin-right: auto;
- max-width: 820px;
- font-size: 1.1em;
-}
-
-
-#register-desc, #register-invite-desc, #register-text, #register-sites {
- font-weight: bold;
- margin-bottom: 15px;
- padding: 8px;
- border: 1px solid #ccc;
-}
-
-@media (min-width: 560px) {
-.register-label, .register-input {
- float: left;
- width: 50%;
-}
-}
-
-@media (max-width: 559px) {
-.register-label, .register-input {
- float: left;
- max-width: 400px;
-}
-}
-
-.register-feedback {
- float: left;
- margin-left: 45px;
-}
-
-.register-field-end {
- clear: both;
- margin-bottom: 20px;
-}
-
-#newchannel-form {
- font-size: 1.4em;
- margin-left: 15%;
- margin-top: 20px;
- width: 50%;
-}
-
-#newchannel-form .descriptive-paragraph {
- color: #888;
- margin-left: 20px;
- margin-bottom: 25px;
-}
-
-.newchannel-label {
- float: left;
- width: 275px;
-}
-
-.newchannel-role-morehelp {
- float: left;
- width: 32px;
-}
-.newchannel-input {
- float: left;
- width: 275px;
- padding: 5px;
-}
-
-.newchannel-feedback {
- float: left;
- margin-left: 5px;
-}
-
-.newchannel-field-end {
- clear: both;
- margin-bottom: 20px;
-}
-
-.descriptive-paragraph {
- margin-left: 20px;
- margin-bottom: 25px;
-}
diff --git a/view/js/mod_new_channel.js b/view/js/mod_new_channel.js
index 58573f736..17b354a4b 100644
--- a/view/js/mod_new_channel.js
+++ b/view/js/mod_new_channel.js
@@ -5,7 +5,10 @@
var zreg_name = $("#id_name").val();
$.get("new_channel/autofill.json?f=&name=" + encodeURIComponent(zreg_name),function(data) {
$("#id_nickname").val(data);
- zFormError("#newchannel-name-feedback",data.error);
+ if(data.error) {
+ $("#help_name").html("");
+ zFormError("#help_name",data.error);
+ }
$("#name-spinner").spin(false);
});
});
@@ -15,7 +18,10 @@
var zreg_nick = $("#id_nickname").val();
$.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
$("#id_nickname").val(data);
- zFormError("#newchannel-nickname-feedback",data.error);
+ if(data.error) {
+ $("#help_nickname").html("");
+ zFormError("#help_nickname",data.error);
+ }
$("#nick-spinner").spin(false);
});
});
diff --git a/view/js/mod_register.js b/view/js/mod_register.js
index 8430b4655..f1f3e7f71 100644
--- a/view/js/mod_register.js
+++ b/view/js/mod_register.js
@@ -1,50 +1,56 @@
$(document).ready(function() {
- $("#register-email").blur(function() {
- var zreg_email = $("#register-email").val();
+ $("#id_email").blur(function() {
+ var zreg_email = $("#id_email").val();
$.get("register/email_check.json?f=&email=" + encodeURIComponent(zreg_email), function(data) {
- $("#register-email-feedback").html(data.message);
- zFormError("#register-email-feedback",data.error);
+ $("#help_email").html(data.message);
+ zFormError("#help_email",data.error);
});
});
- $("#register-password").blur(function() {
- if(($("#register-password").val()).length < 6 ) {
- $("#register-password-feedback").html(aStr.pwshort);
- zFormError("#register-password-feedback", true);
+ $("#id_password").blur(function() {
+ if(($("#id_password").val()).length < 6 ) {
+ $("#help_password").html(aStr.pwshort);
+ zFormError("#help_password", true);
}
else {
- $("#register-password-feedback").html("");
- zFormError("#register-password-feedback", false);
+ $("#help_password").html("");
+ zFormError("#help_password", false);
}
});
- $("#register-password2").blur(function() {
- if($("#register-password").val() != $("#register-password2").val()) {
- $("#register-password2-feedback").html(aStr.pwnomatch);
- zFormError("#register-password2-feedback", true);
+ $("#id_password2").blur(function() {
+ if($("#id_password").val() != $("#id_password2").val()) {
+ $("#help_password2").html(aStr.pwnomatch);
+ zFormError("#help_password2", true);
}
else {
- $("#register-password2-feedback").html("");
- zFormError("#register-password2-feedback", false);
+ $("#help_password2").html("");
+ zFormError("#help_password2", false);
}
});
-
- $("#newchannel-name").blur(function() {
+ $("#id_name").blur(function() {
$("#name-spinner").spin('small');
- var zreg_name = $("#newchannel-name").val();
+ var zreg_name = $("#id_name").val();
$.get("new_channel/autofill.json?f=&name=" + encodeURIComponent(zreg_name),function(data) {
- $("#newchannel-nickname").val(data);
- zFormError("#newchannel-name-feedback",data.error);
+ $("#id_nickname").val(data);
+ if(data.error) {
+ $("#help_name").html("");
+ zFormError("#help_name",data.error);
+ }
$("#name-spinner").spin(false);
});
});
- $("#newchannel-nickname").blur(function() {
+
+ $("#id_nickname").blur(function() {
$("#nick-spinner").spin('small');
- var zreg_nick = $("#newchannel-nickname").val();
+ var zreg_nick = $("#id_nickname").val();
$.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
- $("#newchannel-nickname").val(data);
- zFormError("#newchannel-nickname-feedback",data.error);
+ $("#id_nickname").val(data);
+ if(data.error) {
+ $("#help_nickname").html("");
+ zFormError("#help_nickname",data.error);
+ }
$("#nick-spinner").spin(false);
});
});
-}); \ No newline at end of file
+});
diff --git a/view/pdl/mod_register.pdl b/view/pdl/mod_register.pdl
deleted file mode 100644
index 90026f7fe..000000000
--- a/view/pdl/mod_register.pdl
+++ /dev/null
@@ -1 +0,0 @@
-[template]full[/template]
diff --git a/view/tpl/field_password.tpl b/view/tpl/field_password.tpl
index d19bc9414..1643fa855 100755
--- a/view/tpl/field_password.tpl
+++ b/view/tpl/field_password.tpl
@@ -1,5 +1,5 @@
<div class='form-group field password'>
<label for='id_{{$field.0}}'>{{$field.1}}</label>
<input class="form-control" type='password' name='{{$field.0}}' id='id_{{$field.0}}' value="{{$field.2}}"{{if $field.5}} {{$field.5}}{{/if}}>{{if $field.4}} <span class="required">{{$field.4}}</span> {{/if}}
- <span class='help-block'>{{$field.3}}</span>
+ <span id="help_{{$field.0}}" class="help-block">{{$field.3}}</span>
</div>
diff --git a/view/tpl/new_channel.tpl b/view/tpl/new_channel.tpl
index f5e97ff27..cc1983ac4 100755
--- a/view/tpl/new_channel.tpl
+++ b/view/tpl/new_channel.tpl
@@ -19,11 +19,9 @@
{{/if}}
{{include file="field_input.tpl" field=$name}}
- <div id="newchannel-name-feedback" class="newchannel-feedback"></div>
<div id="name-spinner"></div>
{{include file="field_input.tpl" field=$nickname}}
- <div id="newchannel-nickname-feedback" class="newchannel-feedback"></div>
<div id="nick-spinner"></div>
<button class="btn btn-primary" type="submit" name="submit" id="newchannel-submit-button" value="{{$submit}}">{{$submit}}</button>
diff --git a/view/tpl/register.tpl b/view/tpl/register.tpl
index 997b4489a..4a827ca16 100755
--- a/view/tpl/register.tpl
+++ b/view/tpl/register.tpl
@@ -1,83 +1,58 @@
-<div class="generic-content-wrapper-styled">
-<h2>{{$title}}</h2>
-
-<form action="register" method="post" id="register-form">
-
-
-
-{{if $reg_is}}
-<div id="register-desc" class="descriptive-paragraph">{{$reg_is}}</div>
-{{/if}}
-{{if $registertext}}<div id="register-text" class="descriptive-paragraph">{{$registertext}}</div>
-{{/if}}
-{{if $other_sites}}<div id="register-sites" class="descriptive-paragraph">{{$other_sites}}</div>
-{{/if}}
-
-{{if $invitations}}
- <p id="register-invite-desc">{{$invite_desc}}</p>
-
- <label for="register-invite" id="label-register-invite" class="register-label">{{$label_invite}}</label>
- <input type="text" maxlength="72" size="32" name="invite_code" id="register-invite" class="register-input" value="{{$invite_code}}" />
- <div id="register-invite-feedback" class="register-feedback"></div>
- <div id="register-invite-end" class="register-field-end"></div>
-{{/if}}
-
- {{if $auto_create}}
-
- {{if $default_role}}
- <input type="hidden" name="permissions_role" value="{{$default_role}}" />
- {{else}}
- <div id="newchannel-role-help" class="descriptive-paragraph">{{$help_role}}</div>
- {{include file="field_select_grouped.tpl" field=$role}}
- <div id="newchannel-role-end" class="newchannel-field-end"></div>
- {{/if}}
- <label for="newchannel-name" id="label-newchannel-name" class="register-label" >{{$label_name}}</label>
- <input type="text" maxlength="72" size="32" name="name" id="newchannel-name" class="register-input" value="{{$name}}" />
- <div id="name-spinner"></div>
- <div id="newchannel-name-feedback" class="register-feedback"></div>
- <div id="newchannel-name-end" class="register-field-end"></div>
- <div id="newchannel-name-help" class="descriptive-paragraph">{{$help_name}}</div>
-
-
- {{/if}}
-
- <label for="register-email" id="label-register-email" class="register-label" >{{$label_email}}</label>
- <input type="text" maxlength="72" size="32" name="email" id="register-email" class="register-input" value="{{$email}}" />
- <div id="register-email-feedback" class="register-feedback"></div>
- <div id="register-email-end" class="register-field-end"></div>
-
- <label for="register-password" id="label-register-password" class="register-label" >{{$label_pass1}}</label>
- <input type="password" maxlength="72" size="32" name="password" id="register-password" class="register-input" value="{{$pass1}}" />
- <div id="register-password-feedback" class="register-feedback"></div>
- <div id="register-password-end" class="register-field-end"></div>
-
- <label for="register-password2" id="label-register-password2" class="register-label" >{{$label_pass2}}</label>
- <input type="password" maxlength="72" size="32" name="password2" id="register-password2" class="register-input" value="{{$pass2}}" />
- <div id="register-password2-feedback" class="register-feedback"></div>
- <div id="register-password2-end" class="register-field-end"></div>
-
- {{if $auto_create}}
- <label for="newchannel-nickname" id="label-newchannel-nickname" class="register-label" >{{$label_nick}}</label>
- <input type="text" maxlength="72" size="32" name="nickname" id="newchannel-nickname" class="register-input" value="{{$nickname}}" />
- <div id="nick-spinner"></div>
- <div id="newchannel-nick-desc" style="text-align: right;">{{$nick_hub}}</div>
- <div id="newchannel-nickname-feedback" class="register-feedback"></div>
- <div id="newchannel-nickname-end" class="register-field-end"></div>
- <div id="newchannel-nick-desc" class="descriptive-paragraph">{{$nick_desc}}</div>
-
- {{/if}}
-
- {{if $enable_tos}}
- <input type="checkbox" name="tos" id="register-tos" value="1" />
- <label for="register-tos" id="label-register-tos">{{$label_tos}}</label>
- <div id="register-tos-feedback" class="register-feedback"></div>
- <div id="register-tos-end" class="register-field-end"></div>
- {{else}}
- <input type="hidden" name="tos" value="1" />
- {{/if}}
-
- <input type="submit" name="submit" class="btn btn-default" id="register-submit-button" value="{{$submit}}" />
- <div id="register-submit-end" class="register-field-end"></div>
-
-</form>
+<div class="generic-content-wrapper">
+ <div class="section-title-wrapper">
+ <h2>{{$title}}</h2>
+ </div>
+ <div class="section-content-wrapper">
+ <form action="register" method="post" id="register-form">
+ {{if $reg_is}}
+ <div class="section-content-warning-wrapper">
+ <div id="register-desc" class="descriptive-paragraph">{{$reg_is}}</div>
+ <div id="register-sites" class="descriptive-paragraph">{{$other_sites}}</div>
+ </div>
+ {{/if}}
+
+ {{if $registertext}}
+ <div id="register-text" class="descriptive-paragraph">{{$registertext}}</div>
+ {{/if}}
+
+ {{if $invitations}}
+ <div class="section-content-info-wrapper">
+ <div id="register-invite-desc" class="descriptive-paragraph">{{$invite_desc}}</div>
+ </div>
+ {{include file="field_input.tpl" field=$invite_code}}
+ {{/if}}
+
+ {{include file="field_input.tpl" field=$email}}
+
+ {{include file="field_password.tpl" field=$pass1}}
+
+ {{include file="field_password.tpl" field=$pass2}}
+
+ {{if $auto_create}}
+ {{if $default_role}}
+ <input type="hidden" name="permissions_role" value="{{$default_role}}" />
+ {{else}}
+ <div class="section-content-info-wrapper">
+ {{$help_role}}
+ </div>
+ {{include file="field_select_grouped.tpl" field=$role}}
+ {{/if}}
+
+ {{include file="field_input.tpl" field=$name}}
+ <div id="name-spinner"></div>
+
+ {{include file="field_input.tpl" field=$nickname}}
+ <div id="nick-spinner"></div>
+ {{/if}}
+
+ {{if $enable_tos}}
+ {{include file="field_checkbox.tpl" field=$tos}}
+ {{else}}
+ <input type="hidden" name="tos" value="1" />
+ {{/if}}
+
+ <button class="btn btn-primary" type="submit" name="submit" id="newchannel-submit-button" value="{{$submit}}">{{$submit}}</button>
+ <div id="register-submit-end" class="register-field-end"></div>
+ </form>
+ </div>
</div>