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