Commit e1132cfe authored by TheJeremail's avatar TheJeremail
Browse files

New config options for permissions (70%)

New feature: new dashboard
bugfixes
parent 98b9a96d
{
"team_name": "Test Team",
"members": ["jfisch12@hs-mittweida.de"],
"members": [
"jfisch12@hs-mittweida.de",
"marbach@hs-mittweida.de",
"sschleie@hs-mittweida.de"],
"hierarchy": {
"owner": [
"marbach@hs-mittweida.de"],
"director": [
"sschleie@hs-mittweida.de"],
"manager": {
"jfisch12@hs-mittweida.de":[
"marbach@hs-mittweida.de",
"sschleie@hs-mittweida.de"
]
}
},
"filestore": "/tmp/filestore/test_team"
}
\ No newline at end of file
......@@ -41,6 +41,8 @@ function init(){
_filter = jmcjs.organise.filter;
_apply = jmcjs.organise.applyResult;
_query = jmcjs.organise.multiQuery;
_decimate = jmcjs.organise.result.decimate;
_aggregate = jmcjs.organise.result.aggregate;
//Include and Run app code
set_view_title("Start");
document.getElementById("app").src="res/app.js";
......
......@@ -52,7 +52,7 @@ jmcjs.route.add("#files", function(route) {
} else if (pathComponents[0] == "asset") {
if (pathComponents[2] != undefined) {
breadCrumbs += '<a style="float: right;" onclick="alert('+"'"+'You can use Drag&Drop to upload files'+"'"+')">Upload File</a>';
data += renderFile("Description", "Document", "Autogen.", "res/icons/application-octet-stream.svg", "lock_outline", "download/" + requestPath + "/", "", "");
data += renderFile("Description", "Document", "Autogen.", "res/icons/application-octet-stream.svg", "lock_outline", "docview/" + requestPath + "/", "", "");
files = JSON.parse(sync_get("?fs&list&obj=" + encodeURIComponent(requestPath)));
for (file in files["files"]) {
//TODO: filetypes, name handling, ..
......
......@@ -46,6 +46,7 @@ function nav_dashboard() {
data = data.replace("$dashboard_label_load$", strings["dashboard_label_load"]);
document.getElementById("main").innerHTML = menuData + data;
updateNotificationBadge();
setTimeout(update_dashboard,10);
}
function calcScale(graph) {
graph.style.transform = "translate(" + userGraphOffset + ") scale(" + userScale + ")";
......
......@@ -29,8 +29,8 @@ function nodeDetail(id) {
//}
//titleCard.innerHTML = '<div class="card-content black-text"><a onclick="node_edit_property_title_desc(this)" class="right btn-floating waves-effect waves-light red"><i class="material-icons">create</i></a><span class="card-title">'+node["name"]+'</span><p>'+descText+'</p></div>';
//flow.appendChild(titleCard);
document.getElementById("editorView").innerHTML = '<div style="position: absolute; overflow: hidden; height: 100%; top: 0%; width: 100%;" id="currentNodeDescEditorWrapper"><textarea height="100%" id="currentNodeDescEditor"></textarea>';
if(document.getElementById("editorView") != undefined)
document.getElementById("editorView").innerHTML = '<div style="position: absolute; overflow: hidden; height: 100%; top: 0%; width: 100%;" id="currentNodeDescEditorWrapper"><textarea height="100%" id="currentNodeDescEditor"></textarea>';
//Title: Always
var titleCard = document.createElement("div");
......@@ -162,25 +162,13 @@ function nodeDetail(id) {
var progress = getNodeProgress(nodeTree[currentDetailNode]);
proCard.innerHTML = '<div class="card-content black-text"><span class="card-title">' + strings["label_property_progress"] + ': ' + Math.round(progress["ratio"] * 100) + '%</span><p>' + strings["label_text_progress"].replace("$done$", progress["complete"]).replace("$total$", progress["weight"]) + '</p></div>';
flow.appendChild(proCard);
}
if (node["level"] != 0) {
var delCard = document.createElement("div");
delCard.className = "card red darken-3";
var delButtons = '<a class="waves-effect waves-light btn" onclick="node_delete_with_children()"><i class="material-icons left">delete_forever</i>' + strings["label_action_deleteTree"] + '</a>';
if (node["level"] > 3) {
delButtons += '<br><a class="waves-effect waves-light btn" onclick="node_delete_remap()"><i class="material-icons left">delete</i>' + strings["label_action_deleteTopo"] + '</a>';
}
delCard.innerHTML = '<div class="card-content black-text"><span class="card-title">' + strings["label_property_dangerzone"] + '</span>' + delButtons + '</div>';
flow.appendChild(delCard);
}
}
var descText = node["description"];
if (descText.substring(0, 2) != "# ") {
descText = "# " + node["name"] + "\n" + descText;
}
setTimeout(details_show,100);
currentDetailNodeEditor = new SimpleMDE({
"element" : document.getElementById("currentNodeDescEditor"),
initialValue : descText,
......@@ -202,7 +190,16 @@ function nodeDetail(id) {
});
currentDetailNodeRenderedDoc = currentDetailNodeEditor.options.previewRender(descText);
document.getElementById("currentNodeDescPreview").innerHTML = currentDetailNodeRenderedDoc;
if (node["level"] != 0) {
var delCard = document.createElement("div");
delCard.className = "card red darken-3";
var delButtons = '<a class="waves-effect waves-light btn" onclick="node_delete_with_children()"><i class="material-icons left">delete_forever</i>' + strings["label_action_deleteTree"] + '</a>';
if (node["level"] > 3) {
delButtons += '<br><a class="waves-effect waves-light btn" onclick="node_delete_remap()"><i class="material-icons left">delete</i>' + strings["label_action_deleteTopo"] + '</a>';
}
delCard.innerHTML = '<div class="card-content black-text"><span class="card-title">' + strings["label_property_dangerzone"] + '</span>' + delButtons + '</div>';
flow.appendChild(delCard);
}
//currentDetailNodeEditor.togglePreview();
details_show();
setTimeout(mscalc, 100);
}
......@@ -85,50 +85,115 @@ function details_hide() {
function update_dashboard() {
//TODO: Fix this mess
var tableContents = "";
var row_template = '<tr onclick="details_show(); return true;"><td>$state</td><td>$name</td><td>$activeTime</td><td>$tasks</td></tr>';
for (member in teamData["members"]) {
var cm = teamData["members"][member];
var tp = Math.floor(getUserTP(cm["FullID"], false) - getUserTP(cm["FullID"], true));
var time = "";
if (cm["timeOut"] != undefined) {
var seconds = Math.floor(Date.now() / 1000 - cm["timeOut"]);
var minutes = Math.floor(seconds / 60);
seconds = seconds % 60;
var hours = Math.floor(minutes / 60);
minutes = minutes % 60;
var days = Math.floor(hours / 24);
hours = hours % 24;
var weeks = days / 7;
days = days % 7;
if (weeks > 1) {
time = Math.floor(weeks) + " " + strings["time_weeks"];
} else if (days > 1) {
time = Math.floor(days) + " " + strings["time_days"];
} else if (hours > 1) {
time = Math.floor(hours) + " " + strings["time_hours"];
} else if (minutes > 1) {
time = Math.floor(minutes) + " " + strings["time_minutes"];
} else {
time = strings["time_unknown"];
var output_data_panel_left = "";
var output_data_panel_right = '<div class="card white"><div class="card-content"><span class="card-title">Free Tasks</span><table>\
<thead><th>Task</th><th>TP</th><th>Field</th></thead><tbody>';
var open_tasks = _apply(nodeTree,_decimate(
_search(nodeTree,
_query("assignees",[[],undefined],false,false,false)
),
_filter(nodeTree,
_query("isDeleted",[true],false,false)
)
));
for(var task in open_tasks){
task = open_tasks[task];
output_data_panel_right += "<tr class='field-"+task.field.toLowerCase()+"' onclick='nodeDetail(\""+task.self+"\");'><td>"+task.name+"</td><td>"+task.tp+"</td><td>"+task.field+"</td></tr>";
}
output_data_panel_right += '</tbody></table></div></div>';
//Role: Manager
if(teamData["hierarchy"]["manager"][auth_info["user"]] !== undefined){
output_data_panel_left += "<h4> Perspective: Manager </h4>";
for(var developer in teamData["hierarchy"]["manager"][auth_info["user"]]){
developer = teamData["hierarchy"]["manager"][auth_info["user"]][developer];
var tasks = _apply(nodeTree,
_filter(nodeTree,[
_query("isDeleted",[true],false,true)[0],
_query("assignees",[[developer]],false,false,true)[0]
]));
var workload = 0;
var workload_info = "";
var reviewOnly = true;
if(tasks.length > 0){
workload_info += "<table><thead><th>Task</th><th>TP</th><th>Status</th></thead><tbody>";
for(var task in tasks){
workload++;
task = tasks[task];
workload_info += "<tr><td>"+task.name+"</td><td>"+task.tp+"</td><td>"+states[task.state]+"</td></tr>";
if(task.state < 2){
reviewOnly = false;
}
}
workload_info += "</tbody></table>";
}
if(workload > 0){
if(reviewOnly){
output_data_panel_left += '<div class="card yellow"><div class="card-content black-text">';
}else{
output_data_panel_left += '<div class="card green"><div class="card-content black-text">';
}
output_data_panel_left += '<span class="card-title">'+ getDisplayableMemberName(developer) +' ('+ workload
+' Task[s])</span>'+workload_info+'</div></div>';
}else{
output_data_panel_left += '<div class="card red darken-1"><div class="card-content white-text"><span class="card-title">'+
getDisplayableMemberName(developer)
+'</span><p>Warning: This developer has no workload.</p></div></div>';
}
} else {
time = strings["time_unknown"];
}
var online = ((Date.now() / 1000) - cm["timeOut"] < 0);
if (online) {
online = '<i class="material-icons">person</i>';
time = strings["time_present"];
} else {
time = strings["time_count_past"].replace("$time$", time);
online = '<i class="material-icons">person_outline</i>';
}
tableContents += row_template.replace("$name", cm["Name"]).replace("$tasks", strings["dashboard_label_load_tp"].replace("$load$", tp)).replace("$state", online).replace("$activeTime", time);
}else{
output_data_panel_left = output_data_panel_right;
output_data_panel_right = "";
}
document.getElementById("teamTableBody").innerHTML = tableContents;
//TODO: Fix this mess
// var tableContents = "";
// var row_template = '<tr onclick="details_show(); return true;"><td>$state</td><td>$name</td><td>$activeTime</td><td>$tasks</td></tr>';
// for (member in teamData["members"]) {
// var cm = teamData["members"][member];
// var tp = Math.floor(getUserTP(cm["FullID"], false) - getUserTP(cm["FullID"], true));
//
// var time = "";
// if (cm["timeOut"] != undefined) {
// var seconds = Math.floor(Date.now() / 1000 - cm["timeOut"]);
// var minutes = Math.floor(seconds / 60);
// seconds = seconds % 60;
// var hours = Math.floor(minutes / 60);
// minutes = minutes % 60;
// var days = Math.floor(hours / 24);
// hours = hours % 24;
// var weeks = days / 7;
// days = days % 7;
// if (weeks > 1) {
// time = Math.floor(weeks) + " " + strings["time_weeks"];
// } else if (days > 1) {
// time = Math.floor(days) + " " + strings["time_days"];
// } else if (hours > 1) {
// time = Math.floor(hours) + " " + strings["time_hours"];
// } else if (minutes > 1) {
// time = Math.floor(minutes) + " " + strings["time_minutes"];
// } else {
// time = strings["time_unknown"];
// }
// } else {
// time = strings["time_unknown"];
// }
//
// var online = ((Date.now() / 1000) - cm["timeOut"] < 0);
// if (online) {
// online = '<i class="material-icons">person</i>';
// time = strings["time_present"];
// } else {
// time = strings["time_count_past"].replace("$time$", time);
// online = '<i class="material-icons">person_outline</i>';
// }
// tableContents += row_template.replace("$name", cm["Name"]).replace("$tasks", strings["dashboard_label_load_tp"].replace("$load$", tp)).replace("$state", online).replace("$activeTime", time);
// }
// document.getElementById("teamTableBody").innerHTML = tableContents;
document.getElementById("dashboard_panel_left").innerHTML = output_data_panel_left;
document.getElementById("dashboard_panel_right").innerHTML = output_data_panel_right;
}
......
<panelFlow style="box-sizing: border-box; display: inline-block; position: absolute; top: 4.3em; left: 0px; width: 100%; height: calc( 100% - 4.3em); overflow: hidden; overflow-y: auto;">
<div class="row">
<div class="col s6" onclick="details_hide()">
<div class="card grey darken-5">
<div class="card-image">
<br>
<br>
<br>
<br>
<span class="card-title">Node Title</span>
<a class="btn-floating halfway-fab waves-effect waves-light red"><i class="material-icons">mode_edit</i></a>
</div>
<div class="card-content">
<p>
I'm just a sample text. But I can be Very Powerful! When I grow up, I'll be a fearsome warrior, I promise!
</p>
</div>
</div>
<div class="card red darken-1">
<div class="card-content white-text">
<span class="card-title">Milestone 3</span>
<p>
Overdue (6 out of 11 Tasks complete)
</p>
</div>
</div>
<div class="card green ">
<div class="card-content white-text">
<span class="card-title">On Track</span>
<p>
Progress at 77%
</p>
<b>77</b> out of <b>100</b> TP completed.
</div>
<panelFlow
style="box-sizing: border-box; display: inline-block; position: absolute; top: 4.3em; left: 0px; width: 100%; height: calc( 100% - 4.3em); overflow: hidden; overflow-y: auto;">
<div class="row">
<div class="col s5" onclick="details_hide()" id="dashboard_panel_left">
<!--<h4>Perspective: Manager</h4>
<div class="card red darken-1">
<div class="card-content white-text">
<span class="card-title">Alexander Marbach (Seen 6 months
ago)</span>
<p>Warning: This developer has no workload.</p>
_apply(nodeTree,_filter(nodeTree,[_query("isDeleted",[true],false,true)[0],_query("assignees",[["marbach@hs-mittweida.de"]])[0]]));
All assigned tasks:
_apply(nodeTree,_filter(nodeTree,[_query("isDeleted",[true],false,true)[0],_query("assignees",[[]],false,false,true)[0],_query("assignees",[[]],false,true,false)[0]]));
</div>
</div>
<div class="col s6">
<div class="card white">
<div class="card-content">
<span class="card-title">$dashboard_label_team$</span>
<table>
<thead>
<th> </th>
<th>$dashboard_label_member$</th>
<th>$dashboard_label_active$</th>
<th>$dashboard_label_load$</th>
</thead>
<tbody id="teamTableBody">
</tbody>
</table>
</div>
<div class="card green">
<div class="card-content black-text">
<span class="card-title">Jeremy Fischer (Online)</span>
<table>
<thead>
<th>Task</th>
<th>TP</th>
<th>Status</th>
</thead>
<tbody>
<tr>
<td>A* Richtig Programmieren</td>
<td>9001</td>
<td>Open</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card yellow ">
<div class="card-content black-text">
<span class="card-title">Sebastian Schleier (Seen 8 months
ago)</span>
<table>
<thead>
<th>Task</th>
<th>TP</th>
<th>Status</th>
</thead>
<tbody>
<tr>
<td>A* H&uuml;bsch machen</td>
<td>69</td>
<td>TecReview</td>
</tr>
</tbody>
</table>
</div>
</div> -->
</div>
<div class="col s7" id="dashboard_panel_right">
<!-- <div class="card white">
<div class="card-content">
<span class="card-title">$dashboard_label_team$</span>
<table>
<thead>
<th></th>
<th>$dashboard_label_member$</th>
<th>$dashboard_label_active$</th>
<th>$dashboard_label_load$</th>
</thead>
<tbody id="teamTableBody">
</tbody>
</table>
</div>
</div>-->
</div>
</div>
</panelFlow>
\ No newline at end of file
......@@ -166,78 +166,78 @@ file creator {
}
/* gamedesign */ .field-gamedesign .nodeText, .field-gamedesign buttons i, .card.field-gamedesign, .card.field-gamedesign ~
.card {
.card, tr.field-gamedesign {
background-color: hsl( 0, 100%, 80%);
border-color: hsl( 0, 100%, 80%);
}
/* planning */ .field-planning .nodeText, .field-planning buttons i, .card.field-planning, .card.field-planning ~
.card {
.card, tr.field-planning {
background-color: hsl( 30, 100%, 80%);
border-color: hsl( 30, 100%, 80%);
}
/* concept-art */ .field-concept-art .nodeText, .field-concept-art buttons i, .card.field-concept-art, .card.field-concept-art ~
.card {
.card, tr.field-concept-art {
background-color: hsl( 60, 100%, 80%);
border-color: hsl( 60, 100%, 80%);
}
/* modelling */ .field-modelling .nodeText, .field-modelling buttons i, .card.field-modelling, .card.field-modelling ~
.card {
.card, tr.field-modelling {
background-color: hsl( 90, 100%, 80%);
border-color: hsl( 90, 100%, 80%);
}
/* texturing */ .field-texturing .nodeText, .field-texturing buttons i, .card.field-texturing, .card.field-texturing ~
.card {
.card, tr.field-texturing {
background-color: hsl(120, 100%, 80%);
border-color: hsl(120, 100%, 80%);
}
/* rigging */ .field-rigging .nodeText, .field-rigging buttons i, .card.field-rigging, .card.field-rigging ~
.card {
.card, tr.field-rigging {
background-color: hsl(150, 100%, 80%);
border-color: hsl(150, 100%, 80%);
}
/* animation */ .field-animation .nodeText, .field-animation buttons i, .card.field-animation, .card.field-animation ~
.card {
.card, tr.field-animation {
background-color: hsl(180, 100%, 80%);
border-color: hsl(180, 100%, 80%);
}
/* sound */ .field-sound .nodeText, .field-sound buttons i, .card.field-sound, .card.field-sound ~
.card {
.card, tr.field-sound {
background-color: hsl(210, 100%, 80%);
border-color: hsl(210, 100%, 80%);
}
/* programming */ .field-programming .nodeText, .field-programming buttons i, .card.field-programming, .card.field-programming ~
.card {
.card, tr.field-programming {
background-color: hsl(240, 100%, 80%);
border-color: hsl(240, 100%, 80%);
}
/* implement */ .field-implementation .nodeText, .field-implementation buttons i, .card.field-implementation, .card.field-implementation ~
.card {
.card, tr.field-implementation {
background-color: hsl(270, 100%, 80%);
border-color: hsl(270, 100%, 80%);
}
/* testing */ .field-testing .nodeText, .field-testing buttons i, .card.field-testing, .card.field-testing ~
.card {
.card, tr.field-testing {
background-color: hsl(300, 100%, 80%);
border-color: hsl(300, 100%, 80%);
}
/* shader */ .field-shader .nodeText, .field-shader buttons i, .card.field-shader, .card.field-shader ~
.card {
.card, tr.field-shader {
background-color: #5E0B15;
border-color: #5E0B15;
color: white;
}
/* 2d-art */ .field-2d-art .nodeText, .field-2d-art buttons i, .card.field-2d-art, .card.field-2d-art ~
.card {
.card, tr.field-2d-art {
background-color: #FFAD05;
border-color: #FFAD05;
}
/* blockout */ .field-blockout .nodeText, .field-blockout buttons i, .card.field-blockout, .card.field-blockout ~
.card {
.card, tr.field-blockout {
background-color: #531CB3;
border-color: #531CB3;
}
/* material */ .field-material .nodeText, .field-material buttons i, .card.field-material, .card.field-material ~
.card {
.card, tr.field-material {
background-color: hsl(330, 100%, 80%);
border-color: hsl(330, 100%, 80%);
}
......
......@@ -3,7 +3,7 @@
<a href="#" class="brand-logo left">$app_name$ | $team_name$</a>
<ul id="nav-mobile" class="right">
<li $menu_dashboard_class$>
<a d="menu_dashboard_label" onclick="nav_dashboard()">$interface_tab_dashboard_title$</a>
<a id="menu_dashboard_label" onclick="nav_dashboard()">$interface_tab_dashboard_title$</a>
</li>
<li $menu_graph_class$>
<a onclick="nav_graph()">$interface_tab_graph_title$</a>
......
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