mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:15:14 +00:00
put notification style under a config switch until a better arrangement can be found.
This commit is contained in:
parent
570c7ef478
commit
81331e156e
4 changed files with 55 additions and 11 deletions
|
@ -36,10 +36,10 @@ class Ping extends Controller
|
|||
$result = [];
|
||||
$notifs = [];
|
||||
|
||||
$result['notify'] = 0;
|
||||
$result['home'] = 0;
|
||||
$result['stream'] = 0;
|
||||
$result['intros'] = 0;
|
||||
$result['notify'] = 2;
|
||||
$result['home'] = 3;
|
||||
$result['stream'] = 4;
|
||||
$result['intros'] = 5;
|
||||
$result['register'] = 0;
|
||||
$result['moderate'] = 0;
|
||||
$result['events'] = 0;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace Code\Widget;
|
||||
|
||||
use App;
|
||||
use Code\Lib\PConfig;
|
||||
use Code\Render\Theme;
|
||||
|
||||
|
||||
|
@ -13,12 +14,15 @@ class Notifications implements WidgetInterface
|
|||
{
|
||||
|
||||
if (local_channel()) {
|
||||
|
||||
$channel = App::get_channel();
|
||||
$display = (int) PConfig::Get($channel['channel_id'], 'system', 'notifications_panel');
|
||||
|
||||
$notifications[] = [
|
||||
'type' => 'stream',
|
||||
'icon' => 'list-alt',
|
||||
'severity' => 'secondary',
|
||||
'style' => $display,
|
||||
'label' => t('New Stream Activity'),
|
||||
'title' => t('New Stream Activity Notifications'),
|
||||
'viewall' => [
|
||||
|
@ -37,6 +41,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'home',
|
||||
'icon' => 'home',
|
||||
'severity' => 'danger',
|
||||
'style' => $display,
|
||||
'label' => t('New Home Activity'),
|
||||
'title' => t('New Home Activity Notifications'),
|
||||
'viewall' => [
|
||||
|
@ -55,6 +60,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'moderate',
|
||||
'icon' => 'home',
|
||||
'severity' => 'danger',
|
||||
'style' => $display,
|
||||
'label' => t('New Moderated Entries'),
|
||||
'title' => t('New Moderated Activities'),
|
||||
'viewall' => [
|
||||
|
@ -71,6 +77,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'all_events',
|
||||
'icon' => 'calendar',
|
||||
'severity' => 'secondary',
|
||||
'style' => $display,
|
||||
'label' => t('New Events'),
|
||||
'title' => t('New Events Notifications'),
|
||||
'viewall' => [
|
||||
|
@ -86,6 +93,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'intros',
|
||||
'icon' => 'users',
|
||||
'severity' => 'danger',
|
||||
'style' => $display,
|
||||
'label' => t('New Connections'),
|
||||
'title' => t('New Connections Notifications'),
|
||||
'viewall' => [
|
||||
|
@ -98,6 +106,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'files',
|
||||
'icon' => 'folder',
|
||||
'severity' => 'danger',
|
||||
'style' => $display,
|
||||
'label' => t('New Files'),
|
||||
'title' => t('New Files Notifications'),
|
||||
];
|
||||
|
@ -106,6 +115,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'notify',
|
||||
'icon' => 'exclamation',
|
||||
'severity' => 'danger',
|
||||
'style' => $display,
|
||||
'label' => t('Notices'),
|
||||
'title' => t('Notices'),
|
||||
'viewall' => [
|
||||
|
@ -121,6 +131,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'forums',
|
||||
'icon' => 'comments-o',
|
||||
'severity' => 'secondary',
|
||||
'style' => $display,
|
||||
'label' => t('Groups'),
|
||||
'title' => t('Groups'),
|
||||
'filter' => [
|
||||
|
@ -134,6 +145,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'register',
|
||||
'icon' => 'user-o',
|
||||
'severity' => 'danger',
|
||||
'style' => $display,
|
||||
'label' => t('New Registrations'),
|
||||
'title' => t('New Registrations Notifications'),
|
||||
];
|
||||
|
@ -144,6 +156,7 @@ class Notifications implements WidgetInterface
|
|||
'type' => 'pubs',
|
||||
'icon' => 'globe',
|
||||
'severity' => 'secondary',
|
||||
'style' => $display,
|
||||
'label' => t('Public Stream'),
|
||||
'title' => t('Public Stream Notifications'),
|
||||
'viewall' => [
|
||||
|
|
|
@ -362,7 +362,8 @@ nav .acpopup {
|
|||
#notifications i {
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
#notifications .card {
|
||||
#notifications .card,
|
||||
#notifications .collapse {
|
||||
width: 100%;
|
||||
}
|
||||
@media (max-width: 991px ) {
|
||||
|
@ -370,10 +371,12 @@ nav .acpopup {
|
|||
margin-top: 4rem;
|
||||
}
|
||||
}
|
||||
#notifications .card .list-group-item {
|
||||
#notifications .card .list-group-item,
|
||||
#notifications .collapse .list-group-item {
|
||||
padding: 1rem;
|
||||
}
|
||||
#notifications .card .list-group-item:hover {
|
||||
#notifications .card .list-group-item:hover,
|
||||
#notifications .collapse .list-group-item:hover {
|
||||
background: $overlaybg;
|
||||
}
|
||||
#notifications .notifications-textinput-filter {
|
||||
|
@ -386,7 +389,16 @@ nav .acpopup {
|
|||
.card #nav-notify-sub,
|
||||
.card #nav-forums-sub,
|
||||
.card #nav-register-sub,
|
||||
.card #nav-all_events-sub {
|
||||
.card #nav-all_events-sub,
|
||||
.collapse #nav-stream-sub,
|
||||
.collapse #nav-home-sub,
|
||||
.collapse #nav-moderate-sub,
|
||||
.collapse #nav-intros-sub,
|
||||
.collapse #nav-files-sub,
|
||||
.collapse #nav-notify-sub,
|
||||
.collapse #nav-forums-sub,
|
||||
.collapse #nav-register-sub,
|
||||
.collapse #nav-all_events-sub {
|
||||
border: $border;
|
||||
}
|
||||
.card #nav-stream-sub .list-group-item,
|
||||
|
@ -397,7 +409,16 @@ nav .acpopup {
|
|||
.card #nav-notify-sub .list-group-item,
|
||||
.card #nav-forums-sub .list-group-item,
|
||||
.card #nav-register-sub .list-group-item,
|
||||
.card #nav-all_events-sub .list-group-item{
|
||||
.card #nav-all_events-sub .list-group-item,
|
||||
.collapse #nav-stream-sub .list-group-item,
|
||||
.collapse #nav-home-sub .list-group-item,
|
||||
.collapse #nav-moderate-sub .list-group-item,
|
||||
.collapse #nav-intros-sub .list-group-item,
|
||||
.collapse #nav-files-sub .list-group-item,
|
||||
.collapse #nav-notify-sub .list-group-item,
|
||||
.collapse #nav-forums-sub .list-group-item,
|
||||
.collapse #nav-register-sub .list-group-item,
|
||||
.collapse #nav-all_events-sub .list-group-item {
|
||||
border: 0;
|
||||
background: $subtle_shade;
|
||||
border-radius: 0 !important;
|
||||
|
@ -410,7 +431,17 @@ nav .acpopup {
|
|||
.card #nav-notify-menu,
|
||||
.card #nav-forums-menu,
|
||||
.card #nav-register-menu,
|
||||
.card #nav-all_events-menu{
|
||||
.card #nav-all_events-menu,
|
||||
.collapse #nav-stream-menu,
|
||||
.collapse #nav-home-menu,
|
||||
.collapse #nav-moderate-menu,
|
||||
.collapse #nav-intros-menu,
|
||||
.collapse #nav-files-menu,
|
||||
.collapse #nav-notify-menu,
|
||||
.collapse #nav-forums-menu,
|
||||
.collapse #nav-register-menu,
|
||||
.collapse #nav-all_events-menu {
|
||||
|
||||
padding: 0.5rem 1rem;
|
||||
background: $subtle_shade;
|
||||
}
|
||||
|
|
|
@ -152,7 +152,7 @@
|
|||
</div>
|
||||
<div id="notifications" class="navbar-nav">
|
||||
{{foreach $notifications as $notification}}
|
||||
<div class="card {{$notification.type}}-button">
|
||||
<div class="{{if $notification.style}}card{{else}}collapse{{/if}} {{$notification.type}}-button"{{if $notification.style}} style="display: none;"{{/if}}>
|
||||
<a class="list-group-item list-group-item-action notification-link" href="#" title="{{$notification.title}}" data-bs-target="#nav-{{$notification.type}}-sub" data-bs-toggle="collapse" data-type="{{$notification.type}}">
|
||||
<i class="fa fa-fw fa-{{$notification.icon}}"></i> {{$notification.label}}
|
||||
<span class="float-end badge bg-{{$notification.severity}} {{$notification.type}}-update"></span>
|
||||
|
|
Loading…
Reference in a new issue