You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stratos.apache.org by la...@apache.org on 2014/11/11 12:32:00 UTC
[6/8] stratos git commit: fix left menu issue on user and tenant add
view
fix left menu issue on user and tenant add view
Project: http://git-wip-us.apache.org/repos/asf/stratos/repo
Commit: http://git-wip-us.apache.org/repos/asf/stratos/commit/d7c556e1
Tree: http://git-wip-us.apache.org/repos/asf/stratos/tree/d7c556e1
Diff: http://git-wip-us.apache.org/repos/asf/stratos/diff/d7c556e1
Branch: refs/heads/master
Commit: d7c556e19fa7ecfc722871282a3991f91b5a6913
Parents: 48af1a1
Author: Dakshika Jayathilaka <si...@gmail.com>
Authored: Tue Nov 11 11:05:21 2014 +0530
Committer: lasinducharith <la...@gmail.com>
Committed: Tue Nov 11 16:58:19 2014 +0530
----------------------------------------------------------------------
.../console/users_form.jag | 38 ++++++++++++--------
1 file changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/stratos/blob/d7c556e1/components/org.apache.stratos.manager.console/console/users_form.jag
----------------------------------------------------------------------
diff --git a/components/org.apache.stratos.manager.console/console/users_form.jag b/components/org.apache.stratos.manager.console/console/users_form.jag
index 0bce660..7700aa6 100644
--- a/components/org.apache.stratos.manager.console/console/users_form.jag
+++ b/components/org.apache.stratos.manager.console/console/users_form.jag
@@ -21,40 +21,47 @@
*/
//add login validator for pages
include('/controllers/login/validator.jag');
+include('/controllers/menu/menu_generator.jag');
var log = new Log("apacheStratos.users");
-var error=[];
+var error = [];
var caramel = require('caramel'),
- util = require('/controllers/rest/rest_calls.jag'),
- uriMatcher = new URIMatcher(request.getRequestURI()),
- elements = uriMatcher.match('/{context}/users/{formtype}/'),
- list_data,
- isForm = false;
+ util = require('/controllers/rest/rest_calls.jag'),
+ uriMatcher = new URIMatcher(request.getRequestURI()),
+ elements = uriMatcher.match('/{context}/users/{formtype}/'),
+ context = caramel.configs().context,
+ menuJson = require('/controllers/menu/menu.json'),
+ userPermissions = session.get('PERMISSIONS'),
+ list_data,
+ isForm = false;
-if(!elements){
+if (!elements) {
elements = uriMatcher.match('/{context}/users/{formtype}/{action}/');
isForm = true;
}
+//create left menu
+var leftMenu = menuGenerator(context, menuJson.menu, userPermissions);
+
var formData = require('controllers/forms/schema/users/' + elements.formtype + '.json'),
formDataRaw = require('controllers/forms/default/users/' + elements.formtype + '.json'),
formTitle = formData.title;
-if(elements.formtype == 'users'){
- list_data = util.RESTCalls.getUserList();
- if(list_data.userInfoBean && list_data.userInfoBean.length === 0){
+if (elements.formtype == 'users') {
+ list_data = util.RESTCalls.getUserList();
+ if (list_data.userInfoBean && list_data.userInfoBean.length === 0) {
list_data = null;
}
-}else if(elements.formtype == 'tenants'){
- list_data = util.RESTCalls.getTenants();
- if(list_data.tenantInfoBean && list_data.tenantInfoBean.length === 0){
+} else if (elements.formtype == 'tenants') {
+ list_data = util.RESTCalls.getTenants();
+ if (list_data.tenantInfoBean && list_data.tenantInfoBean.length === 0) {
list_data = null;
}
}
//check user has permission to access endpoints
-if( list_data != null && list_data.hasOwnProperty('Error')){
+if (list_data != null && list_data.hasOwnProperty('Error')) {
error.push(list_data.Error);
}
@@ -62,10 +69,11 @@ caramel.render({
breadcrumbPathLevelOne: 'users',
breadcrumbPathLevelTwo: elements.formtype,
isForm: isForm,
- formTitle: formTitle,
+ formTitle: formTitle,
formDataRaw: JSON.stringify(formDataRaw),
formData: JSON.stringify(formData),
list_data: list_data,
+ left_menu: leftMenu,
error: error
});