-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.jl
78 lines (66 loc) · 1.43 KB
/
app.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
module App
using GenieFramework, HTTP, JSON3
@genietools
@app begin
#@name "Event Sync"
@in view = 0
@in fc = "grey-7"
@in cc = "grey-7"
@in sc = "grey-7"
@in lc = "grey-7"
@onchange view begin
@info view
end
@in sync = -1
@in SYN = "grey-7"
@in CAL = "grey-7"
@in SHE = "grey-7"
@in LUM = "grey-7"
@onchange sync begin
@info sync
end
@in sync_disabled = true
@in sync_loading = false
end
# Need a better solution for this
function reloadCode()
include("app/nav.jl")
include("app/cal.jl")
include("app/sheet.jl")
include("app/syncto.jl")
include("lib/gcalAPI.jl")
end
# Set defaults
function setDefs()
global model = @init
model.sync = -1
model.SYN = "grey-7"
model.CAL = "grey-7"
model.SHE = "grey-7"
model.LUM = "grey-7"
model.sync_disabled = true
model.sync_loading = false
#@show model
end
function embed()
[
Html.div(class="col", @iif("view == 1"), cal("align-center")),
Html.div(class="col", @iif("view == 2"), sheet("align-center"))
]
end
function ui()
reloadCode()
gcalEventList()
setDefs()
return StippleUI.layout(
cell(class="absolute-full column", [
col(class="justify-center items-center", [
nav(),
embed(),
syncMenu()
])
])
)
end
@page("/", ui)
end