Bug fixes & UI/UX improvements

revert-70aa11f8
charitha 8 years ago
parent 3b3dd8bbd7
commit cad686b43c

@ -525,7 +525,7 @@ var userModule = function () {
if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/user/policies/list")) {
permissions["LIST_POLICIES"] = true; permissions["LIST_POLICIES"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/add")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/devices/enroll")) {
permissions["ADD_DEVICE"] = true; permissions["ADD_DEVICE"] = true;
} }
if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/add")) { if (publicMethods.isAuthorized("/permission/admin/device-mgt/groups/add")) {

@ -73,11 +73,6 @@
{{/zone}} {{/zone}}
{{#zone "content"}} {{#zone "content"}}
<div class="row wr-device-board" style="margin-top: -10px;">
<div class="col-lg-12 wr-secondary-bar">
<span class="page-sub-title">{{title}}</span>
</div>
</div>
<div class="wr-device-list row"> <div class="wr-device-list row">
<div class="wr-hidden-operations wr-advance-operations"></div> <div class="wr-hidden-operations wr-advance-operations"></div>
<div class="col-md-12 wr-page-content"> <div class="col-md-12 wr-page-content">
@ -157,34 +152,41 @@
{{else}} {{else}}
<div id="ast-container" class="ast-container list-view"> <div id="ast-container" class="ast-container list-view">
<div class="ctrl-info-panel col-centered text-center wr-login"> <div class="ctrl-info-panel col-centered text-center wr-login">
<h2>You don't have any device <h3 class="text-muted">
<i class="fw fw-devices fw-3x"></i>
</h3>
<h3 class="text-muted">
You don't have any device
{{#if groupName}} {{#if groupName}}
assigned to this group assigned to this group
{{else}} {{else}}
registered enrolled
{{/if}} {{/if}}
at the moment.</h2> at the moment.
<br /> </h3>
<h3>
<p class="text-center">
{{#if groupName}} {{#if groupName}}
<a href="{{@app.context}}/devices" class="wr-btn"> <!--suppress HtmlUnknownTarget -->
<span class="fw-stack"> <a href="{{@app.context}}/devices" class="btn-operations btn-default">
<i class="fw fw-ring fw-stack-2x"></i> <span class="fw-stack">
<i class="fw fw-add fw-stack-1x"></i> <i class="fw fw-ring fw-stack-2x"></i>
</span> <i class="fw fw-add fw-stack-1x"></i>
</span>
Assign from My Devices Assign from My Devices
</a> </a>
{{else}} {{else}}
<a href="{{@app.context}}/device/enroll" class="wr-btn"> {{#if permissions.enroll}}
<span class="fw-stack"> <!--suppress HtmlUnknownTarget -->
<i class="fw fw-ring fw-stack-2x"></i> <a href="{{@app.context}}/device/enroll" class="btn-operations btn-default">
<i class="fw fw-add fw-stack-1x"></i> <span class="fw-stack">
</span> <i class="fw fw-ring fw-stack-2x"></i>
Enroll New Device <i class="fw fw-add fw-stack-1x"></i>
</a> </span>
Enroll New Device
</a>
{{/if}}
{{/if}} {{/if}}
</p> </h3>
</div> </div>
</div> </div>
{{/if}} {{/if}}

@ -79,18 +79,21 @@
{{else}} {{else}}
<div id="ast-container" class="ast-container list-view"> <div id="ast-container" class="ast-container list-view">
<div class="ctrl-info-panel col-centered text-center wr-login"> <div class="ctrl-info-panel col-centered text-center wr-login">
<h2>You don't have any group registered at the moment.</h2> <h3 class="text-muted">
<br /> <i class="fw fw-grouping fw-3x"></i>
</h3>
<h3 class="text-muted">You don't have any group registered at the moment</h3>
{{#if permissions.ADD_GROUP}} {{#if permissions.ADD_GROUP}}
<p class="text-center"> <h3>
<a href="{{@app.context}}/group/add" class="wr-btn"> <!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/group/add" class="btn-operations btn-default">
<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-add fw-stack-1x"></i> <i class="fw fw-add fw-stack-1x"></i>
</span> </span>
Add New Group Add New Group
</a> </a>
</p> </h3>
{{/if}} {{/if}}
</div> </div>
</div> </div>

@ -151,22 +151,26 @@ $.fn.datatables_extended = function(settings){
} }
function getAdvanceToolBar(){ function getAdvanceToolBar(){
if(table.hasClass('sorting-enabled')){ if (!table.hasClass('no-toolbar')) {
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + if (table.hasClass('sorting-enabled')) {
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' + return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' + '<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' + '<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' + '<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' + '<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>' '<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' +
'</ul>'
} else {
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>'
}
}else{ }else{
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + return '';
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' + }
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>'
};
} }

@ -15,38 +15,33 @@
specific language governing permissions and limitations specific language governing permissions and limitations
under the License. under the License.
}} }}
<div class="row wr-device-board">
<div class="col-lg-12 wr-secondary-bar">
<span class="page-sub-title">Device Types</span>
</div>
</div>
<div class="container-fluid"> <div class="container-fluid">
<span id="device-listing-status-msg"></span> <table class="table table-striped table-hover list-table no-operations display responsive nowrap data-table grid-view no-toolbar"
<table class="table table-striped table-hover list-table no-operations display responsive nowrap data-table grid-view" id="device-type-grid">
id="device-grid">
<thead> <thead>
<tr class="sort-row"> <tr class="sort-row">
<th class="no-sort"></th> <th class="no-sort"></th>
<th>By Device Type</th> <th>By Device Type</th>
<th class="no-sort"></th> <th class="no-sort"></th>
</tr> </tr>
<tr class="filter-row filter-box">
<th data-for="By Category" class="select-filter"></th>
<th data-for="By Device Type" class="text-filter"></th>
<th></th>
</tr>
</thead> </thead>
<tbody id="ast-container"> <tbody id="ast-container">
</tbody> </tbody>
</table> </table>
</div> </div>
<br class="c-both"/> <br class="c-both"/>
<div id="content-filter-types" style="display: none">
<div class="sort-title">Sort By</div>
<div class="sort-options">
<a href="#">By Device Type<span class="ico-sort-asc"></span></a>
</div>
</div>
{{#if virtualDeviceTypesList}} {{#if virtualDeviceTypesList}}
<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">
<span class="page-sub-title">Virtual Devices</span> <span class="page-sub-title">Virtual Device Types</span>
</div> </div>
</div> </div>
<h3 style="margin-left: 10px;">Don't have a device?</h3> <h3 style="margin-left: 10px;">Don't have a device?</h3>

@ -141,7 +141,7 @@ function loadDevices(searchType, searchParam){
compileTemplate(viewModel, deviceListingSrc); compileTemplate(viewModel, deviceListingSrc);
} }
} else { } else {
$('#device-grid').addClass('hidden'); $('#device-type-grid').addClass('hidden');
$('#device-listing-status-msg').html( $('#device-listing-status-msg').html(
'<div class="col-centered text-center"><h3 class="text-muted"><i class="fw fw-mobile fw-3x"></i>' + '<div class="col-centered text-center"><h3 class="text-muted"><i class="fw fw-mobile fw-3x"></i>' +
'</h3><h3 class="text-muted">No device type is available to be displayed.</h3>' + '</h3><h3 class="text-muted">No device type is available to be displayed.</h3>' +
@ -167,7 +167,7 @@ function compileTemplate(viewModel, templateSrc){
$("#ast-container").html($("#ast-container").html() + template(viewModel)); $("#ast-container").html($("#ast-container").html() + template(viewModel));
compiledDeviceTypesCount++; compiledDeviceTypesCount++;
if(deviceTypeCount == compiledDeviceTypesCount){ if(deviceTypeCount == compiledDeviceTypesCount){
$('#device-grid').datatables_extended({"bFilter": true, "order": [[ 1, "asc" ]]}); $('#device-type-grid').datatables_extended({"bFilter": false, "order": [[ 1, "asc" ]]});
} }
}); });
} }
@ -194,7 +194,7 @@ function openCollapsedNav(){
*/ */
$(document).ready(function () { $(document).ready(function () {
loadDevices(); loadDevices();
//$('#device-grid').datatables_extended(); //$('#device-type-grid').datatables_extended();
/* Adding selected class for selected devices */ /* Adding selected class for selected devices */
$(deviceCheckbox).each(function () { $(deviceCheckbox).each(function () {

@ -22,14 +22,6 @@
{{/zone}} {{/zone}}
{{#zone "navMenu-items"}} {{#zone "navMenu-items"}}
{{#if permissions.VIEW_DASHBOARD}}
<li>
<a href="{{@app.context}}">
<i class="fw fw-dashboard"></i>
Admin Dashboard
</a>
</li>
{{/if}}
{{#if permissions.LIST_OWN_DEVICES}} {{#if permissions.LIST_OWN_DEVICES}}
<li> <li>
<a href="{{@app.context}}/devices"> <a href="{{@app.context}}/devices">

@ -309,14 +309,34 @@ var responsiveTextRatio = 0.2,
} }
}); });
//Append advance operations to list table toolbar function getAdvanceToolBar() {
$('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html('' + if (!table.hasClass('no-toolbar')) {
'<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' + if (table.hasClass('sorting-enabled')) {
'<li><button data-click-event="toggle-selected" class="btn btn-default btn-primary">Select All</li>' + return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' + '<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' + '<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>'+dropdownmenu[0].outerHTML+'</li>' + '<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'</ul>' '<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'<li><button class="btn btn-default" data-toggle="dropdown"><i class="fw fw-sort"></i></button>' + dropdownmenu[0].outerHTML + '</li>' +
'</ul>'
} else {
return '<ul class="nav nav-pills navbar-right remove-margin" role="tablist">' +
'<li><button data-click-event="toggle-selectable" class="btn btn-default btn-primary select-enable-btn">Select</li>' +
'<li><button data-click-event="toggle-selected" id="dt-select-all" class="btn btn-default btn-primary disabled">Select All</li>' +
'<li><button data-click-event="toggle-list-view" data-view="grid" class="btn btn-default"><i class="fw fw-grid"></i></button></li>' +
'<li><button data-click-event="toggle-list-view" data-view="list" class="btn btn-default"><i class="fw fw-list"></i></button></li>' +
'</ul>'
}
} else {
return '';
}
}
/**
* append advance operations to list table toolbar
*/
$('.dataTable.list-table').closest('.dataTables_wrapper').find('.dataTablesTop .dataTables_toolbar').html(
getAdvanceToolBar()
); );
//Sorting dropdown menu select function //Sorting dropdown menu select function

Loading…
Cancel
Save