diff --git a/frontend-js/src/main/js/gui/admin/EditUserDialog.js b/frontend-js/src/main/js/gui/admin/EditUserDialog.js index c2841f5bc2ac48c89db9f15db03d097ba4f535cc..83dc923fb4739a7a2f9952e5266a1da72b6303e8 100644 --- a/frontend-js/src/main/js/gui/admin/EditUserDialog.js +++ b/frontend-js/src/main/js/gui/admin/EditUserDialog.js @@ -82,7 +82,7 @@ EditUserDialog.prototype.createGeneralTab = function (tabMenuDiv, tabContentDiv) self.addTab({ tabMenuDiv: tabMenuDiv, tabContentDiv: tabContentDiv, - name: "Details", + name: "DETAILS", content: self.createGeneralTabContent() }); @@ -96,7 +96,7 @@ EditUserDialog.prototype.generateTabId = function (tab_name) { if (login === undefined) { login = "new_user_" + (login_counter++); } - return login.replace(".", "_") + tab_name + "_TAB"; + return login.replace(".", "_") + tab_name.replace(" ", "_") + "_TAB"; }; EditUserDialog.prototype.createPrivilegesTab = function (tabMenuDiv, tabContentDiv) { @@ -104,7 +104,7 @@ EditUserDialog.prototype.createPrivilegesTab = function (tabMenuDiv, tabContentD self.addTab({ tabMenuDiv: tabMenuDiv, tabContentDiv: tabContentDiv, - name: "PRIVILEGES", + name: "GLOBAL PRIVILEGES", content: self.createPrivilegesTabContent() }); @@ -195,7 +195,8 @@ EditUserDialog.prototype.createGeneralTabContent = function () { EditUserDialog.prototype.createPrivilegesTabContent = function () { var self = this; var result = Functions.createElement({ - type: "div" + type: "div", + style: "margin-top:10px;" }); result.appendChild(self._createPrivilegesTable()); return result; @@ -224,7 +225,7 @@ EditUserDialog.prototype.createProjectsTab = function (tabMenuDiv, tabContentDiv self.addTab({ tabMenuDiv: tabMenuDiv, tabContentDiv: tabContentDiv, - name: "PROJECTS", + name: "PROJECT PRIVILEGES", content: self.createProjectsTabContent() }); }; @@ -232,7 +233,8 @@ EditUserDialog.prototype.createProjectsTab = function (tabMenuDiv, tabContentDiv EditUserDialog.prototype.createProjectsTabContent = function () { var self = this; var result = Functions.createElement({ - type: "div" + type: "div", + style: "margin-top:10px;" }); result.appendChild(self._createProjectsTable()); return result; @@ -244,13 +246,18 @@ EditUserDialog.prototype._createProjectsTable = function () { style: "margin-top:10px;" }); - var projectsTable = Functions.createElement({ + result.appendChild(Functions.createElement({ + type: "div", + name: "defaultProjectsRow", + style: "width:100%" + })); + + result.appendChild(Functions.createElement({ type: "table", name: "projectsTable", className: "display", style: "width:100%" - }); - result.appendChild(projectsTable); + })); return result; }; @@ -269,7 +276,7 @@ EditUserDialog.prototype.init = function () { paging: false, ordering: false, searching: false, - bInfo : false + bInfo: false }); var data = []; @@ -400,12 +407,30 @@ EditUserDialog.prototype.setProjects = function (projects) { var self = this; self._userByLogin = []; return self.createUserPrivilegeColumns().then(function (columns) { - var dataTable = $($("[name='projectsTable']", self.getElement())[0]).DataTable(); - var data = []; + var dataTable = $("[name='projectsTable']", self.getElement()).DataTable(); + var data = [], i; var rowData = self.projectToTableRow(null, columns); - data.push(rowData); - for (var i = 0; i < projects.length; i++) { + var defaultRow = $("[name='defaultProjectsRow']", self.getElement())[0]; + defaultRow.innerHTML = ""; + defaultRow.appendChild(Functions.createElement({ + type: "span", + content: rowData[0], + xss: false + })); + defaultRow.appendChild(Functions.createElement({type: "br"})); + for (i = 1; i < columns.length; i++) { + defaultRow.appendChild(Functions.createElement({ + type: "div", + content: rowData[i] + columns[i].title, + style: "float:left;padding:5px;", + xss: false + })); + } + defaultRow.appendChild(Functions.createElement({type: "br"})); + defaultRow.appendChild(Functions.createElement({type: "hr"})); + // data.push(rowData); + for (i = 0; i < projects.length; i++) { var project = projects[i]; rowData = self.projectToTableRow(project, columns); data.push(rowData); @@ -418,7 +443,7 @@ EditUserDialog.prototype.projectToTableRow = function (project, columns) { var user = this.getUser(); var row = []; var id = null; - var projectId = "[DEFAULT PRIVILEGE FOR NEW PROJECT]"; + var projectId = "<b>DEFAULT PRIVILEGE FOR NEW PROJECT</b>"; if (project !== null) { id = project.getId(); projectId = project.getProjectId();