Pman.Dialog.Login.bjs
[Pman.BAdmin] / Pman.Dialog.Login.bjs
1 {
2  "name" : "Pman.Dialog.Login",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/johns/gitlive/Pman.BAdmin/Pman.Dialog.Login.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "e50b62fb8271673bacc2cfd9d80fbe7a" : "Login to the Management Portal",
10   "99dea78007133396a7b8ed70578ac6ae" : "Login",
11   "cfcd208495d565ef66e7dff9f98764da" : "0",
12   "dc647eb65e6711e155375218212b3964" : "Password",
13   "01a569ddc6cf67ddec2a683f0a5f5956" : "Forgot your password?",
14   "06cf692a8d2bb0ab8318dc6c839ae931" : "Two-Factor Authentication Number (if relevant)",
15   "11163ed17ad9afc7680bb9e92f15d6fd" : "We have sent you a link to reset your password",
16   "5047040b025ce0295b58d42250014417" : "<div id=\"login-err\" class=\"dialog-err\" style=\"color:red\"></div>",
17   "24efa7ee4511563b16144f39706d594f" : "Notice",
18   "643a860f992333b8600ea264aca7c4fc" : "Email Address"
19  },
20  "items" : [
21   {
22    "listeners" : {
23     "btnclick" : "function (e)\n{\n    if(e == 'cancel'){\n        _this.dialog.hide();\n        return;\n    }\n    \n    _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n    _this.form.doAction('submit');\n}",
24     "|render" : "function (_self) {\n\n    Roo.get('login-err').dom.innerHTML = \"\";\n    _this.dialog.el.select('.modal-content', true).first().unmask();\n    \n    if(Roo.isTouch){\n        this.animate = false;\n    }\n}\n    ",
25     "show" : "function (_self)\n{\n \n    \n    this.setTitle( _this.dialog._dialog_title_login );\n    \n    if (!Roo.state.Manager.getProvider().expires) {\n        Roo.state.Manager.setProvider(new Roo.state.CookieProvider());\n    }\n    \n    _this.lastLogin = Roo.state.Manager.get('Pman.Login', {});\n    _this.form.findField('username').focus();\n    \n    \n}"
26    },
27    "String cls" : "enable-overflow login-dialog",
28    "Boolean allow_close" : false,
29    "xtype" : "Modal",
30    "buttonPosition" : "center",
31    "$ buttons" : "Roo.bootstrap.Modal.OK",
32    "$ xns" : "Roo.bootstrap",
33    "string _dialog_title_login" : "Login to the Management Portal",
34    "items" : [
35     {
36      "listeners" : {
37       "render" : "function (_self)\n{\n    _this.login = this;\n    \n    this.el.setVisibilityMode(Roo.Element.DISPLAY);\n}"
38      },
39      "xtype" : "Row",
40      "$ xns" : "Roo.bootstrap",
41      "items" : [
42       {
43        "xtype" : "Column",
44        "Number xs" : 12,
45        "$ xns" : "Roo.bootstrap",
46        "items" : [
47         {
48          "xtype" : "Row",
49          "$ xns" : "Roo.bootstrap",
50          "String style" : "margin-top:20px;",
51          "items" : [
52           {
53            "xtype" : "Container",
54            "cls" : "col-md-12",
55            "$ xns" : "Roo.bootstrap",
56            "items" : [
57             {
58              "listeners" : {
59               "|actionfailed" : "function (_self, action) {\n    Roo.log('action failed?!');\n    Roo.log(action);\n    \n    _this.dialog.el.select('.modal-content', true).first().unmask();\n    \n    if (typeof(action) != 'undefined' && action.failureType == 'server') {\n    \n        if(action.result.errorMsg == 'Authenticated'){\n            var data = Roo.apply(action.result.errors);\n            \n            data.target = _this.form.findField('username').getValue();\n            \n            Roo.bootstrap.MessageBox.alert(\"Error\", \"odd error messages\")\n            \n        }\n        \n        Roo.get('login-err').dom.innerHTML = action.result.errorMsg;\n        return;\n    }\n    \n    Roo.get('login-err').dom.innerHTML = \"Fill in all the required fields\";\n}",
60               "|actioncomplete" : "function (_self, action) {\n    \n    if(action.type == 'setdata'){\n\n        if(\n            _this.lastLogin && \n            _this.lastLogin.login_provider == ''\n        ){\n            _this.form.findField('username').setValue(_this.lastLogin.email);\n        }\n        \n        Roo.get('login-err').dom.innerHTML = \"\";\n        _this.dialog.el.select('.modal-content', true).first().unmask();\n        this.clearInvalid();\n        return;\n    }\n     \n    if(action.type == 'load'){\n        \n        return;\n    }\n    \n    if (action.type =='submit') {\n    \n        _this.dialog.hide();\n    \n        if (_this.callback) {\n            _this.callback.call(_this, action.result);\n         }\n         \n         _this.form.reset();\n         \n         return;\n    }\n}",
61               "|render" : "function (_self) {\n    _this.form = _self;\n}"
62              },
63              "$ url" : "baseURL + '/Login'",
64              "labelAlign" : "left",
65              "xtype" : "Form",
66              "method" : "POST",
67              "$ xns" : "Roo.bootstrap",
68              "Boolean loadMask" : false,
69              "items" : [
70               {
71                "xtype" : "Container",
72                "cls" : "col-sm-12",
73                "$ xns" : "Roo.bootstrap",
74                "items" : [
75                 {
76                  "listeners" : {
77                   "specialkey" : "function (_self, e)\n{\n    if(e.getKey() == 13){\n        _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n        _this.form.doAction('submit');\n    }\n    \n}"
78                  },
79                  "inputType" : "email",
80                  "vtype" : "email",
81                  "xtype" : "Input",
82                  "placeholder" : "Email Address",
83                  "allowBlank" : false,
84                  "$ xns" : "Roo.bootstrap",
85                  "name" : "username"
86                 },
87                 {
88                  "listeners" : {
89                   "specialkey" : "function (_self, e)\n{\n    if(e.getKey() == 13){\n        _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n        _this.form.doAction('submit');\n    }\n}"
90                  },
91                  "inputType" : "password",
92                  "xtype" : "Input",
93                  "placeholder" : "Password",
94                  "allowBlank" : false,
95                  "$ xns" : "Roo.bootstrap",
96                  "name" : "password"
97                 },
98                 {
99                  "listeners" : {
100                   "specialkey" : "function (_self, e)\n{\n    if(e.getKey() == 13){\n        _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n        _this.form.doAction('submit');\n    }\n}"
101                  },
102                  "xtype" : "Input",
103                  "placeholder" : "Two-Factor Authentication Number (if relevant)",
104                  "allowBlank" : true,
105                  "String inputType" : "number",
106                  "$ xns" : "Roo.bootstrap",
107                  "name" : "oath_password"
108                 },
109                 {
110                  "inputType" : "hidden",
111                  "xtype" : "Input",
112                  "$ xns" : "Roo.bootstrap",
113                  "string value" : 0,
114                  "name" : "_force"
115                 }
116                ]
117               }
118              ]
119             }
120            ]
121           }
122          ]
123         },
124         {
125          "xtype" : "Row",
126          "$ xns" : "Roo.bootstrap",
127          "String style" : "margin-top: 20px;",
128          "items" : [
129           {
130            "xtype" : "Column",
131            "Number xs" : 6,
132            "$ xns" : "Roo.bootstrap",
133            "items" : [
134             {
135              "listeners" : {
136               "|click" : "function () {\n\n    _this.dialog.hide();\n    \n    var email = _this.form.findField('username').getValue();\n    \n    var _self = this;\n    \n    Pman.Dialog.BAdminForgotPassword.show({email : email}, function(){\n        Roo.bootstrap.MessageBox.alert(_self._forgot_passwd_success_title, _self._forgot_passwd_success_body);\n    });\n}"
137              },
138              "tag" : "a",
139              "xtype" : "Button",
140              "html" : "Forgot your password?",
141              "Boolean removeClass" : true,
142              "string _forgot_passwd_success_title" : "Notice",
143              "$ xns" : "Roo.bootstrap",
144              "weight" : "link",
145              "string _forgot_passwd_success_body" : "We have sent you a link to reset your password",
146              "href" : "#"
147             }
148            ]
149           }
150          ]
151         },
152         {
153          "xtype" : "Row",
154          "$ xns" : "Roo.bootstrap",
155          "items" : [
156           {
157            "xtype" : "Container",
158            "cls" : "col-md-12",
159            "$ xns" : "Roo.bootstrap",
160            "items" : [
161             {
162              "xtype" : "Container",
163              "style" : "margin-top:20px;",
164              "cls" : "bg-danger",
165              "html" : "<div id=\"login-err\" class=\"dialog-err\" style=\"color:red\"></div>",
166              "$ xns" : "Roo.bootstrap"
167             }
168            ]
169           }
170          ]
171         }
172        ]
173       }
174      ]
175     },
176     {
177      "listeners" : {
178       "click" : "function (_self, e)\n{\n    _this.dialog.el.select('.modal-content', true).first().mask('Sending...');\n    _this.form.doAction('submit');\n}"
179      },
180      "xtype" : "Button",
181      "html" : "Login",
182      "$ string weight" : "'primary'",
183      "$ xns" : "Roo.bootstrap",
184      "String style" : "float: left",
185      "* prop" : "buttons[]"
186     },
187     {
188     }
189    ]
190   }
191  ]
192 }