Pman.Tab.bjs
[Pman.BAdmin] / Pman.Tab.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman');
6
7 Pman.Tab = new Roo.XComponent({
8
9  _strings : {
10   '0323de4f66a1700e2173e9bcdce02715' :"Logout",
11   '617114bd6ef10884239510062dffa933' :"Your password has been changed",
12   '8f1e77e0d2be21da93cd4d9a939148f7' :"Change Password",
13   '24efa7ee4511563b16144f39706d594f' :"Notice"
14  },
15
16   part     :  ["BAdmin", "Tab" ],
17   order    : '001-Pman.Tab',
18   region   : 'center',
19   parent   : false,
20   name     : "unnamed module",
21   disabled : false, 
22   permname : '', 
23   _tree : function(_data)
24   {
25    var _this = this;
26    var MODULE = this;
27    return {
28    xtype : 'Border',
29    el : document.body,
30    is_root : true,
31    xns : Roo.bootstrap.layout,
32    '|xns' : 'Roo.bootstrap.layout',
33    center : {
34     xtype : 'Region',
35     alwaysShowTabs : true,
36     tabPosition : 'top',
37     xns : Roo.bootstrap.layout,
38     '|xns' : 'Roo.bootstrap.layout'
39    },
40    north : {
41     xtype : 'Region',
42     height : 50,
43     hideTabs : true,
44     xns : Roo.bootstrap.layout,
45     '|xns' : 'Roo.bootstrap.layout'
46    },
47    items  : [
48     {
49      xtype : 'Content',
50      fitContainer : true,
51      region : 'north',
52      xns : Roo.bootstrap.panel,
53      '|xns' : 'Roo.bootstrap.panel',
54      items  : [
55       {
56        xtype : 'NavHeaderbar',
57        autohide : true,
58        brand : '<img src="' + (appLogo ?  appLogo : Roo.BLANK_IMAGE_URL) + '">',
59        brand_href : baseURL,
60        cls : 'headroom animated slideDown container no-srButton',
61        desktopCenter : true,
62        inverse : false,
63        position : 'static-top',
64        srButton : true,
65        style : 'padding-bottom:0px;',
66        xns : Roo.bootstrap,
67        '|xns' : 'Roo.bootstrap',
68        items  : [
69         {
70          xtype : 'NavGroup',
71          align : 'right',
72          style : 'margin-top:0px;margin-bottom:0px;',
73          type : 'nav',
74          xns : Roo.bootstrap,
75          '|xns' : 'Roo.bootstrap',
76          items  : [
77           {
78            xtype : 'NavItem',
79            html : Pman.Login.authUser.name,
80            icon : 'fa fa-user',
81            preventDefault : true,
82            listeners : {
83             render : function (_self)
84              {
85                  this.el.setVisibilityMode(Roo.Element.DISPLAY);
86                  
87                  
88                  
89                  this.el.show();
90              }
91            },
92            xns : Roo.bootstrap,
93            '|xns' : 'Roo.bootstrap',
94            menu : {
95             xtype : 'Menu',
96             cls : 'user-menu',
97             listeners : {
98              show : function (_self)
99               {
100                   var width = Roo.lib.Dom.getViewWidth();
101                   
102                   var xy = this.el.getXY();
103                   
104                   if(width < 480){
105                       xy[0] = 0;
106                       this.el.setXY(xy);
107                       this.el.setStyle('width', width + 'px');
108                   }
109               }
110             },
111             xns : Roo.bootstrap,
112             '|xns' : 'Roo.bootstrap',
113             items  : [
114              {
115               xtype : 'MenuItem',
116               cls : 'user-body',
117               isContainer : true,
118               preventDefault : true,
119               xns : Roo.bootstrap,
120               '|xns' : 'Roo.bootstrap',
121               items  : [
122                {
123                 xtype : 'Row',
124                 xns : Roo.bootstrap,
125                 '|xns' : 'Roo.bootstrap',
126                 items  : [
127                  {
128                   xtype : 'Column',
129                   md : 9,
130                   xns : Roo.bootstrap,
131                   '|xns' : 'Roo.bootstrap',
132                   items  : [
133                    {
134                     xtype : 'Row',
135                     xns : Roo.bootstrap,
136                     '|xns' : 'Roo.bootstrap',
137                     items  : [
138                      {
139                       xtype : 'Column',
140                       md : 12,
141                       style : 'color:#333;',
142                       listeners : {
143                        render : function (_self)
144                         {
145                          
146                             this.el.dom.innerHTML = '<b>' + Pman.Login.authUser.name + '</b>';
147                             
148                         }
149                       },
150                       xns : Roo.bootstrap,
151                       '|xns' : 'Roo.bootstrap'
152                      },
153                      {
154                       xtype : 'Column',
155                       md : 12,
156                       style : 'color:#333;',
157                       listeners : {
158                        render : function (_self)
159                         {
160                            
161                             this.el.dom.innerHTML = Pman.Login.authUser.email;
162                             
163                         }
164                       },
165                       xns : Roo.bootstrap,
166                       '|xns' : 'Roo.bootstrap'
167                      }
168                     ]
169                    }
170                   ]
171                  }
172                 ]
173                }
174               ]
175              },
176              {
177               xtype : 'MenuItem',
178               cls : 'user-footer',
179               isContainer : true,
180               preventDefault : true,
181               xns : Roo.bootstrap,
182               '|xns' : 'Roo.bootstrap',
183               items  : [
184                {
185                 xtype : 'Row',
186                 xns : Roo.bootstrap,
187                 '|xns' : 'Roo.bootstrap',
188                 items  : [
189                  {
190                   xtype : 'Column',
191                   md : 6,
192                   sm : 6,
193                   xs : 6,
194                   xns : Roo.bootstrap,
195                   '|xns' : 'Roo.bootstrap',
196                   items  : [
197                    {
198                     xtype : 'Button',
199                     _change_passwd_success_body : _this._strings['617114bd6ef10884239510062dffa933'] /* Your password has been changed */,
200                     _change_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
201                     html : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
202                     style : 'text-transform:none;',
203                     listeners : {
204                      click : function (e)
205                       {
206                           if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
207                               return;
208                           }
209                           
210                           var _self = this;
211                           
212                           Hydra.Dialog.ChangePassword.show({}, function(res) {
213                               Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
214                           });
215                       }
216                     },
217                     xns : Roo.bootstrap,
218                     '|xns' : 'Roo.bootstrap'
219                    }
220                   ]
221                  },
222                  {
223                   xtype : 'Column',
224                   md : 6,
225                   sm : 6,
226                   style : 'text-align: right;',
227                   xs : 6,
228                   xns : Roo.bootstrap,
229                   '|xns' : 'Roo.bootstrap',
230                   items  : [
231                    {
232                     xtype : 'Button',
233                     html : _this._strings['0323de4f66a1700e2173e9bcdce02715'] /* Logout */,
234                     style : 'text-transform:none;',
235                     listeners : {
236                      click : function (e)
237                       {
238                           window.onbeforeunload = false;
239                           
240                           if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
241                               return;
242                           }
243                           
244                           Roo.Ajax.request({
245                                   url : baseURL + '/Login',
246                                   method: 'POST',
247                                   params : { 
248                                       logout : 1
249                                   },
250                                   success : function()
251                                   {
252                                       location.href = baseURL;
253                                   }
254                               });
255                       
256                       }
257                     },
258                     xns : Roo.bootstrap,
259                     '|xns' : 'Roo.bootstrap'
260                    }
261                   ]
262                  }
263                 ]
264                }
265               ]
266              }
267             ]
268            }
269           }
270          ]
271         }
272        ]
273       },
274       {
275        xtype : 'Form',
276        xns : Roo.bootstrap,
277        '|xns' : 'Roo.bootstrap',
278        items  : [
279         {
280          xtype : 'Img',
281          cls : 'header-logo',
282          imgResponsive : true,
283          style : 'height: 50px;',
284          listeners : {
285           render : function (_self)
286            {
287                if(appLogo) {
288                    _self.el.dom.src = appLogo;
289                }
290            }
291          },
292          xns : Roo.bootstrap,
293          '|xns' : 'Roo.bootstrap'
294         }
295        ]
296       }
297      ]
298     }
299    ]
300   };  }
301 });