rev |
line source |
bsw@276
|
1 if app.session.member_id then
|
bsw@276
|
2 util.help("index.index", _"Home")
|
bsw@276
|
3
|
bsw@276
|
4 execute.view{
|
bsw@558
|
5 module = "index", view = "_index_member"
|
bsw@276
|
6 }
|
bsw@276
|
7
|
bsw@276
|
8 elseif config.public_access then
|
bsw@276
|
9 if config.motd_public then
|
bsw@276
|
10 local help_text = config.motd_public
|
bsw@276
|
11 ui.container{
|
bsw@276
|
12 attr = { class = "wiki motd" },
|
bsw@276
|
13 content = function()
|
bsw@276
|
14 slot.put(format.wiki_text(help_text))
|
bsw@276
|
15 end
|
bsw/jbe@4
|
16 }
|
bsw@10
|
17 end
|
bsw@276
|
18
|
bsw@462
|
19 local open_issues_selector = Issue:new_selector()
|
bsw@462
|
20 :add_where("issue.closed ISNULL")
|
bsw@462
|
21 :add_order_by("coalesce(issue.fully_frozen + issue.voting_time, issue.half_frozen + issue.verification_time, issue.accepted + issue.discussion_time, issue.created + issue.admission_time) - now()")
|
bsw@462
|
22
|
bsw@462
|
23 local closed_issues_selector = Issue:new_selector()
|
bsw@462
|
24 :add_where("issue.closed NOTNULL")
|
bsw@462
|
25 :add_order_by("issue.closed DESC")
|
bsw@462
|
26
|
bsw@462
|
27
|
bsw@462
|
28 local tabs = {
|
bsw@462
|
29 module = "index",
|
bsw@462
|
30 view = "index"
|
bsw@462
|
31 }
|
bsw@462
|
32
|
bsw@462
|
33 tabs[#tabs+1] = {
|
bsw@462
|
34 name = "units",
|
bsw@462
|
35 label = _"Units",
|
bsw@462
|
36 module = "unit",
|
bsw@462
|
37 view = "_list"
|
bsw@462
|
38 }
|
bsw@462
|
39
|
bsw@462
|
40 tabs[#tabs+1] = {
|
bsw@462
|
41 name = "timeline",
|
bsw@462
|
42 label = _"Events",
|
bsw@462
|
43 module = "event",
|
bsw@462
|
44 view = "_list",
|
bsw@462
|
45 params = { global = true }
|
bsw@462
|
46 }
|
bsw/jbe@0
|
47
|
bsw@462
|
48 tabs[#tabs+1] = {
|
bsw@462
|
49 name = "open",
|
bsw@462
|
50 label = _"Open issues",
|
bsw@462
|
51 module = "issue",
|
bsw@462
|
52 view = "_list",
|
bsw@462
|
53 params = {
|
bsw@462
|
54 for_state = "open",
|
bsw@462
|
55 issues_selector = open_issues_selector
|
bsw@462
|
56 }
|
bsw@462
|
57 }
|
bsw@462
|
58 tabs[#tabs+1] = {
|
bsw@462
|
59 name = "closed",
|
bsw@462
|
60 label = _"Closed issues",
|
bsw@462
|
61 module = "issue",
|
bsw@462
|
62 view = "_list",
|
bsw@462
|
63 params = {
|
bsw@462
|
64 for_state = "closed",
|
bsw@462
|
65 issues_selector = closed_issues_selector
|
bsw@462
|
66 }
|
bsw@462
|
67 }
|
bsw@462
|
68 ui.tabs(tabs)
|
bsw@276
|
69
|
bsw@276
|
70 else
|
bsw@276
|
71
|
bsw@386
|
72 if config.motd_public then
|
bsw@386
|
73 local help_text = config.motd_public
|
bsw@386
|
74 ui.container{
|
bsw@386
|
75 attr = { class = "wiki motd" },
|
bsw@386
|
76 content = function()
|
bsw@386
|
77 slot.put(format.wiki_text(help_text))
|
bsw/jbe@0
|
78 end
|
bsw@386
|
79 }
|
bsw@386
|
80 end
|
bsw@386
|
81
|
bsw@367
|
82 ui.tag{ tag = "p", content = _"Closed user group, please login to participate." }
|
bsw/jbe@0
|
83
|
bsw@369
|
84 ui.form{
|
bsw@369
|
85 attr = { class = "login" },
|
bsw@369
|
86 module = 'index',
|
bsw@369
|
87 action = 'login',
|
bsw@369
|
88 routing = {
|
bsw@369
|
89 ok = {
|
bsw@369
|
90 mode = 'redirect',
|
bsw@369
|
91 module = param.get("redirect_module") or "index",
|
bsw@369
|
92 view = param.get("redirect_view") or "index",
|
bsw@369
|
93 id = param.get("redirect_id"),
|
bsw@369
|
94 },
|
bsw@369
|
95 error = {
|
bsw@369
|
96 mode = 'forward',
|
bsw@369
|
97 module = 'index',
|
bsw@369
|
98 view = 'login',
|
bsw@369
|
99 }
|
bsw@369
|
100 },
|
bsw@369
|
101 content = function()
|
bsw@369
|
102 ui.field.text{
|
bsw@369
|
103 attr = { id = "username_field" },
|
bsw@369
|
104 label = _'login name',
|
bsw@369
|
105 html_name = 'login',
|
bsw@369
|
106 value = ''
|
bsw@369
|
107 }
|
bsw@369
|
108 ui.script{ script = 'document.getElementById("username_field").focus();' }
|
bsw@369
|
109 ui.field.password{
|
bsw@369
|
110 label = _'Password',
|
bsw@369
|
111 html_name = 'password',
|
bsw@369
|
112 value = ''
|
bsw@369
|
113 }
|
bsw@369
|
114 ui.submit{
|
bsw@369
|
115 text = _'Login'
|
bsw@369
|
116 }
|
bsw@369
|
117 end
|
bsw@369
|
118 }
|
bsw/jbe@0
|
119
|
jorges@103
|
120 end
|
jorges@103
|
121
|