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     overflow : 'visible',
45     xns : Roo.bootstrap.layout,
46     '|xns' : 'Roo.bootstrap.layout'
47    },
48    items  : [
49     {
50      xtype : 'Content',
51      fitContainer : true,
52      region : 'north',
53      xns : Roo.bootstrap.panel,
54      '|xns' : 'Roo.bootstrap.panel',
55      items  : [
56       {
57        xtype : 'NavHeaderbar',
58        autohide : true,
59        brand : '<img   cls="header-logo" src="' +    Roo.BLANK_IMAGE_URL + '">',
60        cls : 'headroom animated slideDown  no-srButton',
61        desktopCenter : false,
62        inverse : false,
63        position : 'fixed-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 + '<span style="margin-left: 5px;" class="badge badge-primary"></span>',
80            icon : 'fa fa-user',
81            preventDefault : true,
82            updateBadge : function() { },
83            listeners : {
84             render : function (_self)
85              {
86                  _this.user_box = this;
87                  
88                  this.el.setVisibilityMode(Roo.Element.DISPLAY);
89                  
90                  this.el.show();
91                  
92              }
93            },
94            xns : Roo.bootstrap,
95            '|xns' : 'Roo.bootstrap',
96            menu : {
97             xtype : 'Menu',
98             allowDomMove : false,
99             cls : 'user-menu',
100             listeners : {
101              show : function (_self)
102               {
103                   var width = Roo.lib.Dom.getViewWidth();
104                   
105                   var xy = this.el.getXY();
106                   this.el.setStyle('position', 'absolute');
107                   
108                   if(width < 480){
109                       xy[0] = 0;
110                       this.el.setXY(xy);
111                       this.el.setStyle('width', width + 'px');
112                   }
113               }
114             },
115             xns : Roo.bootstrap,
116             '|xns' : 'Roo.bootstrap',
117             items  : [
118              {
119               xtype : 'MenuItem',
120               cls : 'user-body',
121               isContainer : true,
122               preventDefault : true,
123               xns : Roo.bootstrap,
124               '|xns' : 'Roo.bootstrap',
125               items  : [
126                {
127                 xtype : 'Row',
128                 xns : Roo.bootstrap,
129                 '|xns' : 'Roo.bootstrap',
130                 items  : [
131                  {
132                   xtype : 'Column',
133                   md : 9,
134                   mdoff : 3,
135                   xns : Roo.bootstrap,
136                   '|xns' : 'Roo.bootstrap',
137                   items  : [
138                    {
139                     xtype : 'Row',
140                     xns : Roo.bootstrap,
141                     '|xns' : 'Roo.bootstrap',
142                     items  : [
143                      {
144                       xtype : 'Column',
145                       md : 12,
146                       style : 'color:#333;text-align:right',
147                       listeners : {
148                        render : function (_self)
149                         {
150                          
151                             this.el.dom.innerHTML = '<b>' + Pman.Login.authUser.name + '</b>';
152                             
153                         }
154                       },
155                       xns : Roo.bootstrap,
156                       '|xns' : 'Roo.bootstrap'
157                      },
158                      {
159                       xtype : 'Column',
160                       md : 12,
161                       style : 'color:#333;text-align:right',
162                       listeners : {
163                        render : function (_self)
164                         {
165                            
166                             this.el.dom.innerHTML = Pman.Login.authUser.email;
167                             
168                         }
169                       },
170                       xns : Roo.bootstrap,
171                       '|xns' : 'Roo.bootstrap'
172                      }
173                     ]
174                    }
175                   ]
176                  }
177                 ]
178                }
179               ]
180              },
181              {
182               xtype : 'MenuItem',
183               cls : 'user-footer',
184               isContainer : true,
185               preventDefault : true,
186               xns : Roo.bootstrap,
187               '|xns' : 'Roo.bootstrap',
188               items  : [
189                {
190                 xtype : 'Row',
191                 xns : Roo.bootstrap,
192                 '|xns' : 'Roo.bootstrap',
193                 items  : [
194                  {
195                   xtype : 'Column',
196                   md : 6,
197                   sm : 6,
198                   xs : 6,
199                   xns : Roo.bootstrap,
200                   '|xns' : 'Roo.bootstrap',
201                   items  : [
202                    {
203                     xtype : 'Button',
204                     _change_passwd_success_body : _this._strings['617114bd6ef10884239510062dffa933'] /* Your password has been changed */,
205                     _change_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
206                     html : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
207                     style : 'text-transform:none;',
208                     listeners : {
209                      click : function (e)
210                       {
211                       
212                           var _self = this;
213                           
214                           Pman.Dialog.BAdminPassword.show({ id : Pman.Login.authUser.id }, function(res) {
215                               Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
216                           });
217                           
218                       }
219                     },
220                     xns : Roo.bootstrap,
221                     '|xns' : 'Roo.bootstrap'
222                    }
223                   ]
224                  },
225                  {
226                   xtype : 'Column',
227                   md : 6,
228                   sm : 6,
229                   style : 'text-align: right;',
230                   xs : 6,
231                   xns : Roo.bootstrap,
232                   '|xns' : 'Roo.bootstrap',
233                   items  : [
234                    {
235                     xtype : 'Button',
236                     html : _this._strings['0323de4f66a1700e2173e9bcdce02715'] /* Logout */,
237                     style : 'text-transform:none;',
238                     listeners : {
239                      click : function (e)
240                       {
241                           window.onbeforeunload = false;
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     }
276    ]
277   };  }
278 });