GoalModelEditor/FrontEnd/public/js/dashboard.js
/**
 * Function for parsing the project JSON
 *
 * @param {object/json} project
 * @return HTMLElement
 */
Function for parsing the project JSON
@param {object/json} project
@return HTMLElement
Function for parsing the project JSON @param { object / json } project @return HTMLElement
function parseProject(project) {
    let projectHTML =
        '<div class="project" id="' + project.project_id + '">';
    projectHTML += '<div class="row border-bottom py-3 project_header text-color">';
    projectHTML =
        projectHTML +
        '<div class="col-1 btn btn-sm collapse-btn fas fa-plus-square mt-1">' +
        '</div>';
    projectHTML =
        projectHTML +
        '<div class="col-3">' +
        '<div class="row">' +
        '<div class="col-2 folder-icon text-right"><i class="far fa-folder"></i></div>' +
        '<div class="project_name col-8">' + project.project_name + '</div></div></div>';
    projectHTML =
        projectHTML +
        '<div class="col-4 text-center project_last_modified"></div>';
    projectHTML = projectHTML + '<div class="col-2 text-center"></div>';
    projectHTML =
        projectHTML +
        '<div class="col-1 new-model text-center model show" data-toggle="modal"' +
        'data-target="#add-model" title="Add a new model">' +
        '<i class="fas fa-plus"></i>' +
        '<div class="instruction" id = "add_' + project.project_id + '" ' +
        'data-placement="bottom" data-toggle="popover" ' +
        'data-content="Click here to create a motivational model."></div>' +
        '</div>';
    projectHTML =
        projectHTML +
        '<div class="col-1 text-center more">' +
        '<a class="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' +
        '<i class="fas fa-align-justify"></i></a>' +
        '<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">' +
        '<a class="dropdown-item rename-project"><i class="fas fa-edit"></i>Rename</a>' +
        '<a class="dropdown-item delete-project"><i class="fas fa-trash"></i>Delete</a>' +
        '</div></div>';
    projectHTML = projectHTML + '</div>';
    projectHTML = projectHTML + '<div id="models_' + project.project_id + '" class="collapse model-list">';
    if (project.models) {
        projectHTML = parseGoalModelList(project.models, projectHTML);
    }
    projectHTML = projectHTML + "</div>";
    return projectHTML;
}
function parseProject ( project ) { let projectHTML = '<div class="project" id="' + project . project_id + '">' ; projectHTML += '<div class="row border-bottom py-3 project_header text-color">' ; projectHTML = projectHTML + '<div class="col-1 btn btn-sm collapse-btn fas fa-plus-square mt-1">' + '</div>' ; projectHTML = projectHTML + '<div class="col-3">' + '<div class="row">' + '<div class="col-2 folder-icon text-right"><i class="far fa-folder"></i></div>' + '<div class="project_name col-8">' + project . project_name + '</div></div></div>' ; projectHTML = projectHTML + '<div class="col-4 text-center project_last_modified"></div>' ; projectHTML = projectHTML + '<div class="col-2 text-center"></div>' ; projectHTML = projectHTML + '<div class="col-1 new-model text-center model show" data-toggle="modal"' + 'data-target="#add-model" title="Add a new model">' + '<i class="fas fa-plus"></i>' + '<div class="instruction" id = "add_' + project . project_id + '" ' + 'data-placement="bottom" data-toggle="popover" ' + 'data-content="Click here to create a motivational model."></div>' + '</div>' ; projectHTML = projectHTML + '<div class="col-1 text-center more">' + '<a class="dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">' + '<i class="fas fa-align-justify"></i></a>' + '<div class="dropdown-menu" aria-labelledby="dropdownMenuLink">' + '<a class="dropdown-item rename-project"><i class="fas fa-edit"></i>Rename</a>' + '<a class="dropdown-item delete-project"><i class="fas fa-trash"></i>Delete</a>' + '</div></div>' ; projectHTML = projectHTML + '</div>' ; projectHTML = projectHTML + '<div id="models_' + project . project_id + '" class="collapse model-list">' ; if ( project . models ) { projectHTML = parseGoalModelList ( project . models , projectHTML ) ; } projectHTML = projectHTML + "</div>" ; return projectHTML ; }
Function for parsing the project JSON
 @param {object/json} project
 @return HTMLElement
Function for parsing the project JSON @param { object / json } project @return HTMLElement
// Single project container // Project-header // Collapse button // Project name // Last modified // To make the view better // Add new model button // More options - rename/delete // Close the row and header div // Goal model list // Goal models if any // Close the goal model list