mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
more nomadic testing
This commit is contained in:
parent
b84410b0ae
commit
223534ece7
6 changed files with 67 additions and 46 deletions
|
@ -3047,6 +3047,7 @@ class Libzot
|
|||
'outbox' => z_root() . '/outbox/' . $e['channel_address'],
|
||||
'followers' => z_root() . '/followers/' . $e['channel_address'],
|
||||
'following' => z_root() . '/following/' . $e['channel_address'],
|
||||
'permissions' => z_root() . '/permissions/' . $e['channel_address'],
|
||||
'searchContent' => z_root() . '/search/' . $e['channel_address'] . '?search={}',
|
||||
'searchTags' => z_root() . '/search/' . $e['channel_address'] . '?tags={}',
|
||||
]);
|
||||
|
|
|
@ -531,11 +531,31 @@ class Connedit extends Controller
|
|||
$abook_prev = 0;
|
||||
$abook_next = 0;
|
||||
|
||||
|
||||
$order_q = 'xchan_name';
|
||||
if (isset($_REQUEST['order'])) {
|
||||
switch ($_REQUEST['order']) {
|
||||
case 'date':
|
||||
$order_q = 'abook_created desc';
|
||||
break;
|
||||
case 'created':
|
||||
$order_q = 'abook_created';
|
||||
break;
|
||||
case 'cmax':
|
||||
$order_q = 'abook_closeness';
|
||||
break;
|
||||
case 'name':
|
||||
default:
|
||||
$order_q = 'xchan_name';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$contact_id = App::$poi['abook_id'];
|
||||
$contact = App::$poi;
|
||||
|
||||
$cn = q(
|
||||
"SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and xchan_deleted = 0 order by xchan_name",
|
||||
"SELECT abook_id, xchan_name from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_self = 0 and xchan_deleted = 0 order by $order_q",
|
||||
intval(local_channel())
|
||||
);
|
||||
|
||||
|
@ -819,6 +839,7 @@ class Connedit extends Controller
|
|||
'$section' => $section,
|
||||
'$sections' => $sections,
|
||||
'$vcard' => $vcard,
|
||||
'$order' => $_REQUEST['order'] ?? '',
|
||||
'$addr_text' => t('This connection\'s primary address is'),
|
||||
'$loc_text' => t('Available locations:'),
|
||||
'$locstr' => $locstr,
|
||||
|
|
|
@ -15,6 +15,7 @@ class Primary extends BaseObject
|
|||
public $following;
|
||||
public $searchContent;
|
||||
public $searchTags;
|
||||
public $permissions;
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
|
@ -178,5 +179,24 @@ class Primary extends BaseObject
|
|||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getPermissions()
|
||||
{
|
||||
return $this->permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $permissions
|
||||
* @return Primary
|
||||
*/
|
||||
public function setPermissions($permissions)
|
||||
{
|
||||
$this->permissions = $permissions;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
namespace Code\Widget;
|
||||
|
||||
use App;
|
||||
use Code\Lib\PConfig;
|
||||
|
||||
use Code\Render\Theme;
|
||||
|
||||
|
||||
|
@ -12,11 +12,11 @@ class Notifications implements WidgetInterface
|
|||
|
||||
public function widget(array $arguments): string
|
||||
{
|
||||
$notifications = [];
|
||||
|
||||
if (local_channel()) {
|
||||
|
||||
$channel = App::get_channel();
|
||||
$display = (int) PConfig::Get($channel['channel_id'], 'system', 'notifications_panel');
|
||||
|
||||
$notifications[] = [
|
||||
'type' => 'stream',
|
||||
|
@ -164,7 +164,7 @@ class Notifications implements WidgetInterface
|
|||
|
||||
return replace_macros(Theme::get_template('notifications_widget.tpl'), [
|
||||
'$module' => App::$module,
|
||||
'$display' => $display,
|
||||
'$display' => false,
|
||||
'$notifications' => $notifications,
|
||||
'$notifications_label' => t('Notifications'),
|
||||
'$no_notifications' => t('Sorry, you have got no notifications at the moment'),
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</div>
|
||||
{{if $abook_prev || $abook_next}}
|
||||
<div class="btn-group">
|
||||
<a href="connedit/{{$abook_prev}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-outline-secondary btn-sm{{if ! $abook_prev}} disabled{{/if}}" ><i class="fa fa-backward"></i></a>
|
||||
<a href="connedit/{{$abook_prev}}{{if $order}}?order={{$order}}{{/if}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-outline-secondary btn-sm{{if ! $abook_prev}} disabled{{/if}}" ><i class="fa fa-backward"></i></a>
|
||||
<div class="btn-group" >
|
||||
<button class="btn btn-outline-secondary btn-sm{{if $is_pending}} disabled{{/if}}" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><i class="fa fa-bars"></i></button>
|
||||
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dLabel">
|
||||
|
@ -31,7 +31,7 @@
|
|||
{{/foreach}}
|
||||
</div>
|
||||
</div>
|
||||
<a href="connedit/{{$abook_next}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-outline-secondary btn-sm{{if ! $abook_next}} disabled{{/if}}" ><i class="fa fa-forward"></i></a>
|
||||
<a href="connedit/{{$abook_next}}{{if $order}}?order={{$order}}{{/if}}{{if $section}}?f=§ion={{$section}}{{/if}}" class="btn btn-outline-secondary btn-sm{{if ! $abook_next}} disabled{{/if}}" ><i class="fa fa-forward"></i></a>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
@ -74,10 +74,10 @@
|
|||
|
||||
<form id="abook-edit-form" action="connedit/{{$contact_id}}" method="post" >
|
||||
|
||||
<input type="hidden" id="contact_id" name="contact_id" value="{{$contact_id}}">
|
||||
<input type="hidden" name="section" value="{{$section}}">
|
||||
<input type="hidden" id="contact_id" name="contact_id" value="{{$contact_id}}">
|
||||
<input type="hidden" name="section" value="{{$section}}">
|
||||
|
||||
<div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true">
|
||||
<div class="panel-group" id="contact-edit-tools" role="tablist" aria-multiselectable="true">
|
||||
|
||||
<div class="panel">
|
||||
<div class="section-subtitle-wrapper" role="tab" id="alias-tool">
|
||||
|
@ -242,7 +242,7 @@
|
|||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
};
|
||||
});
|
||||
|
||||
{{if $module == 'display' || $module == 'hq' || $startpage == 'hq'}}
|
||||
{{if $module == 'display'}}
|
||||
$(document).on('click', '.notification', function(e) {
|
||||
let b64mid = $(this).data('b64mid');
|
||||
let notify_id = $(this).data('notify_id');
|
||||
|
@ -39,42 +39,21 @@
|
|||
if(b64mid === 'undefined' && notify_id === 'undefined')
|
||||
return;
|
||||
|
||||
{{if $module != 'hq' && $startpage == 'hq'}}
|
||||
e.preventDefault();
|
||||
if(typeof notify_id !== 'undefined' && notify_id !== 'undefined') {
|
||||
$.post(
|
||||
"hq",
|
||||
{
|
||||
"notify_id" : notify_id
|
||||
}
|
||||
);
|
||||
}
|
||||
window.location.href = 'hq/' + b64mid;
|
||||
return;
|
||||
{{else}}
|
||||
{{if $module == 'display'}}
|
||||
history.pushState(stateObj, '', 'display/?mid=' + b64mid);
|
||||
{{/if}}
|
||||
|
||||
{{if $module == 'hq'}}
|
||||
history.pushState(stateObj, '', 'hq/' + b64mid);
|
||||
{{/if}}
|
||||
|
||||
{{if $module == 'hq'}}
|
||||
if(b64mid !== 'undefined') {
|
||||
{{else}}
|
||||
if(path === 'display' && b64mid) {
|
||||
{{/if}}
|
||||
e.preventDefault();
|
||||
|
||||
if(! page_load) {
|
||||
getData(b64mid, notify_id);
|
||||
}
|
||||
|
||||
if($('#notifications_wrapper').hasClass('fs'))
|
||||
$('#notifications_wrapper').prependTo('#' + notifications_parent).removeClass('fs');
|
||||
}
|
||||
{{if $module == 'display'}}
|
||||
history.pushState(stateObj, '', 'display/?mid=' + b64mid);
|
||||
{{/if}}
|
||||
|
||||
if(path === 'display' && b64mid) {
|
||||
e.preventDefault();
|
||||
|
||||
if(! page_load) {
|
||||
getData(b64mid, notify_id);
|
||||
}
|
||||
|
||||
if($('#notifications_wrapper').hasClass('fs'))
|
||||
$('#notifications_wrapper').prependTo('#' + notifications_parent).removeClass('fs');
|
||||
}
|
||||
});
|
||||
{{/if}}
|
||||
|
||||
|
|
Loading…
Reference in a new issue