From ae3d4f63a31c5a9f35c55e6507263a600867b55a Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 28 Nov 2019 12:42:12 -0500 Subject: [PATCH] Use visibility tags input for the default ACL selector - Move friendica-tagsinput to default view folder - Update all references to ACL::getFullSelectorHTML - Fix theme-specific issues with the new ACL --- mod/community.php | 2 +- mod/display.php | 2 +- mod/events.php | 14 +- mod/network.php | 4 +- mod/photos.php | 4 +- mod/settings.php | 2 +- src/Core/ACL.php | 81 +++-- src/Module/Bookmarklet.php | 2 +- src/Module/Contact.php | 2 +- src/Module/Profile.php | 2 +- .../friendica-tagsinput/LICENSE | 0 .../friendica-tagsinput-typeahead.css | 0 .../friendica-tagsinput.css | 155 +++++++++ .../friendica-tagsinput.js | 0 view/templates/acl_selector.tpl | 305 +++++++++++++++--- .../friendica-tagsinput.css | 72 ----- view/theme/frio/js/event_edit.js | 18 -- view/theme/frio/js/modal.js | 6 +- view/theme/frio/templates/acl_selector.tpl | 64 ---- view/theme/frio/templates/event_form.tpl | 2 +- view/theme/smoothly/templates/jot.tpl | 3 - 21 files changed, 487 insertions(+), 253 deletions(-) rename view/{theme/frio/frameworks => js}/friendica-tagsinput/LICENSE (100%) rename view/{theme/frio/frameworks => js}/friendica-tagsinput/friendica-tagsinput-typeahead.css (100%) create mode 100644 view/js/friendica-tagsinput/friendica-tagsinput.css rename view/{theme/frio/frameworks => js}/friendica-tagsinput/friendica-tagsinput.js (100%) delete mode 100644 view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput.css delete mode 100644 view/theme/frio/templates/acl_selector.tpl diff --git a/mod/community.php b/mod/community.php index 81857c6d3..4d98f0c4f 100644 --- a/mod/community.php +++ b/mod/community.php @@ -125,7 +125,7 @@ function community_content(App $a, $update = 0) 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'), - 'acl' => ACL::getFullSelectorHTML($a->user, true), + 'acl' => ACL::getFullSelectorHTML($a->page, $a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/display.php b/mod/display.php index 12fa8d7ec..175616f98 100644 --- a/mod/display.php +++ b/mod/display.php @@ -304,7 +304,7 @@ function display_content(App $a, $update = false, $update_uid = 0) 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'), - 'acl' => ACL::getFullSelectorHTML($a->user, true), + 'acl' => ACL::getFullSelectorHTML($a->page, $a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/events.php b/mod/events.php index 11bb25f51..a642f1665 100644 --- a/mod/events.php +++ b/mod/events.php @@ -13,6 +13,7 @@ use Friendica\Core\L10n; use Friendica\Core\Logger; use Friendica\Core\Renderer; use Friendica\Core\System; +use Friendica\Core\Theme; use Friendica\Core\Worker; use Friendica\Database\DBA; use Friendica\Model\Event; @@ -384,6 +385,12 @@ function events_content(App $a) $events[$key]['item'] = $event_item; } + // ACL blocks are loaded in modals in frio + $a->page->registerFooterScript(Theme::getPathForFile('asset/typeahead.js/dist/typeahead.bundle.js')); + $a->page->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js')); + $a->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css')); + $a->page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css')); + $o = Renderer::replaceMacros($tpl, [ '$tabs' => $tabs, '$title' => L10n::t('Events'), @@ -486,7 +493,7 @@ function events_content(App $a) $perms = ACL::getDefaultUserPermissions($orig_event); if (!$cid && in_array($mode, ['new', 'copy'])) { - $acl = ACL::getFullSelectorHTML($a->user, false, $orig_event); + $acl = ACL::getFullSelectorHTML($a->page, $a->user, false, $perms); } else { $acl = ''; } @@ -506,11 +513,6 @@ function events_content(App $a) '$cid' => $cid, '$uri' => $uri, - '$allow_cid' => json_encode($perms['allow_cid']), - '$allow_gid' => json_encode($perms['allow_gid']), - '$deny_cid' => json_encode($perms['deny_cid']), - '$deny_gid' => json_encode($perms['deny_gid']), - '$title' => L10n::t('Event details'), '$desc' => L10n::t('Starting date and Title are required.'), '$s_text' => L10n::t('Event Starts:') . ' *', diff --git a/mod/network.php b/mod/network.php index 5fbfa9a5d..44c7c8b44 100644 --- a/mod/network.php +++ b/mod/network.php @@ -377,7 +377,7 @@ function networkFlatView(App $a, $update = 0) (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'), 'default_perms' => ACL::getDefaultUserPermissions($a->user), - 'acl' => ACL::getFullSelectorHTML($a->user, true), + 'acl' => ACL::getFullSelectorHTML($a->page, $a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), @@ -554,7 +554,7 @@ function networkThreadedView(App $a, $update, $parent) (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid']))) ? 'lock' : 'unlock'), 'default_perms' => ACL::getDefaultUserPermissions($a->user), - 'acl' => ACL::getFullSelectorHTML($a->user, true, $default_permissions), + 'acl' => ACL::getFullSelectorHTML($a->page, $a->user, true, $default_permissions), 'bang' => (($gid || $cid || $nets) ? '!' : ''), 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/mod/photos.php b/mod/photos.php index e0630e7dc..684e525d4 100644 --- a/mod/photos.php +++ b/mod/photos.php @@ -960,7 +960,7 @@ function photos_content(App $a) $tpl = Renderer::getMarkupTemplate('photos_upload.tpl'); - $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML($a->user)); + $aclselect_e = ($visitor ? '' : ACL::getFullSelectorHTML($a->page, $a->user)); $o .= Renderer::replaceMacros($tpl,[ '$pagename' => L10n::t('Upload Photos'), @@ -1332,7 +1332,7 @@ function photos_content(App $a) $album_e = $ph[0]['album']; $caption_e = $ph[0]['desc']; - $aclselect_e = ACL::getFullSelectorHTML($a->user, false, $ph[0]); + $aclselect_e = ACL::getFullSelectorHTML($a->page, $a->user, false, $ph[0]); $edit = Renderer::replaceMacros($edit_tpl, [ '$id' => $ph[0]['id'], diff --git a/mod/settings.php b/mod/settings.php index 5ae4086b6..2ab4cc8f3 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -1197,7 +1197,7 @@ function settings_content(App $a) '$permissions' => L10n::t('Default Post Permissions'), '$permdesc' => L10n::t("\x28click to open/close\x29"), '$visibility' => $profile['net-publish'], - '$aclselect' => ACL::getFullSelectorHTML($a->user), + '$aclselect' => ACL::getFullSelectorHTML($a->page, $a->user), '$suggestme' => $suggestme, '$blockwall'=> $blockwall, // array('blockwall', L10n::t('Allow friends to post to your profile page:'), !$blockwall, ''), '$blocktags'=> $blocktags, // array('blocktags', L10n::t('Allow friends to tag your posts:'), !$blocktags, ''), diff --git a/src/Core/ACL.php b/src/Core/ACL.php index ccc2b34d5..880a1e47f 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -6,13 +6,10 @@ namespace Friendica\Core; +use Friendica\App\Page; use Friendica\BaseObject; -use Friendica\Content\Feature; use Friendica\Database\DBA; use Friendica\Model\Contact; -use Friendica\Model\GContact; -use Friendica\Core\Session; -use Friendica\Util\Network; use Friendica\Model\Group; /** @@ -312,26 +309,50 @@ class ACL extends BaseObject /** * Return the full jot ACL selector HTML * + * @param Page $page * @param array $user User array - * @param bool $show_jotnets - * @param array $default_permissions Static defaults permission array: ['allow_cid' => '', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => ''] + * @param bool $for_federation + * @param array $default_permissions Static defaults permission array: + * [ + * 'allow_cid' => [], + * 'allow_gid' => [], + * 'deny_cid' => [], + * 'deny_gid' => [], + * 'hidewall' => true/false + * ] * @return string * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ - public static function getFullSelectorHTML(array $user = null, $show_jotnets = false, array $default_permissions = []) + public static function getFullSelectorHTML(Page $page, array $user = null, bool $for_federation = false, array $default_permissions = []) { + $page->registerFooterScript(Theme::getPathForFile('asset/typeahead.js/dist/typeahead.bundle.js')); + $page->registerFooterScript(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.js')); + $page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput.css')); + $page->registerStylesheet(Theme::getPathForFile('js/friendica-tagsinput/friendica-tagsinput-typeahead.css')); + // Defaults user permissions if (empty($default_permissions)) { $default_permissions = self::getDefaultUserPermissions($user); } + if (count($default_permissions['allow_cid']) + + count($default_permissions['allow_gid']) + + count($default_permissions['deny_cid']) + + count($default_permissions['deny_gid'])) { + $visibility = 'custom'; + } else { + $visibility = 'public'; + // Default permission display for custom panel + $default_permissions['allow_gid'] = [Group::FOLLOWERS]; + } + $jotnets_fields = []; - if ($show_jotnets) { + if ($for_federation) { $mail_enabled = false; $pubmail_enabled = false; if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) { - $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', local_user()]); + $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['Ășid']]); if (DBA::isResult($mailacct)) { $mail_enabled = true; $pubmail_enabled = !empty($mailacct['pubmail']); @@ -354,27 +375,35 @@ class ACL extends BaseObject } } + $acl_contacts = self::getContactListByUserId($user['uid']); + + $acl_groups = self::getGroupListByUserId($user['uid']); + + $acl_list = array_merge($acl_groups, $acl_contacts); + $tpl = Renderer::getMarkupTemplate('acl_selector.tpl'); $o = Renderer::replaceMacros($tpl, [ - '$showall' => L10n::t('Visible to everybody'), - '$show' => L10n::t('show'), - '$hide' => L10n::t('don\'t show'), - '$allowcid' => json_encode(($default_permissions['allow_cid'] ?? '') ?: []), // We need arrays for - '$allowgid' => json_encode(($default_permissions['allow_gid'] ?? '') ?: []), // Javascript since we - '$denycid' => json_encode(($default_permissions['deny_cid'] ?? '') ?: []), // call .remove() and - '$denygid' => json_encode(($default_permissions['deny_gid'] ?? '') ?: []), // .push() on these values - '$networks' => $show_jotnets, - '$emailcc' => L10n::t('CC: email addresses'), - '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'), - '$jotnets_enabled' => empty($default_permissions['hidewall']), + '$public_title' => L10n::t('Public'), + '$public_desc' => L10n::t('This content will be shown to all your followers and can be seen in the community pages and by anyone with its link.'), + '$custom_title' => L10n::t('Limited/Private'), + '$custom_desc' => L10n::t('This content will be shown only to the people in the first box, to the exception of the people mentioned in the second box. It won\'t appear anywhere public.'), + '$allow_label' => L10n::t('Show to:'), + '$deny_label' => L10n::t('Except to:'), + '$emailcc' => L10n::t('CC: email addresses'), + '$emtitle' => L10n::t('Example: bob@example.com, mary@example.com'), '$jotnets_summary' => L10n::t('Connectors'), - '$jotnets_fields' => $jotnets_fields, '$jotnets_disabled_label' => L10n::t('Connectors disabled, since "%s" is enabled.', L10n::t('Hide your profile details from unknown viewers?')), - '$aclModalTitle' => L10n::t('Permissions'), - '$aclModalDismiss' => L10n::t('Close'), - '$features' => [ - 'aclautomention' => !empty($user['uid']) && Feature::isEnabled($user['uid'], 'aclautomention') ? 'true' : 'false' - ], + '$visibility' => $visibility, + '$acl_contacts' => $acl_contacts, + '$acl_groups' => $acl_groups, + '$acl_list' => $acl_list, + '$contact_allow' => implode(',', $default_permissions['allow_cid']), + '$group_allow' => implode(',', $default_permissions['allow_gid']), + '$contact_deny' => implode(',', $default_permissions['deny_cid']), + '$group_deny' => implode(',', $default_permissions['deny_gid']), + '$for_federation' => $for_federation, + '$jotnets_fields' => $jotnets_fields, + '$user_hidewall' => $default_permissions['hidewall'], ]); return $o; diff --git a/src/Module/Bookmarklet.php b/src/Module/Bookmarklet.php index a50f23c25..08bac2c1d 100644 --- a/src/Module/Bookmarklet.php +++ b/src/Module/Bookmarklet.php @@ -44,7 +44,7 @@ class Bookmarklet extends BaseModule 'nickname' => $app->user['nickname'], 'lockstate' => ((is_array($app->user) && ((strlen($app->user['allow_cid'])) || (strlen($app->user['allow_gid'])) || (strlen($app->user['deny_cid'])) || (strlen($app->user['deny_gid'])))) ? 'lock' : 'unlock'), 'default_perms' => ACL::getDefaultUserPermissions($app->user), - 'acl' => ACL::getFullSelectorHTML($app->user, true), + 'acl' => ACL::getFullSelectorHTML($app->page, $app->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/src/Module/Contact.php b/src/Module/Contact.php index ded5ffbe2..5ef06b72a 100644 --- a/src/Module/Contact.php +++ b/src/Module/Contact.php @@ -926,7 +926,7 @@ class Contact extends BaseModule 'default_location' => $a->user['default-location'], 'nickname' => $a->user['nickname'], 'lockstate' => (is_array($a->user) && (strlen($a->user['allow_cid']) || strlen($a->user['allow_gid']) || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid'])) ? 'lock' : 'unlock'), - 'acl' => ACL::getFullSelectorHTML($a->user, true), + 'acl' => ACL::getFullSelectorHTML($a->page, $a->user, true), 'bang' => '', 'visitor' => 'block', 'profile_uid' => local_user(), diff --git a/src/Module/Profile.php b/src/Module/Profile.php index aab591856..db1a6f86b 100644 --- a/src/Module/Profile.php +++ b/src/Module/Profile.php @@ -208,7 +208,7 @@ class Profile extends BaseModule || strlen($a->user['deny_cid']) || strlen($a->user['deny_gid']) ) ? 'lock' : 'unlock', - 'acl' => $is_owner ? ACL::getFullSelectorHTML($a->user, true) : '', + 'acl' => $is_owner ? ACL::getFullSelectorHTML($a->page, $a->user, true) : '', 'bang' => '', 'visitor' => $is_owner || $commvisitor ? 'block' : 'none', 'profile_uid' => $a->profile['profile_uid'], diff --git a/view/theme/frio/frameworks/friendica-tagsinput/LICENSE b/view/js/friendica-tagsinput/LICENSE similarity index 100% rename from view/theme/frio/frameworks/friendica-tagsinput/LICENSE rename to view/js/friendica-tagsinput/LICENSE diff --git a/view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput-typeahead.css b/view/js/friendica-tagsinput/friendica-tagsinput-typeahead.css similarity index 100% rename from view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput-typeahead.css rename to view/js/friendica-tagsinput/friendica-tagsinput-typeahead.css diff --git a/view/js/friendica-tagsinput/friendica-tagsinput.css b/view/js/friendica-tagsinput/friendica-tagsinput.css new file mode 100644 index 000000000..6ad1d0015 --- /dev/null +++ b/view/js/friendica-tagsinput/friendica-tagsinput.css @@ -0,0 +1,155 @@ +/* + * friendica-tagsinput v0.8.0 + * + * Non-Bootstrap edition + */ + +.label { + display: inline; + padding: .2em .6em .3em; + font-size: 75%; + font-weight: 700; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: .25em; +} + +.label-default { + background-color: #777777; +} +.label-default[href]:hover, +.label-default[href]:focus { + background-color: #5e5e5e; +} +.label-primary { + background-color: #337ab7; +} +.label-primary[href]:hover, +.label-primary[href]:focus { + background-color: #286090; +} +.label-success { + background-color: #5cb85c; +} +.label-success[href]:hover, +.label-success[href]:focus { + background-color: #449d44; +} +.label-info { + background-color: #5bc0de; +} +.label-info[href]:hover, +.label-info[href]:focus { + background-color: #31b0d5; +} +.label-warning { + background-color: #f0ad4e; +} +.label-warning[href]:hover, +.label-warning[href]:focus { + background-color: #ec971f; +} +.label-danger { + background-color: #d9534f; +} +.label-danger[href]:hover, +.label-danger[href]:focus { + background-color: #c9302c; +} + +.form-control[disabled], +.form-control[readonly], +fieldset[disabled] .form-control { + background-color: #eeeeee; + opacity: 1; +} +.form-control[disabled], +fieldset[disabled] .form-control { + cursor: not-allowed; +} + + + + +.friendica-tagsinput { + background-color: #fff; + border: 1px solid #ccc; + box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); + display: inline-block; + padding: 4px 6px; + color: #555; + vertical-align: middle; + border-radius: 4px; + max-width: 100%; + line-height: 22px; + cursor: text; + height: auto; +} + +.friendica-tagsinput.input-lg { + line-height: 27px; +} + +.friendica-tagsinput input { + border: none; + box-shadow: none; + outline: none; + background-color: transparent; + padding: 0 6px; + margin: 0; + width: auto; + max-width: inherit; +} + +.friendica-tagsinput.form-control input::-moz-placeholder { + color: #777; + opacity: 1; +} + +.friendica-tagsinput.form-control input:-ms-input-placeholder { + color: #777; +} + +.friendica-tagsinput.form-control input::-webkit-input-placeholder { + color: #777; +} + +.friendica-tagsinput input:focus { + border: none; + box-shadow: none; +} + +.friendica-tagsinput .tag { + margin: 0 2px 2px 0; + color: white; + font-weight: normal; +} + +.friendica-tagsinput .tag img { + width: auto; + height: 1.5em; + vertical-align: text-top; + margin-right: 8px; +} + +.friendica-tagsinput .tag [data-role="remove"] { + margin-left: 8px; + cursor: pointer; +} + +.friendica-tagsinput .tag [data-role="remove"]:after { + content: "x"; + padding: 0px 2px; + font-weight: bold; +} + +.friendica-tagsinput .tag [data-role="remove"]:hover { + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); +} + +.friendica-tagsinput .tag [data-role="remove"]:hover:active { + box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); +} diff --git a/view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput.js b/view/js/friendica-tagsinput/friendica-tagsinput.js similarity index 100% rename from view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput.js rename to view/js/friendica-tagsinput/friendica-tagsinput.js diff --git a/view/templates/acl_selector.tpl b/view/templates/acl_selector.tpl index 58a0f483b..21b28d5d7 100644 --- a/view/templates/acl_selector.tpl +++ b/view/templates/acl_selector.tpl @@ -1,58 +1,263 @@ -
- - {{$showall}} -
-
+
+
+
+ +
+
+
+

{{$public_desc}}

+ {{if $for_federation}} + {{if $user_hidewall}} +

{{$jotnets_summary}}

+ {{$jotnets_disabled_label}} + {{elseif $jotnets_fields}} + {{if $jotnets_fields|count < 3}} +
+ {{else}} +
+ {{$jotnets_summary}} + {{/if}} + + {{foreach $jotnets_fields as $jotnets_field}} + {{if $jotnets_field.type == 'checkbox'}} + {{include file="field_checkbox.tpl" field=$jotnets_field.field}} + {{elseif $jotnets_field.type == 'select'}} + {{include file="field_select.tpl" field=$jotnets_field.field}} + {{/if}} + {{/foreach}} + + {{if $jotnets_fields|count >= 3}} +
+ {{else}} +
+ {{/if}} + {{/if}} + {{/if}} +
+
+
+
+
+ +
+
+ + + + +
+

{{$custom_desc}}

+ +
+ + +
+ +
+ + +
+
+
- -
- -{{if $networks}} -
-
{{$emailcc}}
-
- - {{if $jotnets_fields}} - {{if $jotnets_fields|count < 3}} -
- {{else}} -
- {{$jotnets_summary}} - {{/if}} - - {{foreach $jotnets_fields as $jotnets_field}} - {{if $jotnets_field.type == 'checkbox'}} - {{include file="field_checkbox.tpl" field=$jotnets_field.field}} - {{elseif $jotnets_field.type == 'select'}} - {{include file="field_select.tpl" field=$jotnets_field.field}} - {{/if}} - {{/foreach}} - - {{if $jotnets_fields|count >= 3}} -
- {{else}} -
- {{/if}} - {{/if}} +{{if $for_federation}} +
+ + +
+
{{/if}} +
+ diff --git a/view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput.css b/view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput.css deleted file mode 100644 index f2e1197a5..000000000 --- a/view/theme/frio/frameworks/friendica-tagsinput/friendica-tagsinput.css +++ /dev/null @@ -1,72 +0,0 @@ -/* - * friendica-tagsinput v0.8.0 - * - */ - -.friendica-tagsinput { - background-color: #fff; - border: 1px solid #ccc; - box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075); - display: inline-block; - padding: 4px 6px; - color: #555; - vertical-align: middle; - border-radius: 4px; - max-width: 100%; - line-height: 22px; - cursor: text; - height: auto; -} -.friendica-tagsinput.input-lg { - line-height: 27px; -} -.friendica-tagsinput input { - border: none; - box-shadow: none; - outline: none; - background-color: transparent; - padding: 0 6px; - margin: 0; - width: auto; - max-width: inherit; -} -.friendica-tagsinput.form-control input::-moz-placeholder { - color: #777; - opacity: 1; -} -.friendica-tagsinput.form-control input:-ms-input-placeholder { - color: #777; -} -.friendica-tagsinput.form-control input::-webkit-input-placeholder { - color: #777; -} -.friendica-tagsinput input:focus { - border: none; - box-shadow: none; -} -.friendica-tagsinput .tag { - margin: 0 2px 2px 0; - color: white; - font-weight: normal; -} -.friendica-tagsinput .tag img { - width: auto; - height: 1.5em; - vertical-align: text-top; - margin-right: 8px; -} -.friendica-tagsinput .tag [data-role="remove"] { - margin-left: 8px; - cursor: pointer; -} -.friendica-tagsinput .tag [data-role="remove"]:after { - content: "x"; - padding: 0px 2px; - font-weight: bold; -} -.friendica-tagsinput .tag [data-role="remove"]:hover { - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05); -} -.friendica-tagsinput .tag [data-role="remove"]:hover:active { - box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125); -} diff --git a/view/theme/frio/js/event_edit.js b/view/theme/frio/js/event_edit.js index 597563fe1..a068b4fe0 100644 --- a/view/theme/frio/js/event_edit.js +++ b/view/theme/frio/js/event_edit.js @@ -49,24 +49,6 @@ $(document).ready(function() { $("#event-preview").empty(); e.preventDefault(); }); - - // Construct a new ACL. We need this everytime the 'event-edit-form' is loaded - // without page reloading (e.g. closing an old modal and open a new modal). - // Otherwise we wouldn't get the ACL data. - /// @todo: Try to implement some kind of ACL reloading in acl.js. - - var eventPerms = document.getElementById('event-edit-form'); - - acl = new ACL( - baseurl + '/search/acl', - [ - JSON.parse(eventPerms.dataset.allow_cid), - JSON.parse(eventPerms.dataset.allow_gid), - JSON.parse(eventPerms.dataset.deny_cid), - JSON.parse(eventPerms.dataset.deny_gid) - ] - ); - acl.get(0, 100); }); // Load the html of the actual event and incect the output to the diff --git a/view/theme/frio/js/modal.js b/view/theme/frio/js/modal.js index f33988e13..04184a651 100644 --- a/view/theme/frio/js/modal.js +++ b/view/theme/frio/js/modal.js @@ -344,11 +344,11 @@ function toggleJotNav (elm) { // Minimize all tab content wrapper and activate only the selected // tab panel. - $('#jot-modal [role=tabpanel]').addClass("minimize").attr("aria-hidden" ,"true"); - $('#jot-modal #' + tabpanel).removeClass("minimize").attr("aria-hidden" ,"false"); + $('#profile-jot-form > [role=tabpanel]').addClass("minimize").attr("aria-hidden" ,"true"); + $('#' + tabpanel).removeClass("minimize").attr("aria-hidden" ,"false"); // Set the aria-selected states - $("#jot-modal .nav-tabs .jot-nav-lnk").attr("aria-selected", "false"); + $("#jot-modal .modal-header .nav-tabs .jot-nav-lnk").attr("aria-selected", "false"); elm.setAttribute("aria-selected", "true"); // For some some tab panels we need to execute other js functions. diff --git a/view/theme/frio/templates/acl_selector.tpl b/view/theme/frio/templates/acl_selector.tpl deleted file mode 100644 index e335a4f3c..000000000 --- a/view/theme/frio/templates/acl_selector.tpl +++ /dev/null @@ -1,64 +0,0 @@ - -
- - -
-
-
- -
- - - -{{if $networks}} -
-
- - -
-
- - {{if $jotnets_fields}} - {{if $jotnets_fields|count < 3}} -
- {{else}} -
- {{$jotnets_summary}} - {{/if}} - - {{foreach $jotnets_fields as $jotnets_field}} - {{if $jotnets_field.type == 'checkbox'}} - {{include file="field_checkbox.tpl" field=$jotnets_field.field}} - {{elseif $jotnets_field.type == 'select'}} - {{include file="field_select.tpl" field=$jotnets_field.field}} - {{/if}} - {{/foreach}} - - {{if $jotnets_fields|count >= 3}} -
- {{else}} -
- {{/if}} - {{/if}} -{{/if}} - - diff --git a/view/theme/frio/templates/event_form.tpl b/view/theme/frio/templates/event_form.tpl index 661bdecb2..c48d5c7fc 100644 --- a/view/theme/frio/templates/event_form.tpl +++ b/view/theme/frio/templates/event_form.tpl @@ -30,7 +30,7 @@
-
+ diff --git a/view/theme/smoothly/templates/jot.tpl b/view/theme/smoothly/templates/jot.tpl index c690cdf18..07c452c7e 100644 --- a/view/theme/smoothly/templates/jot.tpl +++ b/view/theme/smoothly/templates/jot.tpl @@ -70,9 +70,6 @@
{{$acl nofilter}} -
-
{{$emailcc}}
-
{{$jotnets nofilter}}