aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-01-13 01:17:02 -0800
committerredmatrix <git@macgirvin.com>2016-01-13 01:17:02 -0800
commit3bf9dc9f181174e2cf946d2bff75300758951d72 (patch)
tree6b5896964fff8d321f63dd04224bafd063320055 /view
parent58efd7553c9ec872a64d430efd90ff62c6b4e3e5 (diff)
downloadvolse-hubzilla-3bf9dc9f181174e2cf946d2bff75300758951d72.tar.gz
volse-hubzilla-3bf9dc9f181174e2cf946d2bff75300758951d72.tar.bz2
volse-hubzilla-3bf9dc9f181174e2cf946d2bff75300758951d72.zip
more work on auto channel creation during register
Diffstat (limited to 'view')
-rw-r--r--view/css/mod_register.css37
-rw-r--r--view/js/mod_register.js21
-rwxr-xr-xview/tpl/register.tpl34
3 files changed, 92 insertions, 0 deletions
diff --git a/view/css/mod_register.css b/view/css/mod_register.css
index 618b7ce95..890a3f76b 100644
--- a/view/css/mod_register.css
+++ b/view/css/mod_register.css
@@ -42,3 +42,40 @@ h2 {
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;
+}
diff --git a/view/js/mod_register.js b/view/js/mod_register.js
index 95bc7bbbb..8430b4655 100644
--- a/view/js/mod_register.js
+++ b/view/js/mod_register.js
@@ -26,4 +26,25 @@ $(document).ready(function() {
zFormError("#register-password2-feedback", false);
}
});
+
+
+ $("#newchannel-name").blur(function() {
+ $("#name-spinner").spin('small');
+ var zreg_name = $("#newchannel-name").val();
+ $.get("new_channel/autofill.json?f=&name=" + encodeURIComponent(zreg_name),function(data) {
+ $("#newchannel-nickname").val(data);
+ zFormError("#newchannel-name-feedback",data.error);
+ $("#name-spinner").spin(false);
+ });
+ });
+ $("#newchannel-nickname").blur(function() {
+ $("#nick-spinner").spin('small');
+ var zreg_nick = $("#newchannel-nickname").val();
+ $.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
+ $("#newchannel-nickname").val(data);
+ zFormError("#newchannel-nickname-feedback",data.error);
+ $("#nick-spinner").spin(false);
+ });
+ });
+
}); \ No newline at end of file
diff --git a/view/tpl/register.tpl b/view/tpl/register.tpl
index 005b122cf..b72e069c3 100755
--- a/view/tpl/register.tpl
+++ b/view/tpl/register.tpl
@@ -22,6 +22,30 @@
<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}}
+
+ <div id="newchannel-name-help" class="descriptive-paragraph">{{$help_name}}</div>
+
+ <label for="newchannel-name" id="label-newchannel-name" class="register-label" >{{$label_name}}</label>
+ <input type="text" 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>
+
+
+ {{/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>
@@ -37,6 +61,16 @@
<div id="register-password2-feedback" class="register-feedback"></div>
<div id="register-password2-end" class="register-field-end"></div>
+ {{if $auto_create}}
+ <div id="newchannel-nick-desc" class="descriptive-paragraph">{{$nick_desc}}</div>
+ <label for="newchannel-nickname" id="label-newchannel-nickname" class="register-label" >{{$label_nick}}</label>
+ <input type="text" name="nickname" id="newchannel-nickname" class="register-input" value="{{$nickname}}" />
+ <div id="nick-spinner"></div>
+ <div id="newchannel-nickname-feedback" class="register-feedback"></div>
+ <div id="newchannel-nickname-end" class="register-field-end"></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>