File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 14
14
< div class ="">
15
15
16
16
< h3 > Projects</ h3 >
17
+ < small >
18
+ < a target ='_blank ' href ="/admin "> admin</ a >
19
+ </ small >
17
20
< hr >
18
21
19
22
< ul class ="">
20
23
{%for p in projects %}
21
24
{% if p.tasks.count > 0 %}
22
25
23
26
< li >
24
- < a href ="?p ={{p.id}} ">
27
+ < a href ="?id ={{p.id}} ">
25
28
{{p.name}}
26
29
</ a >
27
30
</ li >
28
31
{% endif %}
29
32
{% endfor %}
30
33
</ ul >
31
34
</ div >
32
- </ div >
35
+ </ div >
36
+ {% if tasks_count %}
33
37
< div class ="column is-10 ">
34
38
< div id ="gantt " > </ div >
35
39
< button class ="button " onclick ="change(this) "> Day</ button >
36
40
< button class ="button " onclick ="change(this) "> Week</ button >
37
41
< button class ="button " onclick ="change(this) "> Month</ button >
38
42
39
43
</ div >
44
+ {% endif %}
40
45
</ div >
41
46
</ div >
42
47
</ section >
Original file line number Diff line number Diff line change @@ -20,11 +20,14 @@ def process(self, t):
20
20
def get_context_data (self , ** kwargs ):
21
21
ctx = super (TaskView , self ).get_context_data (** kwargs )
22
22
id = self .request .GET .get ("id" ,None )
23
+
23
24
if not id :
24
- tasks = Task .objects .all ()
25
+ tasks = Task .objects .none ()
25
26
else :
26
27
tasks = Task .objects .filter (project__id = id )
28
+
27
29
ctx ["projects" ] = Project .objects .all ()
30
+ ctx ["tasks_count" ] = tasks .count ()
28
31
ctx ["tasks" ] = json .dumps ([ self .process (t ) for t in tasks ])
29
32
return ctx
30
33
You can’t perform that action at this time.
0 commit comments