Commit 05d56e72 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Default privileges for new projects are moved from the table

parent 1c9157a1
......@@ -244,13 +244,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 +274,7 @@ EditUserDialog.prototype.init = function () {
paging: false,
ordering: false,
searching: false,
bInfo : false
bInfo: false
});
var data = [];
......@@ -400,12 +405,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 +441,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();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment