mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-12 12:33:26 +00:00
Fix #1189 notifications display is broken
This commit is contained in:
@@ -103,9 +103,9 @@ class Notifications implements ControllerProviderInterface
|
||||
$app->abort(400);
|
||||
}
|
||||
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
$page = (int) $request->query->get('page', 0);
|
||||
|
||||
return $app->json($app['events-manager']->get_json_notifications(($page < 1 ? 1 : $page)));
|
||||
return $app->json($app['events-manager']->get_notifications_as_array(($page < 0 ? 0 : $page)));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -111,7 +111,7 @@ class eventsmanager_broker
|
||||
return true;
|
||||
}
|
||||
|
||||
public function get_json_notifications($page = 0)
|
||||
public function get_notifications_as_array($page = 0)
|
||||
{
|
||||
$unread = 0;
|
||||
$total = 0;
|
||||
@@ -178,7 +178,7 @@ class eventsmanager_broker
|
||||
$data['next'] = '<a href="#" onclick="print_notifications(' . ((int) $page + 1) . ');return false;">' . _('charger d\'avantages de notifications') . '</a>';
|
||||
}
|
||||
|
||||
return p4string::jsonencode($data);
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function get_unread_notifications_number()
|
||||
|
@@ -135,11 +135,6 @@
|
||||
</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<div style="display:none;z-index:30000;" id="notification_box">
|
||||
{% set notifications = app['events-manager'].get_notifications %}
|
||||
{% include 'prod/notifications.html.twig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<li>
|
||||
{% if app['authentication'].isAuthenticated() %}
|
||||
@@ -194,8 +189,12 @@
|
||||
{% endif %}
|
||||
</li>
|
||||
</ol>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% if app['authentication'].isAuthenticated() and (module == "client" or module == "prod") %}
|
||||
<div style="display:none;z-index:30000;" id="notification_box">
|
||||
{% set notifications = app['events-manager'].get_notifications %}
|
||||
{% include 'prod/notifications.html.twig' %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -129,7 +129,7 @@ function set_notif_position()
|
||||
if(trigger.length === 0)
|
||||
return;
|
||||
$('#notification_box').css({
|
||||
'left':Math.round(trigger.offset().left)
|
||||
'left':Math.round(trigger.offset().left - 1)
|
||||
});
|
||||
}
|
||||
$(window).bind('resize', function(){
|
||||
@@ -173,7 +173,7 @@ function print_notifications(page)
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "GET",
|
||||
url: "/user/notifications/",
|
||||
dataType : 'json',
|
||||
data: {
|
||||
|
Reference in New Issue
Block a user