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 1313 }
1414
1515 # gantt {
16- overflow : scroll;
1716 }
1817 .popup-wrapper .title , .popup-wrapper .subtitle {
1918 color : white;
2726 < body >
2827 < section class ="section ">
2928 < 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 >
3152 < button class ="button " onclick ="change(this) "> Day</ button >
3253 < button class ="button " onclick ="change(this) "> Week</ button >
3354 < button class ="button " onclick ="change(this) "> Month</ button >
34- </ div >
55+
56+ </ div >
57+ </ div >
58+ </ div >
3559 </ section >
3660 < script >
3761 var tasks ;
Original file line number Diff line number Diff line change 22from __future__ import unicode_literals
33from django .shortcuts import render
44from django .views .generic import TemplateView
5- from tasks .models import Task
5+ from tasks .models import Task , Project
66import json
77
88class TaskView (TemplateView ):
@@ -19,8 +19,12 @@ def process(self, t):
1919
2020 def get_context_data (self , ** kwargs ):
2121 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 ()
2428 ctx ["tasks" ] = json .dumps ([ self .process (t ) for t in tasks ])
2529 return ctx
2630
You can’t perform that action at this time.
0 commit comments