| 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/jbe@1309
|
10 attr = { onsubmit = "document.getElementById('register_button').disabled = true;" },
|
|
bsw/jbe@1309
|
11 module = "registration", action = "register",
|
|
bsw@1343
|
12 enctype = 'multipart/form-data',
|
|
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/jbe@1309
|
18 ui.container{ content = config.self_registration.info_top }
|
|
bsw/jbe@1309
|
19
|
|
bsw/jbe@1309
|
20 execute.view{ module = "registration", view = "_register_form" }
|
|
bsw/jbe@1309
|
21
|
|
bsw/jbe@1309
|
22 ui.container{
|
|
bsw/jbe@1309
|
23 attr = { class = "use_terms" },
|
|
bsw/jbe@1309
|
24 content = function()
|
|
bsw/jbe@1309
|
25 slot.put(config.use_terms)
|
|
bsw/jbe@1309
|
26 end
|
|
bsw/jbe@1309
|
27 }
|
|
bsw/jbe@1309
|
28
|
|
bsw/jbe@1309
|
29 for i, checkbox in ipairs(config.use_terms_checkboxes) do
|
|
bsw/jbe@1309
|
30 ui.tag{ tag = "label", attr = {
|
|
bsw/jbe@1309
|
31 class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect",
|
|
bsw/jbe@1309
|
32 ["for"] = "use_terms_checkbox_" .. checkbox.name
|
|
bsw/jbe@1309
|
33 },
|
|
bsw/jbe@1309
|
34 content = function()
|
|
bsw/jbe@1309
|
35 ui.tag{
|
|
bsw/jbe@1309
|
36 tag = "input",
|
|
bsw/jbe@1309
|
37 attr = {
|
|
bsw/jbe@1309
|
38 type = "checkbox",
|
|
bsw/jbe@1309
|
39 class = "mdl-checkbox__input",
|
|
bsw/jbe@1309
|
40 id = "use_terms_checkbox_" .. checkbox.name,
|
|
bsw/jbe@1309
|
41 name = "use_terms_checkbox_" .. checkbox.name,
|
|
bsw/jbe@1309
|
42 value = "1",
|
|
bsw/jbe@1309
|
43 style = "float: left;",
|
|
bsw/jbe@1309
|
44 checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil
|
|
bsw/jbe@1309
|
45 }
|
|
bsw/jbe@1309
|
46 }
|
|
bsw/jbe@1309
|
47 ui.tag{
|
|
bsw/jbe@1309
|
48 attr = { class = "mdl-checkbox__label" },
|
|
bsw/jbe@1309
|
49 content = function() slot.put(checkbox.html) end
|
|
bsw/jbe@1309
|
50 }
|
|
bsw/jbe@1309
|
51 end
|
|
bsw/jbe@1309
|
52 }
|
|
bsw/jbe@1309
|
53 slot.put("<br /><br />")
|
|
bsw/jbe@1309
|
54 end
|
|
bsw/jbe@1309
|
55
|
|
bsw/jbe@1309
|
56 ui.container{ content = function()
|
|
bsw/jbe@1309
|
57 slot.put(config.self_registration.info_bottom)
|
|
bsw/jbe@1309
|
58 end }
|
|
bsw/jbe@1309
|
59
|
|
bsw/jbe@1309
|
60 slot.put("<br />")
|
|
bsw/jbe@1309
|
61
|
|
bsw/jbe@1309
|
62 ui.tag{
|
|
bsw/jbe@1309
|
63 tag = "input",
|
|
bsw/jbe@1309
|
64 attr = {
|
|
bsw/jbe@1309
|
65 id = "register_button",
|
|
bsw/jbe@1309
|
66 type = "submit",
|
|
bsw/jbe@1309
|
67 class = "mdl-button mdl-js-button mdl-button--raised mdl-button--colored",
|
|
bsw/jbe@1309
|
68 value = _"Proceed with registration"
|
|
bsw/jbe@1309
|
69 }
|
|
bsw/jbe@1309
|
70 }
|
|
bsw@1312
|
71 if config.self_registration.allow_bypass_checks then
|
|
bsw@1312
|
72 slot.put(" ")
|
|
bsw@1312
|
73 ui.tag{
|
|
bsw@1312
|
74 tag = "input",
|
|
bsw@1312
|
75 attr = {
|
|
bsw@1312
|
76 name = "manual_verification",
|
|
bsw@1312
|
77 id = "manual_verification_button",
|
|
bsw@1312
|
78 type = "submit",
|
|
bsw@1312
|
79 class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined",
|
|
bsw@1312
|
80 value = _"Manual verification (w/o mobile)"
|
|
bsw@1312
|
81 }
|
|
bsw/jbe@1309
|
82 }
|
|
bsw@1312
|
83 end
|
|
bsw/jbe@1309
|
84 slot.put(" ")
|
|
bsw@1319
|
85 if config.self_registration.cancel_link then
|
|
bsw@1319
|
86 ui.link{
|
|
bsw@1319
|
87 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
|
|
bsw@1319
|
88 external = config.self_registration.cancel_link, text = _"Cancel"
|
|
bsw@1320
|
89 }
|
|
bsw@1320
|
90 else
|
|
bsw@1320
|
91 ui.link{
|
|
bsw@1320
|
92 attr = { class = "mdl-button mdl-js-button mdl-js-ripple-effect mdl-button--underlined" },
|
|
bsw@1320
|
93 module = "index", view = "login", text = _"Cancel", params = {
|
|
bsw@1320
|
94 redirect_module = param.get("redirect_module"),
|
|
bsw@1320
|
95 redirect_view = param.get("redirect_view"),
|
|
bsw@1320
|
96 redirect_id = param.get("redirect_id"),
|
|
bsw@1320
|
97 redirect_params = param.get("redirect_params")
|
|
bsw@1319
|
98 }
|
|
bsw@1320
|
99 }
|
|
bsw@1320
|
100 end
|
|
bsw/jbe@1309
|
101 end
|
|
bsw/jbe@1309
|
102 }
|
|
bsw/jbe@1309
|
103
|
|
bsw/jbe@1309
|
104 end }
|
|
bsw/jbe@1309
|
105 end }
|