bootstrap 4 update and bugfixes

This commit is contained in:
Joey Kimsey
2024-12-08 04:43:06 -05:00
parent 485d85cb0a
commit 4ab9d33b01
79 changed files with 861 additions and 504 deletions

View File

@ -73,12 +73,12 @@ class Notification extends DatabaseModel {
'expiresAt', '<', time(),
];
if ( empty( $limit ) ) {
$notifications = self::$db->getPaginated( $this->tableName, $whereClause );
$notifications = self::$db->get( $this->tableName, $whereClause );
} else {
$notifications = self::$db->getPaginated( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
$notifications = self::$db->get( $this->tableName, $whereClause, 'ID', 'DESC', [0, $limit] );
}
if ( !$notifications->count() ) {
Debug::info( 'No Notifications found.' );
Debug::info( 'Notification:getByUser No Notifications found' );
return false;
}
return $this->filter( $notifications->results() );

View File

@ -33,7 +33,7 @@ class Notifications extends Plugin {
];
public $admin_links = [
[
'text' => '<i class="glyphicon glyphicon-bell"></i> Notify',
'text' => '<i class="fa fa-fw fa-bell"></i> Notify',
'url' => '{ROOT_URL}admin/notifications',
],
];
@ -49,14 +49,14 @@ class Notifications extends Plugin {
$messageBadge = '';
}
Components::set( 'NBADGE', $messageBadge );
if ( App::$isLoggedIn ) {
Components::set( 'recentNotifications', Views::simpleView( 'notifications.nav.recentNotificationsDropdown', $notifications->getByUser( 10 ) ) );
} else {
Components::set( 'recentNotifications', '' );
}
if ( ! self::$loaded ) {
if ( App::$isLoggedIn ) {
Components::set( 'recentNotifications', Views::simpleView( 'notifications.nav.recentNotificationsDropdown', $notifications->getByUser( 10 ) ) );
} else {
Components::set( 'recentNotifications', '' );
}
App::$topNavRight .= '{recentNotifications}';
App::$topNavRightDropdown .= '<li><a href="{ROOT_URL}notifications"><i class="glyphicon glyphicon-bell"></i> Notifications {NBADGE}</a></li>';
App::$topNavRightDropdown .= '<li><a href="{ROOT_URL}notifications"><i class="fa fa-fw fa-bell"></i> Notifications {NBADGE}</a></li>';
self::$loaded = true;
}
}

View File

@ -13,8 +13,8 @@
{LOOP}
<tr {unseenBadge}>
<td>{notification}</td>
<td><a href="{ROOT_URL}notifications/markRead/{ID}" class="btn btn-sm btn-primary" role="button"><i class="glyphicon glyphicon-open"></i></a></td>
<td><a href="{ROOT_URL}notifications/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="glyphicon glyphicon-trash"></i></a></td>
<td><a href="{ROOT_URL}notifications/markRead/{ID}" class="btn btn-sm btn-primary" role="button"><i class="fa fa-fw fa-upload"></i></a></td>
<td><a href="{ROOT_URL}notifications/delete/{ID}" class="btn btn-sm btn-danger" role="button"><i class="fa fa-fw fa-trash"></i></a></td>
</tr>
{/LOOP}
{ALT}

View File

@ -1,6 +1,15 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-bell"></i>{NBADGE}</a>
<ul class="dropdown-menu message-dropdown">
<li class="dropdown nav-link">
<a
href="#"
class="nav-link dropdown-toggle"
id="notiificationsDropdown"
role="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<i class="fa fa-fw fa-bell"></i>{NBADGE}
</a>
<ul class="dropdown-menu dropdown-menu-right message-dropdown" aria-labelledby="notiificationsDropdown">
{LOOP}
<li class="message-preview">
<a href="{ROOT_URL}notifications">