File tree Expand file tree Collapse file tree 2 files changed +34
-6
lines changed Expand file tree Collapse file tree 2 files changed +34
-6
lines changed Original file line number Diff line number Diff line change 13
13
}
14
14
15
15
# gantt {
16
- overflow : scroll;
17
16
}
18
17
.popup-wrapper .title , .popup-wrapper .subtitle {
19
18
color : white;
27
26
< body >
28
27
< section class ="section ">
29
28
< div class ="container ">
30
- < div id ="gantt " style ="overflow:scroll; "> </ div >
29
+ < div class ="columns ">
30
+ < div class ="column is-2 ">
31
+ < div class ="">
32
+
33
+ < h3 > Projects</ h3 >
34
+ < hr >
35
+
36
+ < ul class ="">
37
+ {%for p in projects %}
38
+ {% if p.tasks.count > 0 %}
39
+
40
+ < li >
41
+ < a href ="?p={{p.id}} ">
42
+ {{p.name}}
43
+ </ a >
44
+ </ li >
45
+ {% endif %}
46
+ {% endfor %}
47
+ </ ul >
48
+ </ div >
49
+ </ div >
50
+ < div class ="column is-10 ">
51
+ < div id ="gantt " > </ div >
31
52
< button class ="button " onclick ="change(this) "> Day</ button >
32
53
< button class ="button " onclick ="change(this) "> Week</ button >
33
54
< button class ="button " onclick ="change(this) "> Month</ button >
34
- </ div >
55
+
56
+ </ div >
57
+ </ div >
58
+ </ div >
35
59
</ section >
36
60
< script >
37
61
var tasks ;
Original file line number Diff line number Diff line change 2
2
from __future__ import unicode_literals
3
3
from django .shortcuts import render
4
4
from django .views .generic import TemplateView
5
- from tasks .models import Task
5
+ from tasks .models import Task , Project
6
6
import json
7
7
8
8
class TaskView (TemplateView ):
@@ -19,8 +19,12 @@ def process(self, t):
19
19
20
20
def get_context_data (self , ** kwargs ):
21
21
ctx = super (TaskView , self ).get_context_data (** kwargs )
22
- tasks = Task .objects .all ()
23
-
22
+ id = self .request .GET .get ("id" ,None )
23
+ if not id :
24
+ tasks = Task .objects .all ()
25
+ else :
26
+ tasks = Task .objects .filter (project__id = id )
27
+ ctx ["projects" ] = Project .objects .all ()
24
28
ctx ["tasks" ] = json .dumps ([ self .process (t ) for t in tasks ])
25
29
return ctx
26
30
You can’t perform that action at this time.
0 commit comments