revert-70aa11f8
dilanua 8 years ago
commit 106051a0a5

@ -19,7 +19,6 @@
{{unit "cdmf.unit.lib.service-invoker-utility"}} {{unit "cdmf.unit.lib.service-invoker-utility"}}
{{unit "cdmf.unit.lib.handlebars"}} {{unit "cdmf.unit.lib.handlebars"}}
{{unit deviceViewUnitName}}
{{#zone "breadcrumbs"}} {{#zone "breadcrumbs"}}
<li> <li>
@ -40,6 +39,7 @@
{{/zone}} {{/zone}}
{{#zone "content"}} {{#zone "content"}}
{{unit deviceViewUnitName}}
{{unit "cdmf.unit.lib.data-table"}} {{unit "cdmf.unit.lib.data-table"}}
{{unit "cdmf.unit.device.operation-mod"}} {{unit "cdmf.unit.device.operation-mod"}}
{{unit "cdmf.unit.device.view"}} {{unit "cdmf.unit.device.view"}}

@ -15,6 +15,7 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
{{#zone "contentTitle"}} {{#zone "contentTitle"}}
<div class="row wr-device-board"> <div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar"> <div class="col-lg-12 wr-secondary-bar">
@ -32,6 +33,7 @@
</div> </div>
{{/zone}} {{/zone}}
{{#zone "content"}}
<div class="row no-gutter add-padding-5x add-margin-top-5x" <div class="row no-gutter add-padding-5x add-margin-top-5x"
style="border: 1px solid #e4e4e4;"> style="border: 1px solid #e4e4e4;">
<div class="media"> <div class="media">
@ -193,7 +195,7 @@
</div> </div>
{{/defineZone}} {{/defineZone}}
</div> </div>
{{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
{{js "js/device-view.js"}} {{js "js/device-view.js"}}
<script id="policy-view" src="{{@unit.publicUri}}/templates/policy-compliance.hbs" <script id="policy-view" src="{{@unit.publicUri}}/templates/policy-compliance.hbs"

@ -15,6 +15,7 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
{{#zone "content"}}
<span id="permission" data-permission="{{permissions}}"></span> <span id="permission" data-permission="{{permissions}}"></span>
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
@ -27,8 +28,7 @@
<div class="wr-advance-operations"> <div class="wr-advance-operations">
<div class="row no-gutter"> <div class="row no-gutter">
<div class="wr-hidden-operations-nav col-lg-4"> <div class="wr-hidden-operations-nav col-lg-4">
<a id="unReadNotifications" href="javascript:void(0)" <a id="unReadNotifications" href="javascript:void(0)" onclick="showAdvanceOperation('unread', this)" class="selected">
onclick="showAdvanceOperation('unread', this)" class="selected">
<span class="wr-hidden-operations-icon fw-stack"> <span class="wr-hidden-operations-icon fw-stack">
<i class="fw fw-mail fw-stack-2x"></i> <i class="fw fw-mail fw-stack-2x"></i>
</span> </span>
@ -53,9 +53,10 @@
<!-- /content --> <!-- /content -->
</div> </div>
</div> </div>
{{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<script id="notification-listing" data-current-user="{{currentUser.username}}" <script id="notification-listing" data-current-user="{{currentUser.username}}"
data-image-resource="{{self.publicURL}}/images/" src="{{self.publicURL}}/templates/notification-listing.hbs" data-image-resource="{{@unit.publicUri}}/images/" src="{{@unit.publicUri}}/templates/notification-listing.hbs"
type="text/x-handlebars-template"></script> type="text/x-handlebars-template"></script>
{{js "js/notification-listing.js"}} {{js "js/notification-listing.js"}}
{{/zone}} {{/zone}}

@ -19,12 +19,13 @@
function onRequest(context) { function onRequest(context) {
var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var constants = require("/app/modules/constants.js"); var constants = require("/app/modules/constants.js");
var viewModel = {};
var permissions = []; var permissions = [];
if (userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/notifications/list")) { if (userModule.isAuthorized("/permission/admin/device-mgt/emm-admin/notifications/list")) {
permissions.push("LIST_NOTIFICATIONS"); permissions.push("LIST_NOTIFICATIONS");
} }
var currentUser = session.get(constants.USER_SESSION_KEY); var currentUser = session.get(constants.USER_SESSION_KEY);
context.permissions = stringify(permissions); viewModel.permissions = stringify(permissions);
context.currentUser = currentUser; viewModel.currentUser = currentUser;
return context; return viewModel;
} }

@ -91,8 +91,8 @@ function loadNotifications(){
var successCallback = function (data) { var successCallback = function (data) {
var viewModel = {}; var viewModel = {};
data = JSON.parse(data); data = JSON.parse(data);
viewModel.notifications = data; viewModel.notifications = data.notifications;
if(data.length > 0){ if(data.count > 0){
var content = template(viewModel); var content = template(viewModel);
$("#ast-container").html(content); $("#ast-container").html(content);
$('#unread-notifications').datatables_extended(); $('#unread-notifications').datatables_extended();

@ -16,10 +16,10 @@
<tbody> <tbody>
{{#each notifications}} {{#each notifications}}
{{#equal "NEW" status }} {{#equal "NEW" status }}
<tr data-type="selectable" data-id="{{notificationId}}"> <tr data-type="selectable" data-id="{{id}}">
<td data-display="{{description}}" data-grid-label="Description">{{description}}</td> <td data-display="{{description}}" data-grid-label="Description">{{description}}</td>
<td style="text-align: center;"> <td style="text-align: center;">
<a href="#" data-id="{{notificationId}}" data-url="device/{{deviceIdentifier.type}}/{{deviceIdentifier.id}}" class="new-notification" data-click-event="remove-form"> <a href="device?type={{deviceIdentifier.type}}&id={{deviceIdentifier.id}}" data-id="{{id}}" data-url="device?type={{deviceIdentifier.type}}&id={{deviceIdentifier.id}}" class="new-notification" data-click-event="remove-form">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i> <i class="fw fw-view fw-stack-1x"></i>
@ -54,10 +54,10 @@
</thead> </thead>
<tbody> <tbody>
{{#each notifications}} {{#each notifications}}
<tr data-type="selectable" data-id="{{notificationId}}"> <tr data-type="selectable" data-id="{{id}}">
<td data-display="{{description}}" data-grid-label="Description">{{description}}</td> <td data-display="{{description}}" data-grid-label="Description">{{description}}</td>
<td style="text-align: center;"> <td style="text-align: center;">
<a href="device/{{deviceIdentifier.type}}/{{deviceIdentifier.id}}" data-click-event="remove-form"> <a href="device?type={{deviceIdentifier.type}}&id={{deviceIdentifier.id}}" data-click-event="remove-form">
<span class="fw-stack"> <span class="fw-stack">
<i class="fw fw-ring fw-stack-2x"></i> <i class="fw fw-ring fw-stack-2x"></i>
<i class="fw fw-view fw-stack-1x"></i> <i class="fw fw-view fw-stack-1x"></i>

@ -50,6 +50,10 @@
{ {
"url": "/api/data-tables/invoker", "url": "/api/data-tables/invoker",
"path": "/api/data-tables-invoker-api.jag" "path": "/api/data-tables-invoker-api.jag"
},
{
"url": "/api/operation/*",
"path": "/api/operation-api.jag"
} }
] ]
} }
Loading…
Cancel
Save