Skip to content

Commit ddabe4b

Browse files
author
Your Name
committed
update service
1 parent 645c6b5 commit ddabe4b

File tree

4 files changed

+23
-10
lines changed

4 files changed

+23
-10
lines changed

data.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"model": "tasks.task", "pk": 5, "fields": {"path": "0002", "depth": 1, "numchild": 1, "name": "Introducci\u00f3n", "start": "2018-04-01", "end": "2018-05-16", "progress": 0}}, {"model": "tasks.task", "pk": 6, "fields": {"path": "00020001", "depth": 2, "numchild": 1, "name": "Frameworks de desarrollo actuales.", "start": "2018-04-01", "end": "2018-04-13", "progress": 0}}, {"model": "tasks.task", "pk": 7, "fields": {"path": "0002000100010001", "depth": 4, "numchild": 0, "name": "Arquitecturas de software como servicio", "start": "2018-05-01", "end": "2018-05-11", "progress": 0}}, {"model": "tasks.task", "pk": 8, "fields": {"path": "000200010001", "depth": 3, "numchild": 1, "name": "Revisi\u00f3n de arquitecturas.", "start": "2018-04-16", "end": "2018-04-30", "progress": 0}}, {"model": "tasks.task", "pk": 9, "fields": {"path": "0003", "depth": 1, "numchild": 1, "name": "Frameworks de desarrollo:", "start": "2018-05-17", "end": "2018-06-18", "progress": 0}}, {"model": "tasks.task", "pk": 10, "fields": {"path": "00030001", "depth": 2, "numchild": 1, "name": "Componentes", "start": "2018-05-17", "end": "2018-05-31", "progress": 0}}, {"model": "tasks.task", "pk": 11, "fields": {"path": "000300010001", "depth": 3, "numchild": 0, "name": "Modelo Vista Controlador", "start": "2018-06-01", "end": "2018-06-18", "progress": 0}}, {"model": "tasks.task", "pk": 12, "fields": {"path": "0004", "depth": 1, "numchild": 0, "name": "M\u00e9todo software como producto a software como servicio.", "start": "2018-06-19", "end": "2018-07-13", "progress": 0}}, {"model": "tasks.task", "pk": 13, "fields": {"path": "0005", "depth": 1, "numchild": 0, "name": "Caso 1 Social Management Workflow System (SMWS)", "start": "2018-07-13", "end": "2018-08-10", "progress": 0}}, {"model": "tasks.task", "pk": 14, "fields": {"path": "0006", "depth": 1, "numchild": 0, "name": "Caso 2 Auditmy.link", "start": "2018-08-10", "end": "2018-08-17", "progress": 0}}, {"model": "tasks.task", "pk": 15, "fields": {"path": "0007", "depth": 1, "numchild": 0, "name": "Conclusiones", "start": "2018-08-17", "end": "2018-08-31", "progress": 0}}]

tasks/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111

1212
class AdminTask(TreeAdmin):
13+
list_display = ("name", "progress", "start","end")
14+
list_editable = ("progress", 'start','end')
1315
form = movenodeform_factory(Task)
1416

1517
admin.site.register(Task, AdminTask)

tasks/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Task(MP_Node, ToDictMixin):
99
name = models.CharField(max_length=100)
1010
start = models.DateField()
1111
end = models.DateField()
12-
progress = models.PositiveIntegerField()
12+
progress = models.PositiveIntegerField(default=0)
1313

1414
def __unicode__(self):
1515
return u"{}".format(self.name)

tasks/templates/index.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,35 @@
66
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/frappe-gantt/0.1.0/frappe-gantt.css">
77
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
88
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/frappe-gantt/0.1.0/frappe-gantt.js"></script>
9-
9+
<style>
10+
.section {
11+
width:100%;
12+
margin: 0 auto;
13+
}
14+
#gantt {
15+
overflow:scroll;
16+
}
17+
</style>
1018
</head>
1119
<body>
1220
<section class="section">
1321
<div class="container">
14-
<div class="columns">
15-
<div class="column">
16-
17-
<div id="gantt" style="overflow: scroll; width:800px;" ></div>
18-
</div>
19-
</div>
22+
<div id="gantt"></div>
23+
<button class="button" onclick="change(this)">Day</button>
24+
<button class="button" onclick="change(this)">Week</button>
25+
<button class="button" onclick="change(this)">Month</button>
2026
</div>
2127
</section>
2228
<script>
23-
var tasks;
29+
var tasks;
30+
var gantt;
2431
document.addEventListener('DOMContentLoaded', function(){
2532
tasks ={{tasks|safe}};
26-
var gantt = new Gantt( document.querySelector("#gantt"), tasks);
33+
gantt = new Gantt( document.querySelector("#gantt"), tasks);
2734
});
35+
function change($this) {
36+
gantt.change_view_mode($this.textContent);
37+
}
2838

2939
</script>
3040
</body>

0 commit comments

Comments
 (0)