aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-02-19 13:36:48 -0800
committerredmatrix <git@macgirvin.com>2016-02-19 13:36:48 -0800
commitebc66d7008adcfb104430ae527609df5da74188d (patch)
treea8d661e86fb26dc6e376d79e1add43e920a21ae0
parent3f0eb84ecf8bfa373c98874ee8ba9ceb63ba5d1e (diff)
parentfbc6c60805d733e16a3ff7fdf60f564ce69fab64 (diff)
downloadvolse-hubzilla-ebc66d7008adcfb104430ae527609df5da74188d.tar.gz
volse-hubzilla-ebc66d7008adcfb104430ae527609df5da74188d.tar.bz2
volse-hubzilla-ebc66d7008adcfb104430ae527609df5da74188d.zip
Merge https://github.com/redmatrix/hubzilla into pending_merge
-rw-r--r--include/identity.php2
-rw-r--r--include/permissions.php8
-rw-r--r--mod/new_channel.php33
-rw-r--r--view/css/mod_new_channel.css173
-rw-r--r--view/js/mod_new_channel.js13
-rw-r--r--view/pdl/mod_new_channel.pdl1
-rw-r--r--view/theme/redbasic/css/style.css1
-rwxr-xr-xview/tpl/new_channel.tpl76
8 files changed, 68 insertions, 239 deletions
diff --git a/include/identity.php b/include/identity.php
index 717deca14..a389a613e 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -1847,4 +1847,4 @@ function get_zcard($channel,$observer_hash = '',$args = array()) {
return $o;
-} \ No newline at end of file
+}
diff --git a/include/permissions.php b/include/permissions.php
index 8c36f9744..e4cd9ddda 100644
--- a/include/permissions.php
+++ b/include/permissions.php
@@ -864,10 +864,10 @@ function get_role_perms($role) {
*/
function get_roles() {
$roles = array(
- t('Social Networking') => array('social' => t('Mostly Public'), 'social_restricted' => t('Restricted'), 'social_private' => t('Private')),
- t('Community Forum') => array('forum' => t('Mostly Public'), 'forum_restricted' => t('Restricted'), 'forum_private' => t('Private')),
- t('Feed Republish') => array('feed' => t('Mostly Public'), 'feed_restricted' => t('Restricted')),
- t('Special Purpose') => array('soapbox' => t('Celebrity/Soapbox'), 'repository' => t('Group Repository')),
+ t('Social Networking') => array('social' => t('Social - Mostly Public'), 'social_restricted' => t('Social - Restricted'), 'social_private' => t('Social - Private')),
+ t('Community Forum') => array('forum' => t('Forum - Mostly Public'), 'forum_restricted' => t('Forum - Restricted'), 'forum_private' => t('Forum - Private')),
+ t('Feed Republish') => array('feed' => t('Feed - Mostly Public'), 'feed_restricted' => t('Feed - Restricted')),
+ t('Special Purpose') => array('soapbox' => t('Special - Celebrity/Soapbox'), 'repository' => t('Special - Group Repository')),
t('Other') => array('custom' => t('Custom/Expert Mode'))
);
diff --git a/mod/new_channel.php b/mod/new_channel.php
index b22a5cacb..89a03714b 100644
--- a/mod/new_channel.php
+++ b/mod/new_channel.php
@@ -102,7 +102,6 @@ function new_channel_post(&$a) {
function new_channel_content(&$a) {
-
$acc = $a->get_account();
if((! $acc) || $acc['account_id'] != get_account_id()) {
@@ -119,29 +118,33 @@ function new_channel_content(&$a) {
if($r && (! intval($r[0]['total']))) {
$default_role = get_config('system','default_permissions_role');
}
+
+ $limit = account_service_class_fetch(get_account_id(),'total_identities');
+
+ if($r && ($limit !== false)) {
+ $channel_usage_message = sprintf( t("You have created %1$.0f of %2$.0f allowed channels."), $r[0]['total'], $limit);
+ }
+ else {
+ $channel_usage_message = '';
+ }
}
- $name = ((x($_REQUEST,'name')) ? $_REQUEST['name'] : "" );
- $nickname = ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : "" );
+ $name = array('name', t('Name or caption'), ((x($_REQUEST,'name')) ? $_REQUEST['name'] : ''), t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group"'));
+ $nickhub = '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl'));
+ $nickname = array('nickname', t('Choose a short nickname'), ((x($_REQUEST,'nickname')) ? $_REQUEST['nickname'] : ''), sprintf( t('Your nickname will be used to create an easy to remember channel address e.g. nickname%s'), $nickhub));
$privacy_role = ((x($_REQUEST,'permissions_role')) ? $_REQUEST['permissions_role'] : "" );
+ $role = array('permissions_role' , t('Channel role and privacy'), ($privacy_role) ? $privacy_role : 'social', t('Select a channel role with your privacy requirements.') . ' <a href="help/roles" target="_blank">' . t('Read more about roles') . '</a>',get_roles());
$o = replace_macros(get_markup_template('new_channel.tpl'), array(
-
- '$title' => t('Add a Channel'),
- '$desc' => t('A channel is your own collection of related web pages. A channel can be used to hold social network profiles, blogs, conversation groups and forums, celebrity pages, and much more. You may create as many channels as your service provider allows.'),
-
- '$label_name' => t('Name'),
- '$help_name' => t('Examples: "Bob Jameson", "Lisa and her Horses", "Soccer", "Aviation Group" '),
- '$label_nick' => t('Choose a short nickname'),
- '$nick_hub' => '@' . str_replace(array('http://','https://','/'), '', get_config('system','baseurl')),
- '$nick_desc' => t('Your nickname will be used to create an easily remembered channel address (like an email address) which you can share with others.'),
+ '$title' => t('Create a Channel'),
+ '$desc' => t('A channel is your identity on the grid. It can represent a person, a blog, or a forum to name a few. Channels can make connections with other channels to share information with highly detailed permissions.'),
'$label_import' => t('Or <a href="import">import an existing channel</a> from another location'),
'$name' => $name,
- '$help_role' => t('Please choose a channel type (such as social networking or community forum) and privacy requirements so we can select the best permissions for you'),
- '$role' => array('permissions_role' , t('Channel Type'), ($privacy_role) ? $privacy_role : 'social', '<a href="help/roles" target="_blank">'.t('Read more about roles').'</a>',get_roles()),
+ '$role' => $role,
'$default_role' => $default_role,
'$nickname' => $nickname,
- '$submit' => t('Create')
+ '$submit' => t('Create'),
+ '$channel_usage_message' => $channel_usage_message
));
return $o;
diff --git a/view/css/mod_new_channel.css b/view/css/mod_new_channel.css
index 397601635..fcdb3e84e 100644
--- a/view/css/mod_new_channel.css
+++ b/view/css/mod_new_channel.css
@@ -1,172 +1,3 @@
-
-h2 {
- margin-left: 15%;
- margin-top: 5%;
+.descriptive-paragraph {
+ margin-top: 10px;
}
-
-#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;
-}
-
-/**
-* Stylish Select 0.4.9 - $ plugin to replace a select drop down box with a stylable unordered list
-* http://github.com/scottdarby/Stylish-Select/
-*
-* Copyright (c) 2009 Scott Darby
-*
-* Requires: jQuery 1.3 or newer
-*
-* Dual licensed under the MIT and GPL licenses.
-*/
-
-/**
-* Hide lists on page load
----------------------------------------------------------*/
-
-.stylish-select .SSContainerDivWrapper {
- left:-9999px;
-}
-
-/*
-* Red example
----------------------------------------------------------*/
-.stylish-select .SSContainerDivWrapper {
- margin:0;
- padding:0;
- width:290px;
- position:absolute;
- top:22px;
- left:0;
- z-index:9999;
- font-size: 60%;
- line-height: 1.1;
-}
-
-.stylish-select a {
- font-weight: normal !important;
-}
-
-.stylish-select ul.newList {
- margin:0;
- padding:0;
- list-style:none;
- color:#000;
- background:#fff;
- border:1px solid #ccc;
- overflow:auto;
-}
-
-.stylish-select ul.newList * {
- margin:0;
- padding:0;
-}
-
-
-.stylish-select ul.newList a {
- color: #000;
- text-decoration:none;
- display:block;
- padding:3px 8px;
-}
-
-.stylish-select .newListSelected {
- width:285px;
- color:#000;
- height:19px;
- padding:3px 0 0 6px;
- float:left;
- background:url(select-bg.png) no-repeat;
-}
-
-.stylish-select ul.newList li a:focus {
- -moz-outline-style: none;
-}
-
-.stylish-select .selectedTxt {
- width:258px;
- overflow:hidden;
- height:18px;
- font-size: 90%;
- padding:0 23px 0 0;
-}
-
-.stylish-select .hiLite {
- background:#650101!important;
- color:#fff!important;
-}
-
-.stylish-select .newListHover {
- background:#ccc!important;
- color:#000!important;
- cursor:default;
-}
-
-.stylish-select .newListDisabled {
- opacity: 0.6;
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
- filter: alpha(opacity=60);
-}
-
-.stylish-select .newListItemDisabled {
- opacity: 0.6;
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
- filter: alpha(opacity=60);
-}
-
-.stylish-select .newListOptionDisabled {
- opacity: 0.6;
- -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)";
- filter: alpha(opacity=60);
-}
-
-.stylish-select .newListSelHover,
-.stylish-select .newListSelFocus {
- background-position:0 -22px;
- cursor:default;
-}
-
-.stylish-select .newListOptionTitle {
- font-weight:bold;
-}
-
-.stylish-select .newListOptionTitle ul {
- margin:3px 0 0;
-}
-
-.stylish-select .newListOptionTitle li {
- font-weight:normal;
-} \ No newline at end of file
diff --git a/view/js/mod_new_channel.js b/view/js/mod_new_channel.js
index c4d5408f2..58573f736 100644
--- a/view/js/mod_new_channel.js
+++ b/view/js/mod_new_channel.js
@@ -1,19 +1,20 @@
$(document).ready(function() {
// $("#id_permissions_role").sSelect();
- $("#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);
+ $("#id_nickname").val(data);
zFormError("#newchannel-name-feedback",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);
+ $("#id_nickname").val(data);
zFormError("#newchannel-nickname-feedback",data.error);
$("#nick-spinner").spin(false);
});
diff --git a/view/pdl/mod_new_channel.pdl b/view/pdl/mod_new_channel.pdl
deleted file mode 100644
index 90026f7fe..000000000
--- a/view/pdl/mod_new_channel.pdl
+++ /dev/null
@@ -1 +0,0 @@
-[template]full[/template]
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index b2255b3af..f4fa0415c 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -1544,6 +1544,7 @@ nav .dropdown-menu {
.section-content-tools-wrapper .section-content-danger-wrapper,
.section-content-wrapper .section-content-danger-wrapper {
margin-bottom: 10px;
+ border-bottom: none;
border-radius: $radiuspx;
}
diff --git a/view/tpl/new_channel.tpl b/view/tpl/new_channel.tpl
index 156b5ec2f..9383e0902 100755
--- a/view/tpl/new_channel.tpl
+++ b/view/tpl/new_channel.tpl
@@ -1,42 +1,36 @@
-<div class="generic-content-wrapper-styled">
-<h2>{{$title}}</h2>
-
-<form action="new_channel" method="post" id="newchannel-form" class="stylish-select">
-
- <div id="newchannel-desc" class="descriptive-paragraph">{{$desc}}</div>
-
- {{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="newchannel-label" >{{$label_name}}</label>
- <input type="text" name="name" id="newchannel-name" class="newchannel-input" value="{{$name}}" />
- <div id="name-spinner"></div>
- <div id="newchannel-name-feedback" class="newchannel-feedback"></div>
- <div id="newchannel-name-end" class="newchannel-field-end"></div>
-
- <div id="newchannel-name-help" class="descriptive-paragraph">{{$help_name}}</div>
-
- <label for="newchannel-nickname" id="label-newchannel-nickname" class="newchannel-label" >{{$label_nick}}</label>
- <input type="text" name="nickname" id="newchannel-nickname" class="newchannel-input" value="{{$nickname}}" />
- <div id="nick-spinner"></div>
- <div id="newchannel-nick-desc" class="descriptive-paragraph">{{$nick_hub}}</div>
- <div id="newchannel-nickname-feedback" class="newchannel-feedback"></div>
- <div id="newchannel-nickname-end" class="newchannel-field-end"></div>
-
- <div id="newchannel-nick-desc" class="descriptive-paragraph">{{$nick_desc}}</div>
-
-
- <div id="newchannel-import-link" class="descriptive-paragraph" >{{$label_import}}</div>
-
- <div id="newchannel-import-end" class="newchannel-field-end"></div>
-
- <input type="submit" name="submit" id="newchannel-submit-button" value="{{$submit}}" />
- <div id="newchannel-submit-end" class="newchannel-field-end"></div>
-
-</form>
+<div class="generic-content-wrapper">
+ <div class="section-title-wrapper">
+ <h2>{{$title}}</h2>
+ </div>
+ <div class="section-content-wrapper">
+ <div class="section-content-info-wrapper">
+ {{$desc}}
+ </div>
+ {{if $channel_usage_message}}
+ <div class="section-content-warning-wrapper">
+ {{$channel_usage_message}}
+ </div>
+ {{/if}}
+ <form action="new_channel" method="post" id="newchannel-form">
+ {{if $default_role}}
+ <input type="hidden" name="permissions_role" value="{{$default_role}}" />
+ {{else}}
+ {{include file="field_select_grouped.tpl" field=$role}}
+ {{/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>
+
+ <input type="submit" name="submit" id="newchannel-submit-button" value="{{$submit}}" />
+ <div id="newchannel-submit-end" class="clear"></div>
+
+ <div id="newchannel-import-link" class="descriptive-paragraph" >{{$label_import}}</div>
+ <div id="newchannel-import-end" class="clear"></div>
+ </form>
+ </div>
</div>