Commit 5b247a12 authored by TheJeremail's avatar TheJeremail
Browse files

Fixes (01)

parent da5e856b
......@@ -15,7 +15,7 @@ updateTeamData();
setInterval(updateTeamData, 120000);
setTimeout(updates_check, 10000);
setInterval(sessionKeepAlive, 20000);
setInterval(update_dashboard, 5000);
//setInterval(update_dashboard, 5000);
setInterval(validateSession, 50000);
//setInterval(updateNotificationBadge, 10000);
if (window.location.hash.substring(1, 6) == "graph") {
......@@ -32,7 +32,7 @@ if (window.location.hash.substring(1, 6) == "graph") {
jmcjs.events.triggerEvent("nav", window.location.hash.substring(1, window.location.hash.length));
setTimeout(loadGraph, 5);
setInterval(getNews, 3000);
//setTimeout("log_message('Workspace Loading...')",10);
setTimeout("log_message('Workspace Loading...')",10);
//Init Navigation
jmcjs.route.init();
......@@ -39,6 +39,7 @@
"leaderboard_label_completed": "Completed Tasks",
"leaderboard_label_HMRatio": "H/M Ratio",
"leaderboard_label_Rank": "Rank",
"leaderboard_label_Pending": "Pending",
"milestone_schedule_ontrack": "On Track",
"milestone_schedule_danger": "Danger",
......
......@@ -153,7 +153,7 @@ function node_edit_assignee_add(object) {
}
}
listItems += '</select></div>';
object.parentElement.childNodes[2].innerHTML = listItems;
object.parentElement.childNodes[3].innerHTML = listItems;
object.childNodes[0].innerText = "save";
object.setAttribute("onclick", "node_edit_assignee_add_done(this)");
}
......@@ -182,20 +182,20 @@ function node_edit_assignee_remove(object) {
}
}
listItems += '</select></div>';
object.parentElement.childNodes[2].innerHTML = listItems;
object.parentElement.childNodes[3].innerHTML = listItems;
object.childNodes[0].innerText = "save";
object.setAttribute("onclick", "node_edit_assignee_remove_done(this)");
}
function node_edit_assignee_add_done(object) {
object.parentElement.style.visibility = "hidden";
console.log(sync_get("?addAssignees&node=" + currentDetailNode + "&assignees=" + encodeURIComponent(JSON.stringify([possibleMembers[object.parentElement.childNodes[2].childNodes[0].childNodes[0].selectedIndex]]))));
console.log(sync_get("?addAssignees&node=" + currentDetailNode + "&assignees=" + encodeURIComponent(JSON.stringify([possibleMembers[object.parentElement.childNodes[3].childNodes[0].childNodes[0].selectedIndex]]))));
getNews();
}
function node_edit_assignee_remove_done(object) {
object.parentElement.style.visibility = "hidden";
console.log(sync_get("?removeAssignees&node=" + currentDetailNode + "&assignees=" + encodeURIComponent(JSON.stringify([possibleMembers[object.parentElement.childNodes[2].childNodes[0].childNodes[0].selectedIndex]]))));
console.log(sync_get("?removeAssignees&node=" + currentDetailNode + "&assignees=" + encodeURIComponent(JSON.stringify([possibleMembers[object.parentElement.childNodes[3].childNodes[0].childNodes[0].selectedIndex]]))));
getNews();
}
......
......@@ -63,6 +63,20 @@ function nodeDetail(id) {
statCard.innerHTML = '<div class="card-content black-text"><a onclick="node_edit_property_status(this)" class="right btn-floating waves-effect waves-light red"><i class="material-icons">create</i></a><span class="card-title">' + stateText + '</span><p>' + strings['label_property_status'] + '</p></div>';
flow.appendChild(statCard);
}
//Files Card
var fileCard = document.createElement("div");
fileCard.className = "card white";
var files = JSON.parse(sync_get("?fs&list&obj=" + encodeURIComponent("asset/undefined/"+id.replace("node_",""))));
var data = "";
for (file in files["files"]) {
//TODO: filetypes, name handling, ..
data += renderFile(files["files"][file], "File", "Nextcloud", "res/icons/application-octet-stream.svg", "", "download/" + "asset/undefined/"+id.replace("node_","") + "/" + files["files"][file], "", "");
}
fileCard.innerHTML = '<div class="card-content black-text"><span class="card-title">Files <a onclick="nav_files();" href="#files/'+"asset/undefined/"+id.replace("node_","")+'">(Expand)</a></span><div id="node_properties_files">'+data+'</div></div>';
flow.appendChild(fileCard);
//Assignees: Feature(1), Milestone(3) and tasks(>3) only
if (node["level"] == 1 || node["level"] > 2) {
......@@ -162,19 +176,6 @@ function nodeDetail(id) {
}
//Files Card
var fileCard = document.createElement("div");
fileCard.className = "card white";
var files = JSON.parse(sync_get("?fs&list&obj=" + encodeURIComponent("asset/undefined/"+id.replace("node_",""))));
var data = "";
for (file in files["files"]) {
//TODO: filetypes, name handling, ..
data += renderFile(files["files"][file], "File", "Nextcloud", "res/icons/application-octet-stream.svg", "", "download/" + "asset/undefined/"+id.replace("node_","") + "/" + files["files"][file], "", "");
}
// Link doesn't follow. needs more work. fileCard.innerHTML = '<div class="card-content black-text"><span class="card-title">Files <a onclick="window.location.hash=\"files\";" href="#files/'+"asset/undefined/"+id.replace("node_","")+'">(Expand)</a></span><div id="node_properties_files">'+data+'</div></div>';
fileCard.innerHTML = '<div class="card-content black-text"><span class="card-title">Files</span><div id="node_properties_files">'+data+'</div></div>';
flow.appendChild(fileCard);
var descText = node["description"];
if (descText.substring(0, 2) != "# ") {
......
......@@ -158,6 +158,7 @@ function leaderboard_render() {
entry[0] = member;
entry[1] = Math.floor(getUserTP(member));
entry[2] = Math.floor(getUserTasks(member).length - getUserTasks(member, true).length);
entry[3] = Math.floor(getUserTP(member,false)-getUserTP(member));
console.log(entry);
leaderboardData.push(entry);
}
......@@ -168,9 +169,9 @@ function leaderboard_render() {
for (entry in leaderboardData) {
var name = getDisplayableMemberName(leaderboardData[entry][0], true);
line++;
tableData += "<tr><td>" + name + "</td><td>" + leaderboardData[entry][1] + "</td><td>" + leaderboardData[entry][2] + "</td><td>-</td><td>" + line + "</td></tr>";
tableData += "<tr><td>" + name + "</td><td>" + leaderboardData[entry][1] + "</td><td>" + leaderboardData[entry][3] + "</td><td>" + leaderboardData[entry][2] + "</td><td>-</td><td>" + line + "</td></tr>";
}
document.getElementById("main").innerHTML = menuData + leaderboard_template.replace("$leaderboard_label_user$", strings["leaderboard_label_user"]).replace("$leaderboard_label_TP$", strings["leaderboard_label_TP"]).replace("$leaderboard_label_completed$", strings["leaderboard_label_completed"]).replace("$leaderboard_label_HMRatio$", strings["leaderboard_label_HMRatio"]).replace("$leaderboard_label_Rank$", strings["leaderboard_label_Rank"]).replace("$tbody", tableData);
document.getElementById("main").innerHTML = menuData + leaderboard_template.replace("$leaderboard_label_user$", strings["leaderboard_label_user"]).replace("$leaderboard_label_TP$", strings["leaderboard_label_TP"]).replace("$leaderboard_label_Pending$", strings["leaderboard_label_Pending"]).replace("$leaderboard_label_completed$", strings["leaderboard_label_completed"]).replace("$leaderboard_label_HMRatio$", strings["leaderboard_label_HMRatio"]).replace("$leaderboard_label_Rank$", strings["leaderboard_label_Rank"]).replace("$leaderboard_label_Pending$", strings["leaderboard_label_Pending"]).replace("$tbody", tableData);
}
......
......@@ -3,6 +3,7 @@
<thead>
<th>$leaderboard_label_user$</th>
<th>$leaderboard_label_TP$</th>
<th>$leaderboard_label_Pending$</th>
<th>$leaderboard_label_completed$</th>
<th>$leaderboard_label_HMRatio$</th>
<th>$leaderboard_label_Rank$</th>
......
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