| rev |
line source |
|
bsw/jbe@1309
|
1 ui.title(_"Self registration")
|
|
bsw/jbe@1309
|
2 app.html_title.title = _"Self registration"
|
|
bsw/jbe@1309
|
3
|
|
bsw/jbe@1309
|
4 slot.put("<style>select.is-invalid { border-color: #c00; }</style>")
|
|
bsw/jbe@1309
|
5
|
|
bsw/jbe@1309
|
6 ui.container{ attr = { class = "mdl-grid" }, content = function()
|
|
bsw/jbe@1309
|
7 ui.container{ attr = { class = "mdl-cell mdl-cell--12-col" }, content = function()
|
|
bsw/jbe@1309
|
8
|
|
bsw/jbe@1309
|
9 ui.form{
|
|
bsw@1344
|
10 attr = { onsubmit = "document.getElementById('register_button').disabled = true;", enctype = 'multipart/form-data' },
|
|
bsw/jbe@1309
|
11 module = "registration", action = "register",
|
|
bsw@1344
|
12
|
|
bsw/jbe@1309
|
13 routing = {
|
|
bsw/jbe@1309
|
14 error = { mode = "forward", module = "registration", view = "register" }
|
|
bsw/jbe@1309
|
15 },
|
|
bsw/jbe@1309
|
16 content = function()
|
|
bsw/jbe@1309
|
17
|
|
bsw@1490
|
18 if config.self_registration.info_top_html then
|
|
bsw@1490
|
19 slot.put(config.self_registration.info_top_html)
|
|
bsw@1490
|
20 else
|
|
bsw@1490
|
21 ui.container{ content = config.self_registration.info_top }
|
|
bsw@1490
|
22 end
|
|
bsw@1381
|
23 slot.put("<br />")
|
|
bsw/jbe@1309
|
24
|
|
bsw/jbe@1309
|
25 execute.view{ module = "registration", view = "_register_form" }
|
|
bsw/jbe@1309
|
26
|
|
bsw/jbe@1309
|
27 ui.container{
|
|
bsw/jbe@1309
|
28 attr = { class = "use_terms" },
|
|
bsw/jbe@1309
|
29 content = function()
|
|
bsw/jbe@1309
|
30 slot.put(config.use_terms)
|
|
bsw/jbe@1309
|
31 end
|
|
bsw/jbe@1309
|
32 }
|
|
bsw/jbe@1309
|
33
|
|
bsw/jbe@1309
|
34 for i, checkbox in ipairs(config.use_terms_checkboxes) do
|
|
bsw/jbe@1309
|
35 ui.tag{ tag = "label", attr = {
|
|
bsw/jbe@1309
|
36 class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect",
|
|
bsw/jbe@1309
|
37 ["for"] = "use_terms_checkbox_" .. checkbox.name
|
|
bsw/jbe@1309
|
38 },
|
|
bsw/jbe@1309
|
39 content = function()
|
|
bsw/jbe@1309
|
40 ui.tag{
|
|
bsw/jbe@1309
|
41 tag = "input",
|
|
bsw/jbe@1309
|
42 attr = {
|
|
bsw/jbe@1309
|
43 type = "checkbox",
|
|
bsw/jbe@1309
|
44 class = "mdl-checkbox__input",
|
|
bsw/jbe@1309
|
45 id = "use_terms_checkbox_" .. checkbox.name,
|
|
bsw/jbe@1309
|
46 name = "use_terms_checkbox_" .. checkbox.name,
|
|
bsw/jbe@1309
|
47 value = "1",
|
|
bsw/jbe@1309
|
48 style = "float: left;",
|
|
bsw/jbe@1309
|
49 checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil
|
|
bsw/jbe@1309
|
50 }
|
|
bsw/jbe@1309
|
51 }
|
|
bsw/jbe@1309
|
52 ui.tag{
|
|
bsw/jbe@1309
|
53 attr = { class = "mdl-checkbox__label" },
|
|
bsw/jbe@1309
|
54 content = function() slot.put(checkbox.html) end
|
|
bsw/jbe@1309
|
55 }
|
|
bsw/jbe@1309
|
56 end
|
|
bsw/jbe@1309
|
57 }
|
|
bsw/jbe@1309
|
58 slot.put("<br /><br />")
|
|
bsw/jbe@1309
|
59 end
|
|
bsw/jbe@1309
|
60
|
|
bsw/jbe@1309
|
61 ui.container{ content = function()
|
|
bsw/jbe@1309
|
62 slot.put(config.self_registration.info_bottom)
|
|
bsw/jbe@1309
|
63 end }
|
|
bsw/jbe@1309
|
64
|
|
bsw/jbe@1309
|
65 slot.put("<br />")
|
|
bsw/jbe@1309
|
66
|
|
bsw@1490
|
67 local text = _"Proceed with registration"
|
|
bsw@1490
|
68 if config.self_registration.manual_invitation then
|
|
bsw@1490
|
69 text = _"Register now"
|
|
bsw@1490
|
70 end
|
|
bsw/jbe@1309
|
71 ui.tag{
|
|
bsw/jbe@1309
|
72 tag = "input",
|
|
bsw/jbe@1309
|
73 attr = {
|
|
bsw/jbe@1309
|
74 id = "register_button",
|
|
bsw/jbe@1309
|
75 type = "submit",
|
|
bsw/jbe@1309
|
76 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored",
|
|
bsw@1490
|
77 value = text
|
|
bsw/jbe@1309
|
78 }
|
|
bsw/jbe@1309
|
79 }
|
|
bsw@1312
|
80 if config.self_registration.allow_bypass_checks then
|
|
bsw@1312
|
81 slot.put(" ")
|
|
bsw@1312
|
82 ui.tag{
|
|
bsw@1312
|
83 tag = "input",
|
|
bsw@1312
|
84 attr = {
|
|
bsw@1312
|
85 name = "manual_verification",
|
|
bsw@1312
|
86 id = "manual_verification_button",
|
|
bsw@1312
|
87 type = "submit",
|
|
bsw@1312
|
88 class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined",
|
|
bsw@1312
|
89 value = _"Manual verification (w/o mobile)"
|
|
bsw@1312
|
90 }
|
|
bsw/jbe@1309
|
91 }
|
|
bsw@1312
|
92 end
|
|
bsw/jbe@1309
|
93 slot.put(" ")
|
|
bsw@1319
|
94 if config.self_registration.cancel_link then
|
|
bsw@1319
|
95 ui.link{
|
|
bsw@1319
|
96 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
|
|
bsw@1319
|
97 external = config.self_registration.cancel_link, text = _"Cancel"
|
|
bsw@1320
|
98 }
|
|
bsw@1320
|
99 else
|
|
bsw@1320
|
100 ui.link{
|
|
bsw@1320
|
101 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
|
|
bsw@1320
|
102 module = "index", view = "login", text = _"Cancel", params = {
|
|
bsw@1320
|
103 redirect_module = param.get("redirect_module"),
|
|
bsw@1320
|
104 redirect_view = param.get("redirect_view"),
|
|
bsw@1320
|
105 redirect_id = param.get("redirect_id"),
|
|
bsw@1320
|
106 redirect_params = param.get("redirect_params")
|
|
bsw@1319
|
107 }
|
|
bsw@1320
|
108 }
|
|
bsw@1320
|
109 end
|
|
bsw/jbe@1309
|
110 end
|
|
bsw/jbe@1309
|
111 }
|
|
bsw/jbe@1309
|
112
|
|
bsw/jbe@1309
|
113 end }
|
|
bsw/jbe@1309
|
114 end }
|