rev |
line source |
bsw@441
|
1 execute.view{ module = "index", view = "_lang_chooser" }
|
bsw@441
|
2
|
bsw@989
|
3 ui.title(_"Reset password")
|
bsw/jbe@6
|
4
|
bsw@1045
|
5 ui.section( function()
|
bsw@1045
|
6
|
bsw@1045
|
7 ui.sectionHead( function()
|
bsw@1045
|
8 ui.heading{ level = 1, content = _"Reset password" }
|
bsw@1045
|
9 end )
|
bsw@1045
|
10
|
bsw@1045
|
11 ui.sectionRow( function()
|
bsw/jbe@6
|
12
|
bsw/jbe@6
|
13
|
bsw@1045
|
14 local secret = param.get("secret")
|
bsw/jbe@6
|
15
|
bsw@1045
|
16 if not secret then
|
bsw/jbe@6
|
17 ui.tag{
|
bsw/jbe@6
|
18 tag = 'p',
|
bsw@1045
|
19 content = _'Please enter your login name. You will receive an email with a link to reset your password.'
|
bsw/jbe@6
|
20 }
|
bsw@1045
|
21 ui.form{
|
bsw@1045
|
22 attr = { class = "vertical" },
|
bsw@1045
|
23 module = "index",
|
bsw@1045
|
24 action = "reset_password",
|
bsw@1045
|
25 routing = {
|
bsw@1045
|
26 ok = {
|
bsw@1045
|
27 mode = "redirect",
|
bsw@1045
|
28 module = "index",
|
bsw@1045
|
29 view = "index"
|
bsw@1045
|
30 }
|
bsw@1045
|
31 },
|
bsw@1045
|
32 content = function()
|
bsw@1045
|
33 ui.field.text{
|
bsw@1045
|
34 label = _"login name",
|
bsw@1045
|
35 name = "login"
|
bsw@1045
|
36 }
|
bsw@1045
|
37
|
bsw@1045
|
38 ui.container { attr = { class = "actions" }, content = function()
|
bsw@1045
|
39 ui.tag{
|
bsw@1045
|
40 tag = "input",
|
bsw@1045
|
41 attr = {
|
bsw@1045
|
42 type = "submit",
|
bsw@1045
|
43 class = "btn btn-default",
|
bsw@1045
|
44 value = _"Request password reset link"
|
bsw@1045
|
45 },
|
bsw@1045
|
46 content = ""
|
bsw@1045
|
47 }
|
bsw@1045
|
48 slot.put("<br /><br />")
|
bsw@1045
|
49 ui.link{ module = "index", view = "send_login", text = _"Forgot login name?" }
|
bsw@1045
|
50 slot.put(" ")
|
bsw@1045
|
51 ui.link{
|
bsw@1045
|
52 content = function()
|
bsw@1045
|
53 slot.put(_"Cancel")
|
bsw@1045
|
54 end,
|
bsw@1045
|
55 module = "index",
|
bsw@1045
|
56 view = "login"
|
bsw@1045
|
57 }
|
bsw@1045
|
58 end }
|
bsw@1045
|
59 end
|
bsw/jbe@6
|
60 }
|
bsw@1045
|
61
|
bsw@1045
|
62 else
|
bsw@1045
|
63
|
bsw@1045
|
64 ui.form{
|
bsw@1045
|
65 attr = { class = "vertical" },
|
bsw@1045
|
66 module = "index",
|
bsw@1045
|
67 action = "reset_password",
|
bsw@1045
|
68 routing = {
|
bsw@1045
|
69 ok = {
|
bsw@1045
|
70 mode = "redirect",
|
bsw@1045
|
71 module = "index",
|
bsw@1045
|
72 view = "index"
|
bsw@1045
|
73 }
|
bsw@1045
|
74 },
|
bsw@1045
|
75 content = function()
|
bsw@1045
|
76 ui.tag{
|
bsw@1045
|
77 tag = 'p',
|
bsw@1045
|
78 content = _'Please enter the email reset code you have received:'
|
bsw@1045
|
79 }
|
bsw@1045
|
80 ui.field.text{
|
bsw@1045
|
81 label = _"Reset code",
|
bsw@1045
|
82 name = "secret",
|
bsw@1045
|
83 value = secret
|
bsw@1045
|
84 }
|
bsw@1045
|
85 ui.tag{
|
bsw@1045
|
86 tag = 'p',
|
bsw@1045
|
87 content = _'Please enter your new password twice.'
|
bsw@1045
|
88 }
|
bsw@1045
|
89 ui.field.password{
|
bsw@1045
|
90 label = "New password",
|
bsw@1045
|
91 name = "password1"
|
bsw@1045
|
92 }
|
bsw@1045
|
93 ui.field.password{
|
bsw@1045
|
94 label = "New password (repeat)",
|
bsw@1045
|
95 name = "password2"
|
bsw@1045
|
96 }
|
bsw@1045
|
97
|
bsw@1045
|
98 ui.container { attr = { class = "actions" }, content = function()
|
bsw@1045
|
99 ui.tag{
|
bsw@1045
|
100 tag = "input",
|
bsw@1045
|
101 attr = {
|
bsw@1045
|
102 type = "submit",
|
bsw@1045
|
103 class = "btn btn-default",
|
bsw@1045
|
104 value = _"Save new password"
|
bsw@1045
|
105 },
|
bsw@1045
|
106 content = ""
|
bsw@1045
|
107 }
|
bsw@1045
|
108 slot.put("<br />")
|
bsw@1045
|
109 slot.put("<br />")
|
bsw@1045
|
110
|
bsw@1045
|
111 ui.link{
|
bsw@1045
|
112 content = function()
|
bsw@1045
|
113 slot.put(_"Cancel")
|
bsw@1045
|
114 end,
|
bsw@1045
|
115 module = "index",
|
bsw@1045
|
116 view = "login"
|
bsw@1045
|
117 }
|
bsw@1045
|
118 end }
|
bsw@1045
|
119 end
|
bsw/jbe@6
|
120 }
|
bsw@1045
|
121
|
bsw/jbe@6
|
122 end
|
bsw@1045
|
123 end )
|
bsw@1045
|
124 end ) |