enable role filtering and role count in device cloud

revert-70aa11f8
kamidu 8 years ago
parent cda0dd417f
commit 530e603fb5

@ -50,45 +50,66 @@
{{/zone}} {{/zone}}
{{#zone "content"}} {{#zone "content"}}
<div id="loading-content" class="col-centered"> {{#if hasRoles}}
{{#unless isCloud}} <div id="loading-content" class="col-centered">
{{#if removePermitted}} {{#unless isCloud}}
<input type="hidden" id="can-remove" value="true"/> {{#if removePermitted}}
<input type="hidden" id="can-remove" value="true"/>
{{/if}}
{{#if editPermitted}}
<input type="hidden" id="can-edit" value="true"/>
{{/if}}
{{/unless}}
{{#if isCloud}}
<input type="hidden" id="is-cloud" value="true"/>
{{/if}} {{/if}}
{{#if editPermitted}} <i class="fw fw-settings fw-spin fw-2x"></i>
<input type="hidden" id="can-edit" value="true"/> Loading roles . . .
{{/if}} <br>
{{/unless}} </div>
{{#if isCloud}}
<input type="hidden" id="is-cloud" value="true"/> <div id="role-table" data-cloud={{isCloud}} data-role={{adminRole}}>
{{/if}} <table class="table table-striped table-hover list-table display responsive nowrap data-table grid-view"
<i class="fw fw-settings fw-spin fw-2x"></i> id="role-grid">
Loading roles . . . <thead>
<br> <tr class="sort-row">
</div> <th>By Role Name</th>
</tr>
<tr class="bulk-action-row">
<th colspan="3"></th>
</tr>
</thead>
<tbody id="ast-container" data-app-context="{{@app.context}}/"></tbody>
</table>
</div>
<div id="role-table" data-cloud={{isCloud}} data-role={{adminRole}}> <div id="content-filter-types" style="display: none">
<table class="table table-striped table-hover list-table display responsive nowrap data-table grid-view" <div class="sort-title">Sort By</div>
id="role-grid"> <div class="sort-options">
<thead> <!--suppress HtmlUnknownTag -->
<tr class="sort-row"> <th>By Role name</th>
<th>By Role Name</th> </div>
</tr> </div>
<tr class="bulk-action-row">
<th colspan="3"></th> {{else}}
</tr>
</thead>
<tbody id="ast-container" data-app-context="{{@app.context}}/"></tbody>
</table>
</div>
<div id="content-filter-types" style="display: none"> <div id="user-created-msg" class="container col-centered wr-content">
<div class="sort-title">Sort By</div> <div class="wr-form">
<div class="sort-options"> <p class="page-sub-title">You Haven't created roles yet.</p>
<!--suppress HtmlUnknownTag --> <br>Please click <b>"Add A New Role"</b>, if you wish to add a role.
<th>By Role name</th> <hr/>
<a href="{{@app.context}}/role/add" class="cu-btn-inner">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-add fw-stack-1x"></i>
</span>
Add Role
</a>
</div>
</div> </div>
</div>
{{/if}}
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}

@ -33,6 +33,16 @@ function onRequest(context) {
context["adminRole"] = deviceMgtProps["adminRole"]; context["adminRole"] = deviceMgtProps["adminRole"];
context["isCloud"] = deviceMgtProps["isCloud"]; context["isCloud"] = deviceMgtProps["isCloud"];
var roleCount = userModule.getRolesCount()
if (deviceMgtProps["isCloud"]) {
roleCount = userModule.getFilteredRoles("devicemgt").content.count;
}
if (roleCount > 0) {
context["hasRoles"] = true;
} else {
context["hasRoles"] = false;
}
return context; return context;
} }
Loading…
Cancel
Save