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">0</span>',
80            icon : 'fa fa-user',
81            preventDefault : true,
82            listeners : {
83             render : function (_self)
84              {
85                  _this.user_box = this;
86                  
87                  this.el.setVisibilityMode(Roo.Element.DISPLAY);
88                  
89                  this.el.show();
90                  
91              }
92            },
93            xns : Roo.bootstrap,
94            '|xns' : 'Roo.bootstrap',
95            menu : {
96             xtype : 'Menu',
97             allowDomMove : false,
98             cls : 'user-menu',
99             listeners : {
100              show : function (_self)
101               {
102                   var width = Roo.lib.Dom.getViewWidth();
103                   
104                   var xy = this.el.getXY();
105                   this.el.setStyle('position', 'absolute');
106                   
107                   if(width < 480){
108                       xy[0] = 0;
109                       this.el.setXY(xy);
110                       this.el.setStyle('width', width + 'px');
111                   }
112               }
113             },
114             xns : Roo.bootstrap,
115             '|xns' : 'Roo.bootstrap',
116             items  : [
117              {
118               xtype : 'MenuItem',
119               cls : 'user-body',
120               isContainer : true,
121               preventDefault : true,
122               xns : Roo.bootstrap,
123               '|xns' : 'Roo.bootstrap',
124               items  : [
125                {
126                 xtype : 'Row',
127                 xns : Roo.bootstrap,
128                 '|xns' : 'Roo.bootstrap',
129                 items  : [
130                  {
131                   xtype : 'Column',
132                   md : 9,
133                   mdoff : 3,
134                   xns : Roo.bootstrap,
135                   '|xns' : 'Roo.bootstrap',
136                   items  : [
137                    {
138                     xtype : 'Row',
139                     xns : Roo.bootstrap,
140                     '|xns' : 'Roo.bootstrap',
141                     items  : [
142                      {
143                       xtype : 'Column',
144                       md : 12,
145                       style : 'color:#333;text-align:right',
146                       listeners : {
147                        render : function (_self)
148                         {
149                          
150                             this.el.dom.innerHTML = '<b>' + Pman.Login.authUser.name + '</b>';
151                             
152                         }
153                       },
154                       xns : Roo.bootstrap,
155                       '|xns' : 'Roo.bootstrap'
156                      },
157                      {
158                       xtype : 'Column',
159                       md : 12,
160                       style : 'color:#333;text-align:right',
161                       listeners : {
162                        render : function (_self)
163                         {
164                            
165                             this.el.dom.innerHTML = Pman.Login.authUser.email;
166                             
167                         }
168                       },
169                       xns : Roo.bootstrap,
170                       '|xns' : 'Roo.bootstrap'
171                      }
172                     ]
173                    }
174                   ]
175                  }
176                 ]
177                }
178               ]
179              },
180              {
181               xtype : 'MenuItem',
182               cls : 'user-footer',
183               isContainer : true,
184               preventDefault : true,
185               xns : Roo.bootstrap,
186               '|xns' : 'Roo.bootstrap',
187               items  : [
188                {
189                 xtype : 'Row',
190                 xns : Roo.bootstrap,
191                 '|xns' : 'Roo.bootstrap',
192                 items  : [
193                  {
194                   xtype : 'Column',
195                   md : 6,
196                   sm : 6,
197                   xs : 6,
198                   xns : Roo.bootstrap,
199                   '|xns' : 'Roo.bootstrap',
200                   items  : [
201                    {
202                     xtype : 'Button',
203                     _change_passwd_success_body : _this._strings['617114bd6ef10884239510062dffa933'] /* Your password has been changed */,
204                     _change_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
205                     html : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
206                     style : 'text-transform:none;',
207                     listeners : {
208                      click : function (e)
209                       {
210                       
211                           var _self = this;
212                           
213                           Pman.Dialog.BAdminPassword.show({ id : Pman.Login.authUser.id }, function(res) {
214                               Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
215                           });
216                           
217                       }
218                     },
219                     xns : Roo.bootstrap,
220                     '|xns' : 'Roo.bootstrap'
221                    }
222                   ]
223                  },
224                  {
225                   xtype : 'Column',
226                   md : 6,
227                   sm : 6,
228                   style : 'text-align: right;',
229                   xs : 6,
230                   xns : Roo.bootstrap,
231                   '|xns' : 'Roo.bootstrap',
232                   items  : [
233                    {
234                     xtype : 'Button',
235                     html : _this._strings['0323de4f66a1700e2173e9bcdce02715'] /* Logout */,
236                     style : 'text-transform:none;',
237                     listeners : {
238                      click : function (e)
239                       {
240                           window.onbeforeunload = false;
241                           
242                           
243                           Roo.Ajax.request({
244                                   url : baseURL + '/Login',
245                                   method: 'POST',
246                                   params : { 
247                                       logout : 1
248                                   },
249                                   success : function()
250                                   {
251                                       location.href = baseURL;
252                                   }
253                               });
254                       
255                       }
256                     },
257                     xns : Roo.bootstrap,
258                     '|xns' : 'Roo.bootstrap'
259                    }
260                   ]
261                  }
262                 ]
263                }
264               ]
265              }
266             ]
267            }
268           }
269          ]
270         }
271        ]
272       }
273      ]
274     }
275    ]
276   };  }
277 });