check if the project has the userMetadata

This commit is contained in:
Jacky 2017-11-15 23:20:44 -05:00
parent c2db998b93
commit 1ad40bcd83
2 changed files with 17 additions and 14 deletions

View File

@ -108,19 +108,22 @@ Refine.OpenProjectUI.prototype._renderProjects = function(data) {
var project = data.projects[n];
project.id = n;
project.date = moment(project.modified).format('YYYY-MM-DD HH:mm A');
for (var n in data.customMetadataColumns) {
var found = false;
for(var i = 0; i < project.userMetadata.length; i++) {
if (project.userMetadata[i].name === data.customMetadataColumns[n].name) {
found = true;
break;
}
if (!found) {
project.userMetadata.push({
name: data.customMetadataColumns[n].name,
dispay: data.customMetadataColumns[n].display,
value: ""
});
if (typeof project.userMetadata !== "undefined") {
for (var n in data.customMetadataColumns) {
var found = false;
for(var i = 0; i < project.userMetadata.length; i++) {
if (project.userMetadata[i].name === data.customMetadataColumns[n].name) {
found = true;
break;
}
if (!found) {
project.userMetadata.push({
name: data.customMetadataColumns[n].name,
dispay: data.customMetadataColumns[n].display,
value: ""
});
}
}
}
}

View File

@ -118,7 +118,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}
#metadata-body td {
padding: 8px
padding: 1px
}
#metadata-body tr:nth-child(even) {background: #f2f2f2}