-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplates.js
115 lines (108 loc) · 11.5 KB
/
templates.js
1
$.JST._templates.GANTBUTTONS = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <div class="ganttButtonBar noprint"> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'undo.gantt\');" class="button textual" title="undo"><span class="teamworkIcon">'</span></button> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'redo.gantt\');" class="button textual" title="redo"><span class="teamworkIcon">·</span></button> <span class="ganttButtonSeparator"></span> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'addAboveCurrentTask.gantt\');" class="button textual" title="insert above"><span class="teamworkIcon">l</span></button> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'addBelowCurrentTask.gantt\');" class="button textual" title="insert below"><span class="teamworkIcon">X</span></button> <span class="ganttButtonSeparator"></span> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'indentCurrentTask.gantt\');" class="button textual" title="indent task"><span class="teamworkIcon">.</span></button> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'outdentCurrentTask.gantt\');" class="button textual" title="unindent task"><span class="teamworkIcon">:</span></button> <span class="ganttButtonSeparator"></span> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'moveUpCurrentTask.gantt\');" class="button textual" title="move up"><span class="teamworkIcon">k</span></button> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'moveDownCurrentTask.gantt\');" class="button textual" title="move down"><span class="teamworkIcon">j</span></button> <span class="ganttButtonSeparator"></span> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'zoomMinus.gantt\');" class="button textual" title="zoom out"><span class="teamworkIcon">)</span></button> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'zoomPlus.gantt\');" class="button textual" title="zoom in"><span class="teamworkIcon">(</span></button> <span class="ganttButtonSeparator"></span> <button onclick="$(this).parents(\'.waf-wakandagantt\').find(\'.wakgantt\').trigger(\'deleteCurrentTask.gantt\');" class="button textual" title="delete"><span class="teamworkIcon">¢</span></button> <span class="ganttButtonSeparator"></span> <button class="wak-gantt-critical-path button textual" title="Critical Path"><span class="teamworkIcon">£</span></button> <button class="wak-gantt-save button first big" title="save">save</button> </div> '); } return p.join('');};$.JST._templates.TASKSEDITHEAD = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <table class="gdfTable" cellspacing="0" cellpadding="0"> <thead> <tr style="height:40px"> <th class="gdfColHeader" style="width:35px;"></th> <th class="gdfColHeader" style="width:25px;"></th> <th class="gdfColHeader gdfResizable" style="width:30px;">code/short name</th> <th class="gdfColHeader gdfResizable" style="width:300px;">name</th> <th class="gdfColHeader gdfResizable" style="width:80px;">start</th> <th class="gdfColHeader gdfResizable" style="width:80px;">end</th> <th class="gdfColHeader gdfResizable" style="width:50px;">dur.</th> <th class="gdfColHeader gdfResizable" style="width:50px;">dep.</th> <th class="gdfColHeader gdfResizable" style="width:200px;">assignees</th> </tr> </thead> </table> '); } return p.join('');};$.JST._templates.TASKROW = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <tr taskId="', obj.id, '" class="taskEditRow" level="', level, '"> <th class="gdfCell edit" align="right" style="cursor:pointer;"><span class="taskRowIndex">', obj.getRow() + 1, '</span> <span class="teamworkIcon" style="font-size:12px;" >e</span></th> <td class="gdfCell noClip" align="center"><div class="taskStatus cvcColorSquare" status="', obj.status, '"></div></td> <td class="gdfCell"><input type="text" name="code" value="', obj.code ? obj.code : '', '"></td> <td class="gdfCell indentCell" style="padding-left:', obj.level * 10, 'px;"><input type="text" name="name" value="', obj.name, '" style="', obj.level > 0 ? 'border-left:2px dotted orange' : '', '"></td> <td class="gdfCell"><input type="text" name="start" value="" class="date"></td> <td class="gdfCell"><input type="text" name="end" value="" class="date"></td> <td class="gdfCell"><input type="text" name="duration" value="', obj.duration, '"></td> <td class="gdfCell"><input type="text" name="depends" value="', obj.depends, '" ', obj.hasExternalDep ? "readonly" : "", '></td> <td class="gdfCell taskAssigs">', obj.getAssigsString(), '</td> </tr> '); } return p.join('');};$.JST._templates.TASKEMPTYROW = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <tr class="taskEditRow emptyRow" > <th class="gdfCell" align="right"></th> <td class="gdfCell noClip" align="center"></td> <td class="gdfCell"></td> <td class="gdfCell"></td> <td class="gdfCell"></td> <td class="gdfCell"></td> <td class="gdfCell"></td> <td class="gdfCell"></td> <td class="gdfCell"></td> </tr> '); } return p.join('');};$.JST._templates.TASKBAR = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <div class="taskBox taskBoxDiv" taskId="', obj.id, '" > <div class="layout ', obj.hasExternalDep ? 'extDep' : '', '"> <div class="taskStatus" status="', obj.status, '"></div> <div class="taskProgress" style="width:', obj.progress > 100 ? 100 : obj.progress, '%; background-color:', obj.progress > 100 ? 'red' : 'rgb(153,255,51);', ';"></div> <div class="milestone ', obj.startIsMilestone ? 'active' : '', '" ></div> <div class="taskLabel"></div> <div class="milestone end ', obj.endIsMilestone ? 'active' : '', '" ></div> </div> </div> '); } return p.join('');};$.JST._templates.CHANGE_STATUS = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <div class="taskStatusBox"> <div class="taskStatus cvcColorSquare" status="STATUS_ACTIVE" title="active"></div> <div class="taskStatus cvcColorSquare" status="STATUS_DONE" title="completed"></div> <div class="taskStatus cvcColorSquare" status="STATUS_FAILED" title="failed"></div> <div class="taskStatus cvcColorSquare" status="STATUS_SUSPENDED" title="suspended"></div> <div class="taskStatus cvcColorSquare" status="STATUS_UNDEFINED" title="undefined"></div> </div> '); } return p.join('');};$.JST._templates.TASK_EDITOR = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <div class="ganttTaskEditor"> <table width="100%"> <tr> <td> <table cellpadding="5"> <tr> <td><label for="code">code/short name</label><br><input type="text" name="code" id="code" value="" class="formElements"></td> </tr><tr> <td><label for="name">name</label><br><input type="text" name="name" id="name" value="" size="35" class="formElements"></td> </tr> <tr></tr> <td> <label for="description">description</label><br> <textarea rows="5" cols="30" id="description" name="description" class="formElements"></textarea> </td> </tr> </table> </td> <td valign="top"> <table cellpadding="5"> <tr> <td colspan="2"><label for="status">status</label><br><div id="status" class="taskStatus" status=""></div></td> <tr> <td colspan="2"><label for="progress">progress</label><br><input type="text" name="progress" id="progress" value="" size="3" class="formElements"></td> </tr> <tr> <td><label for="start">start</label><br><input type="text" name="start" id="start" value="" class="date" size="10" class="formElements"><input type="checkbox" id="startIsMilestone"> </td> <td rowspan="2" class="graph" style="padding-left:50px"><label for="duration">dur.</label><br><input type="text" name="duration" id="duration" value="" size="5" class="formElements"></td> </tr><tr> <td><label for="end">end</label><br><input type="text" name="end" id="end" value="" class="date" size="10" class="formElements"><input type="checkbox" id="endIsMilestone"></td> </table> </td> </tr> </table> <h2>assignments</h2> <table cellspacing="1" cellpadding="0" width="100%" id="assigsTable"> <tr> <th style="width:100px;">name</th> <th style="width:70px;">role</th> <th style="width:30px;">est.wklg.</th> <th style="width:30px;" id="addAssig"><span class="teamworkIcon" style="cursor: pointer">+</span></th> </tr> </table> <div style="text-align: right; padding-top: 20px"><button id="saveButton" class="button big">save</button></div> </div> '); } return p.join('');};$.JST._templates.ASSIGNMENT_ROW = function anonymous(obj) { var p = [], print = function() { p.push.apply(p, arguments); }; with(obj) { p.push(' <tr taskId="', obj.task.id, '" assigId="', obj.assig.id, '" class="assigEditRow" > <td ><select name="resourceId" class="formElements" ', obj.assig.id.indexOf("tmp_") == 0 ? "" : "disabled", ' ></select></td> <td ><select type="select" name="roleId" class="formElements"></select></td> <td ><input type="text" name="effort" value="', getMillisInHoursMinutes(obj.assig.effort), '" size="5" class="formElements"></td> <td align="center"><span class="teamworkIcon delAssig" style="cursor: pointer">d</span></td> </tr> '); } return p.join('');};$.JST.loadDecorator("ASSIGNMENT_ROW", function(assigTr, taskAssig) { var resEl = assigTr.find("[name=resourceId]"); for (var i in taskAssig.task.master.resources) { var res = taskAssig.task.master.resources[i]; var opt = $("<option>"); opt.val(res.id).html(res.name); if (taskAssig.assig.resourceId == res.id) opt.attr("selected", "true"); resEl.append(opt); } var roleEl = assigTr.find("[name=roleId]"); for (var i in taskAssig.task.master.roles) { var role = taskAssig.task.master.roles[i]; var optr = $("<option>"); optr.val(role.id).html(role.name); if (taskAssig.assig.roleId == role.id) optr.attr("selected", "true"); roleEl.append(optr); } if(taskAssig.task.master.canWrite && taskAssig.task.canWrite){ assigTr.find(".delAssig").click(function() { var tr = $(this).closest("[assigId]").fadeOut(200, function() { $(this).remove(); }); }); } });