N°7565 - Add button in notifications center to access the "all news" page

This commit is contained in:
Molkobain
2024-07-04 23:59:39 +02:00
parent 296c5bd3d2
commit 7cedc501f7
3 changed files with 11 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ Dict::Add('EN US', 'English', 'English', array(
'UI:NotificationsCenter:Page:Title' => 'Notifications center',
'UI:NotificationsCenter:Panel:Title' => 'Notifications center',
'UI:NotificationsCenter:Panel:SubTitle' => 'Manage Notifications that you have received : unsubscribe or limit them to a single channel',
'UI:NotificationsCenter:Panel:Toolbar:ViewAllNews:Title' => 'View all my news',
'UI:NotificationsCenter:Panel:Table:Channels' => 'Channels',
'UI:NotificationsCenter:Unsubscribe:Success' => 'You have been successfully unsubscribed from the selected notifications.',
'UI:NotificationsCenter:Unsubscribe:Error' => 'An error occurred while unsubscribing from the selected notifications.',

View File

@@ -14,6 +14,7 @@ Dict::Add('FR FR', 'French', 'Français', [
'UI:NotificationsCenter:Channel:OutOf:Text' => '%1$s sur %2$s',
'UI:NotificationsCenter:Page:Title' => 'Notifications',
'UI:NotificationsCenter:Panel:SubTitle' => 'Gérer les Notifications dont vous êtes destinataire : désinscrivez-vous ou limitez les à un seul canal',
'UI:NotificationsCenter:Panel:Toolbar:ViewAllNews:Title' => 'Voir toutes mes news',
'UI:NotificationsCenter:Panel:Table:Channels' => 'Canaux',
'UI:NotificationsCenter:Panel:Title' => 'Notifications',
'UI:NotificationsCenter:Subscribe:Error' => 'Une erreur c\'est produite, lors de votre ré-inscription.',

View File

@@ -3,6 +3,7 @@ namespace Combodo\iTop\Controller\Notifications;
use ActionNotification;
use Combodo\iTop\Application\TwigBase\Controller\Controller;
use Combodo\iTop\Application\UI\Base\Component\Button\ButtonUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\DataTable\DataTableUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Html\Html;
use Combodo\iTop\Application\UI\Base\Component\Input\InputUIBlockFactory;
@@ -11,6 +12,7 @@ use Combodo\iTop\Application\UI\Base\Component\Input\Set\SetUIBlockFactory;
use Combodo\iTop\Application\UI\Base\Component\Panel\Panel;
use Combodo\iTop\Application\UI\Base\Layout\UIContentBlock;
use Combodo\iTop\Application\WebPage\iTopWebPage;
use Combodo\iTop\Controller\Newsroom\iTopNewsroomController;
use Combodo\iTop\Core\Trigger\Enum\SubscriptionPolicy;
use Combodo\iTop\Renderer\BlockRenderer;
use Combodo\iTop\Service\Notification\NotificationsRepository;
@@ -65,6 +67,13 @@ class NotificationsCenterController extends Controller
$sPictureUrl = UserRights::GetUserPictureAbsUrl();
$oNotificationsPanel->SetIcon($sPictureUrl,Panel::ENUM_ICON_COVER_METHOD_CONTAIN, true);
$oAllNewsPageButton = ButtonUIBlockFactory::MakeIconLink(
'fas fa-bell',
Dict::S('UI:NotificationsCenter:Panel:Toolbar:ViewAllNews:Title'),
Router::GetInstance()->GenerateUrl(iTopNewsroomController::ROUTE_NAMESPACE.'.view_all'),
);
$oNotificationsPanel->SetToolBlocks([$oAllNewsPageButton]);
$oNotificationsCenterTableColumns = [
'trigger' => array('label' => MetaModel::GetName('Trigger')),
'trigger_class' => array('label' => MetaModel::GetAttributeDef('Trigger', 'finalclass')->GetLabel()),