aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-16 10:32:07 +0000
committerMario <mario@mariovavti.com>2020-10-16 10:32:07 +0000
commitb6ca9b6020e2eae0b5389148ce45bc2f7a81f999 (patch)
tree936fdce925cf9161218b24c11c0844b2c2a36ad8 /view
parent9c6446edbec6d8c4b275008de1b311d96adb329c (diff)
downloadvolse-hubzilla-b6ca9b6020e2eae0b5389148ce45bc2f7a81f999.tar.gz
volse-hubzilla-b6ca9b6020e2eae0b5389148ce45bc2f7a81f999.tar.bz2
volse-hubzilla-b6ca9b6020e2eae0b5389148ce45bc2f7a81f999.zip
make acl selector work correctly if we provide a cid in mod network
Diffstat (limited to 'view')
-rw-r--r--view/js/acl.js26
-rwxr-xr-xview/tpl/jot.tpl2
2 files changed, 22 insertions, 6 deletions
diff --git a/view/js/acl.js b/view/js/acl.js
index 4151331fb..4597184ea 100644
--- a/view/js/acl.js
+++ b/view/js/acl.js
@@ -12,10 +12,12 @@ function ACL(backend_url) {
that.deny_cid = [];
that.deny_gid = [];
- that.group_uids = [];
- that.group_ids = [];
- that.contact_uids = [];
- that.contact_ids = [];
+ that.group_uids = {};
+ that.group_ids = {};
+ that.contact_uids = {};
+ that.contact_ids = {};
+
+ that.bang = '';
that.selected_id = '';
@@ -81,6 +83,8 @@ ACL.prototype.get_form_data = function(event) {
that.deny_cid = (that.form_id.data('deny_cid') || []);
that.deny_gid = (that.form_id.data('deny_gid') || []);
+ that.bang = (that.form_id.data('bang') || '');
+
that.update_view();
that.on_submit();
@@ -167,6 +171,7 @@ ACL.prototype.on_showgroup = function(event) {
that.allow_gid = [xid];
that.deny_cid = [];
that.deny_gid = [];
+
}
else {
that.allow_cid = [cid];
@@ -326,10 +331,16 @@ ACL.prototype.update_view = function(value) {
$('.profile-jot-net input').attr('disabled', 'disabled');
}
else if (that.allow_gid.length === 0 && that.allow_cid.length === 1 && that.deny_gid.length === 0 && that.deny_cid.length === 0 && value !== 'custom') {
+
+ if(that.bang && that.bang !== that.allow_cid[0]) {
+ that.update_view('custom');
+ return;
+ }
+
that.list.hide(); //hide acl-list
that.info.hide(); //show acl-info
that.selected_id = that.contact_ids[that.allow_cid[0]];
- that.update_select(that.selected_id);
+ that.update_select('\\^' + that.selected_id);
/* jot acl */
$('#jot-perms-icon, #dialog-perms-icon, #' + that.form_id[0].id + ' .jot-perms-icon').removeClass('fa-unlock').addClass('fa-lock');
@@ -338,6 +349,7 @@ ACL.prototype.update_view = function(value) {
}
else {
+
that.list.show(); //show acl-list
datasrc2src('#acl-list-content .list-group-item img[data-src]');
that.info.hide(); //hide acl-info
@@ -459,9 +471,13 @@ ACL.prototype.populate = function(data) {
that.group_uids[this.xid] = this.uids;
that.group_ids[this.xid] = this.id;
}
+ else {
+ that.contact_ids[this.xid] = this.id;
+ }
if (this.self === 'abook-self') {
that.self[0] = this.xid;
}
+
that.list_content.append(html);
});
};
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index 4e496b511..36543ccfa 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -1,6 +1,6 @@
<input id="invisible-wall-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple>
<input id="invisible-comment-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple>
-<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-form_id="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
+<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-form_id="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}' data-bang='{{$bang}}'>
{{$mimeselect}}
{{$layoutselect}}
{{if $id_select}}