mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-25 06:22:46 +00:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
2f7d40d8db
7 changed files with 101 additions and 47 deletions
|
@ -1408,7 +1408,9 @@ class Admin extends \Zotlabs\Web\Controller {
|
|||
'$plugins' => $plugins,
|
||||
'$disabled' => t('Disabled - version incompatibility'),
|
||||
'$form_security_token' => get_form_security_token('admin_plugins'),
|
||||
'$addrepo' => t('Add Plugin Repo'),
|
||||
'$managerepos' => t('Manage Repos'),
|
||||
'$installedtitle' => t('Installed Plugin Repositories'),
|
||||
'$addnewrepotitle' => t('Install a New Plugin Repository'),
|
||||
'$expandform' => false,
|
||||
'$form' => $admin_plugins_add_repo_form,
|
||||
'$newRepoModal' => $newRepoModal,
|
||||
|
|
|
@ -87,11 +87,11 @@ class Editpost extends \Zotlabs\Web\Controller {
|
|||
'hide_location' => true,
|
||||
'mimetype' => $itm[0]['mimetype'],
|
||||
'ptyp' => $itm[0]['obj_type'],
|
||||
'body' => undo_post_tagging($itm[0]['body']),
|
||||
'body' => htmlspecialchars_decode(undo_post_tagging($itm[0]['body']),ENT_COMPAT),
|
||||
'post_id' => $post_id,
|
||||
'defloc' => $channel['channel_location'],
|
||||
'visitor' => true,
|
||||
'title' => htmlspecialchars($itm[0]['title'],ENT_COMPAT,'UTF-8'),
|
||||
'title' => htmlspecialchars_decode($itm[0]['title'],ENT_COMPAT),
|
||||
'category' => $category,
|
||||
'showacl' => false,
|
||||
'profile_uid' => $owner_uid,
|
||||
|
|
|
@ -117,11 +117,7 @@ class PermissionDescription {
|
|||
case PERMS_NETWORK: return t('Anybody in the $Projectname network');
|
||||
case PERMS_SITE: return sprintf(t('Any account on %s'), \App::get_hostname());
|
||||
case PERMS_CONTACTS: return t('Any of my connections');
|
||||
case PERMS_SPECIFIC:
|
||||
// Because we're describing the permissions of an item with an empty ACL,
|
||||
// the owner will be the only person able to see it if the permissions are
|
||||
// set to "only specified connections".
|
||||
return t('Only me (only specified contacts and me)');
|
||||
case PERMS_SPECIFIC: return t('Only connections I specifically allow');
|
||||
case PERMS_AUTHED: return t('Anybody authenticated (could include visitors from other networks)');
|
||||
case PERMS_PENDING: return t('Any connections including those who haven\'t yet been approved');
|
||||
default: return $this->fallback_description;
|
||||
|
@ -143,11 +139,7 @@ class PermissionDescription {
|
|||
case PERMS_NETWORK: return 'fa-share-alt-square'; // fa-share-alt-square is very similiar to the hubzilla logo, but we should create our own logo class to use
|
||||
case PERMS_SITE: return 'fa-sitemap';
|
||||
case PERMS_CONTACTS: return 'fa-group';
|
||||
case PERMS_SPECIFIC:
|
||||
// Because we're describing the permissions of an item with an empty ACL,
|
||||
// the owner will be the only person able to see it if the permissions are
|
||||
// set to "only specified connections".
|
||||
return 'fa-eye-slash';
|
||||
case PERMS_SPECIFIC: return 'fa-list';
|
||||
case PERMS_AUTHED: return '';
|
||||
case PERMS_PENDING: return '';
|
||||
default: return '';
|
||||
|
|
|
@ -269,6 +269,8 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti
|
|||
$tpl = get_markup_template("acl_selector.tpl");
|
||||
$o = replace_macros($tpl, array(
|
||||
'$showall' => $showall_caption,
|
||||
'$onlyme' => t('Only me'),
|
||||
'$add_others' => t('Add others'),
|
||||
'$showallOrigin' => $showall_origin,
|
||||
'$showallIcon' => $showall_icon,
|
||||
'$select_label' => t('Who can see this?'),
|
||||
|
|
|
@ -17,8 +17,10 @@ function ACL(backend_url, preset) {
|
|||
that.list_content = $("#acl-list-content");
|
||||
that.item_tpl = unescape($(".acl-list-item[rel=acl-template]").html());
|
||||
that.showall = $("#acl-showall");
|
||||
that.onlyme = $("#acl-onlyme");
|
||||
that.showlimited = $("#acl-showlimited");
|
||||
that.acl_select = $("#acl-select");
|
||||
that.showacl = $("#show-acl");
|
||||
|
||||
that.preset = preset;
|
||||
that.self = [];
|
||||
|
@ -33,17 +35,22 @@ function ACL(backend_url, preset) {
|
|||
that.acl_select.change(function(event) {
|
||||
var option = that.acl_select.val();
|
||||
|
||||
if(option == 'option1') { // public
|
||||
if(option == 'public') { // public
|
||||
that.on_showall(event);
|
||||
}
|
||||
|
||||
if(option == 'option2') { // restricted
|
||||
if(option == 'onlyme') { // limited to one self
|
||||
that.on_onlyme(event);
|
||||
}
|
||||
|
||||
if(option == 'limited') { // limited to custom selection
|
||||
that.on_showlimited(event);
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('click','.acl-button-show',that.on_button_show);
|
||||
$(document).on('click','.acl-button-hide',that.on_button_hide);
|
||||
|
||||
$("#acl-search").keypress(that.on_search);
|
||||
|
||||
/* startup! */
|
||||
|
@ -86,6 +93,21 @@ ACL.prototype.on_search = function(event) {
|
|||
that.kp_timer = setTimeout( that.search, 1000);
|
||||
};
|
||||
|
||||
ACL.prototype.on_onlyme = function(event) {
|
||||
// preventDefault() isn't called here as we want state changes from update_view() to be applied to the radiobutton
|
||||
event.stopPropagation();
|
||||
|
||||
that.allow_cid = [that.self[0]];
|
||||
that.allow_gid = [];
|
||||
that.deny_cid = [];
|
||||
that.deny_gid = [];
|
||||
|
||||
that.update_view(event.target.value);
|
||||
that.on_submit();
|
||||
|
||||
return true; // return true so that state changes from update_view() will be applied
|
||||
};
|
||||
|
||||
ACL.prototype.on_showall = function(event) {
|
||||
// preventDefault() isn't called here as we want state changes from update_view() to be applied to the radiobutton
|
||||
event.stopPropagation();
|
||||
|
@ -95,7 +117,7 @@ ACL.prototype.on_showall = function(event) {
|
|||
that.deny_cid = [];
|
||||
that.deny_gid = [];
|
||||
|
||||
that.update_view();
|
||||
that.update_view(event.target.value);
|
||||
that.on_submit();
|
||||
|
||||
return true; // return true so that state changes from update_view() will be applied
|
||||
|
@ -114,7 +136,7 @@ ACL.prototype.on_showlimited = function(event) {
|
|||
that.deny_cid = (that.preset[2] || []);
|
||||
that.deny_gid = (that.preset[3] || []);
|
||||
|
||||
that.update_view();
|
||||
that.update_view(event.target.value);
|
||||
that.on_submit();
|
||||
|
||||
return true; // return true so that state changes from update_view() will be applied
|
||||
|
@ -218,30 +240,46 @@ ACL.prototype.set_deny = function(itemid) {
|
|||
that.update_view();
|
||||
};
|
||||
|
||||
ACL.prototype.update_select = function(isPublic) {
|
||||
that.showall.prop('selected', isPublic);
|
||||
that.showlimited.prop('selected', !isPublic);
|
||||
ACL.prototype.update_select = function(preset) {
|
||||
that.showall.prop('selected', preset === 'public');
|
||||
that.onlyme.prop('selected', preset === 'onlyme');
|
||||
that.showlimited.prop('selected', preset === 'limited');
|
||||
};
|
||||
|
||||
ACL.prototype.update_view = function() {
|
||||
ACL.prototype.update_view = function(value) {
|
||||
|
||||
if (that.allow_gid.length === 0 && that.allow_cid.length === 0 && that.deny_gid.length === 0 && that.deny_cid.length === 0) {
|
||||
that.list.hide(); //hide acl-list
|
||||
that.showacl.hide(); //hide showacl button
|
||||
that.info.show(); //show acl-info
|
||||
that.update_select(true);
|
||||
that.update_select('public');
|
||||
|
||||
/* jot acl */
|
||||
$('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-lock').addClass('fa-unlock');
|
||||
$('#jot-public').show();
|
||||
$('.profile-jot-net input').attr('disabled', false);
|
||||
|
||||
} else {
|
||||
that.list.show(); //show acl-list
|
||||
that.info.hide(); //hide acl-info
|
||||
that.update_select(false);
|
||||
}
|
||||
|
||||
// if value != 'onlyme' we should fall through this one
|
||||
else if (that.allow_gid.length === 0 && that.allow_cid.length === 1 && that.allow_cid[0] === that.self[0] && that.deny_gid.length === 0 && that.deny_cid.length === 0 && value === 'onlyme') {
|
||||
that.list.hide(); //hide acl-list if
|
||||
that.showacl.show(); //show showacl button
|
||||
that.info.hide(); //show acl-info
|
||||
that.update_select('onlyme');
|
||||
|
||||
/* jot acl */
|
||||
$('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-unlock').addClass('fa-lock');
|
||||
$('.profile-jot-net input').attr('disabled', 'disabled');
|
||||
}
|
||||
|
||||
else {
|
||||
that.list.show(); //show acl-list
|
||||
that.showacl.hide(); //hide showacl button
|
||||
that.info.hide(); //hide acl-info
|
||||
that.update_select('limited');
|
||||
|
||||
/* jot acl */
|
||||
$('#jot-perms-icon, #dialog-perms-icon').removeClass('fa-unlock').addClass('fa-lock');
|
||||
$('#jot-public').hide();
|
||||
$('.profile-jot-net input').attr('disabled', 'disabled');
|
||||
|
||||
}
|
||||
|
|
|
@ -14,10 +14,15 @@
|
|||
{{/if}}
|
||||
<label for="acl-select">{{$select_label}}</label>
|
||||
<select id="acl-select" name="optionsRadios" class="form-control form-group">
|
||||
<option id="acl-showall" value="option1" selected>{{$showall}}</option>
|
||||
<option id="acl-showlimited" value="option2">{{$showlimited}}</option>
|
||||
<option id="acl-showall" value="public" selected>{{$showall}}</option>
|
||||
<option id="acl-onlyme" value="onlyme">{{$onlyme}}</option>
|
||||
<option id="acl-showlimited" value="limited">{{$showlimited}}</option>
|
||||
</select>
|
||||
|
||||
<div id="show-acl" class="form-group">
|
||||
<button type="button" class="btn btn-success form-group" onclick="openClose('acl-list'); closeOpen('show-acl');"><i class="fa fa-user-plus"></i> {{$add_others}}</button>
|
||||
</div>
|
||||
|
||||
{{if $showallOrigin}}
|
||||
<div id="acl-info" class="form-group">
|
||||
<i class="fa fa-info-circle"></i> {{$showallOrigin}}
|
||||
|
|
|
@ -1,33 +1,48 @@
|
|||
<div class="generic-content-wrapper">
|
||||
<div class="section-title-wrapper">
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-success btn-xs" onclick="openClose('form');">{{$addrepo}}</button>
|
||||
<button class="btn btn-success btn-xs" onclick="openClose('form');">{{$managerepos}}</button>
|
||||
</div>
|
||||
<h2 id="title">{{$title}} - {{$page}}</h2>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div id="form" class="section-content-tools-wrapper"{{if !$expandform}} style="display:none;"{{/if}}>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div class="section-title-wrapper" style="margin-top: 20px;">
|
||||
<h2>{{$installedtitle}}</h2>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="table-responsive section-content-tools-wrapper">
|
||||
<table class="table table-responsive table-striped table-hover">
|
||||
{{foreach $addonrepos as $repo}}
|
||||
<tr>
|
||||
<td style="width: 70%;">
|
||||
<span class="pull-left">{{$repo.name}}</span>
|
||||
</td>
|
||||
<td style="width: 15%;">
|
||||
<button class="btn btn-xs btn-primary pull-right" style="margin-left: 10px; margin-right: 10px;" onclick="updateAddonRepo('{{$repo.name}}'); return false;"><i class='fa fa-download'></i> {{$repoUpdateButton}}</button>
|
||||
</td>
|
||||
<td style="width: 15%;">
|
||||
<button class="btn btn-xs btn-danger pull-right" style="margin-left: 10px; margin-right: 0px;" onclick="removeAddonRepo('{{$repo.name}}'); return false;"><i class='fa fa-trash-o'></i> {{$repoRemoveButton}}</button>
|
||||
</td>
|
||||
<div class="clear"></div>
|
||||
</td></tr>
|
||||
{{/foreach}}
|
||||
</table>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="section-title-wrapper">
|
||||
<h2>{{$addnewrepotitle}}</h2>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
{{$form}}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div id="chat-rotator-wrapper" class="center-block">
|
||||
<div id="chat-rotator"></div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
<div class="section-content-info-wrapper">
|
||||
<h3>Installed Plugin Repositories</h3>
|
||||
{{foreach $addonrepos as $repo}}
|
||||
<!-- <div class="section-content-tools-wrapper"> -->
|
||||
<div style="margin-left: 30%; margin-right: 30%;">
|
||||
<span class="pull-left">{{$repo.name}}</span>
|
||||
<!--<button class="btn btn-xs btn-primary pull-right" onclick="switchAddonRepoBranch('{{$repo.name}}'); return false;">{{$repoBranchButton}}</button>-->
|
||||
<button class="btn btn-xs btn-danger pull-right" style="margin-left: 10px; margin-right: 0px;" onclick="removeAddonRepo('{{$repo.name}}'); return false;"><i class='fa fa-trash-o'></i> {{$repoRemoveButton}}</button>
|
||||
<button class="btn btn-xs btn-primary pull-right" style="margin-left: 10px; margin-right: 10px;" onclick="updateAddonRepo('{{$repo.name}}'); return false;"><i class='fa fa-download'></i> {{$repoUpdateButton}}</button>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
<div class="clear"></div>
|
||||
{{/foreach}}
|
||||
</div>
|
||||
<div class="section-content-wrapper-np">
|
||||
{{foreach $plugins as $p}}
|
||||
<div class="section-content-tools-wrapper" id="pluginslist">
|
||||
|
|
Loading…
Reference in a new issue