Refactoring notifications side-pane - EMM UI

merge-requests/1/head
dilanua 8 years ago
parent b65e99a4a7
commit 00448814e8

@ -94,10 +94,11 @@
{{#zone "sidePanes"}} {{#zone "sidePanes"}}
<!--suppress HtmlUnknownAttribute --> <!--suppress HtmlUnknownAttribute -->
<div class="sidebar-wrapper" id="right-sidebar" is-authorized="{{permissions.LIST_NOTIFICATIONS}}" <div class="sidebar-wrapper" id="right-sidebar" is-authorized="{{permissions.LIST_NOTIFICATIONS}}"
data-side="right" data-width="320" data-sidebar-fixed="true" data-fixed-offset="50" data-spy="affix" data-side="right" data-width="320" data-sidebar-fixed="true" data-fixed-offset="60" data-spy="affix"
data-offset-top="80"> data-offset-top="80">
<ul class="sidebar-messages"> <br>
</ul> <ul class="sidebar-messages"></ul>
<br>
<div class="text-center"><a href="{{appContext}}notification-listing" class="btn btn-primary">Show all notifications</a></div> <div class="text-center"><a href="{{appContext}}notification-listing" class="btn btn-primary">Show all notifications</a></div>
</div> </div>
{{/zone}} {{/zone}}

@ -128,22 +128,22 @@ function loadNewNotifications() {
if (responsePayload["notifications"]) { if (responsePayload["notifications"]) {
if (responsePayload.count > 0) { if (responsePayload.count > 0) {
viewModel["notifications"] = responsePayload["notifications"]; viewModel["notifications"] = responsePayload["notifications"];
viewModel["appContext"] = context; // viewModel["appContext"] = context;
$(messageSideBar).html(template(viewModel)); $(messageSideBar).html(template(viewModel));
} else { } else {
$(messageSideBar).html('<div class="alert alert-info" role="alert"><i class="icon fw fw-info"></i>No new notifications found...</div>'); $(messageSideBar).html("<h4 class='text-center'>No new notifications found</h4>");
} }
} else { } else {
$(messageSideBar).html("<h4 class ='message-danger'>Unexpected error " + $(messageSideBar).html("<h4 class ='message-danger text-center'>Unexpected error " +
"occurred while loading new notifications.</h4>"); "occurred while loading new notifications</h4>");
} }
} }
}, },
// on error // on error
function (jqXHR) { function (jqXHR) {
if (jqXHR.status = 500) { if (jqXHR.status = 500) {
$(messageSideBar).html("<h4 class ='message-danger'>Unexpected error occurred while trying " + $(messageSideBar).html("<h4 class ='message-danger text-center'>Unexpected error occurred while trying " +
"to retrieve any new notifications.</h4>"); "to retrieve any new notifications</h4>");
} }
} }
); );

Loading…
Cancel
Save