Set trigger to display add group popup

application-manager-new
charithag 9 years ago
parent 9f99e6e4da
commit 91ab732dba

@ -30,62 +30,64 @@
</div> </div>
</div> </div>
</div> </div>
{{#if permissions.ADD_USER}}
<div class="col-md-4"> <div class="col-md-4">
<div class="wr-stats-board-tile"> <div class="wr-stats-board-tile">
<div class="tile-name">Users</div> <div class="tile-name">Groups</div>
<div> <div>
<div class="tile-icon"><i class="fw fw-user"></i></div> <div class="tile-icon"><i class="fw fw-policy"></i></div>
<div class="tile-stats"> <div class="tile-stats">
<span id="user-count">Loading...</span> <span id="group-count">Loading...</span>
<span class="tile-stats-free"> <span class="tile-stats-free">
<a href="users/"> <a href="groups">
<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>
</span> </span>
View View
</a> </a>
<!--<a href="user-create.html">--> <a href="groups/add-group">
<!--<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--> Add
<!--</a>--> </a>
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{/if}}
{{#if permissions.ADD_USER}}
<div class="col-md-4"> <div class="col-md-4">
<div class="wr-stats-board-tile"> <div class="wr-stats-board-tile">
<div class="tile-name">Groups</div> <div class="tile-name">Users</div>
<div> <div>
<div class="tile-icon"><i class="fw fw-policy"></i></div> <div class="tile-icon"><i class="fw fw-user"></i></div>
<div class="tile-stats"> <div class="tile-stats">
<span id="group-count">Loading...</span> <span id="user-count">Loading...</span>
<span class="tile-stats-free"> <span class="tile-stats-free">
<a href="groups"> <a href="users/">
<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>
</span> </span>
View View
</a> </a>
<a href="groups/add-group"> <!--<a href="user-create.html">-->
<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 <!--Add-->
</a> <!--</a>-->
</span> </span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
{{/if}}
<div class="col-md-4"> <div class="col-md-4">
<div class="wr-stats-board-tile"> <div class="wr-stats-board-tile">

@ -64,7 +64,14 @@ $(document).ready(function () {
return $("#content-filter-types").html(); return $("#content-filter-types").html();
} }
}); });
loadGroups();
changeGroupView('grid', $('a.ctrl-filter-grid')); changeGroupView('grid', $('a.ctrl-filter-grid'));
var path = window.location.pathname;
if (path == '/iotserver/groups/add-group'){
addNewGroup();
}
}); });
/* /*
@ -168,9 +175,6 @@ function loadGroups(searchType, searchParam) {
}); });
}); });
} }
$(document).ready(function () {
loadGroups();
});
function formatDates() { function formatDates() {
$(".formatDate").each(function () { $(".formatDate").each(function () {
@ -236,7 +240,10 @@ function attachGroupAdding() {
* when a user clicks on "Remove" link * when a user clicks on "Remove" link
* on Group Management page in WSO2 IoT Server Console. * on Group Management page in WSO2 IoT Server Console.
*/ */
$("a.add-group-link").click(function () { $("a.add-group-link").click(addNewGroup);
}
var addNewGroup = function () {
var addGroupApi = "/iotserver/api/group/add"; var addGroupApi = "/iotserver/api/group/add";
$(modalPopupContent).html($('#add-group-modal-content').html()); $(modalPopupContent).html($('#add-group-modal-content').html());
showPopup(); showPopup();
@ -287,7 +294,6 @@ function attachGroupAdding() {
hidePopup(); hidePopup();
}); });
});
} }
/** /**

Loading…
Cancel
Save