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   '8f1e77e0d2be21da93cd4d9a939148f7' :"Change Password",
12   '54d2e870aca5e99bf69f0ee1d494c3b3' :"Update profile",
13   '617114bd6ef10884239510062dffa933' :"Your password has been changed",
14   '24efa7ee4511563b16144f39706d594f' :"Notice"
15  },
16
17   part     :  ["BAdmin", "Tab" ],
18   order    : '001-Pman.Tab',
19   region   : 'center',
20   parent   : false,
21   name     : "unnamed module",
22   disabled : false, 
23   permname : '', 
24   _tree : function(_data)
25   {
26    var _this = this;
27    var MODULE = this;
28    return {
29    xtype : 'Border',
30    el : document.body,
31    is_root : true,
32    xns : Roo.bootstrap.layout,
33    '|xns' : 'Roo.bootstrap.layout',
34    center : {
35     xtype : 'Region',
36     alwaysShowTabs : true,
37     tabPosition : 'top',
38     xns : Roo.bootstrap.layout,
39     '|xns' : 'Roo.bootstrap.layout'
40    },
41    north : {
42     xtype : 'Region',
43     height : 50,
44     hideTabs : true,
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 src="' + if(appLogo) {
60                _self.el.dom.src = appLogo;
61            },
62        brand_href : baseURL,
63        cls : 'headroom animated slideDown container no-srButton',
64        desktopCenter : true,
65        inverse : false,
66        position : 'static-top',
67        srButton : true,
68        style : 'padding-bottom:0px;',
69        xns : Roo.bootstrap,
70        '|xns' : 'Roo.bootstrap',
71        items  : [
72         {
73          xtype : 'NavGroup',
74          align : 'right',
75          style : 'margin-top:0px;margin-bottom:0px;',
76          type : 'nav',
77          xns : Roo.bootstrap,
78          '|xns' : 'Roo.bootstrap',
79          items  : [
80           {
81            xtype : 'NavItem',
82            html : Pman.Login.authUser.name,
83            icon : 'fa fa-user',
84            preventDefault : true,
85            listeners : {
86             render : function (_self)
87              {
88                  this.el.setVisibilityMode(Roo.Element.DISPLAY);
89                  
90                  this.el.hide();
91                  
92                  if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
93                      return;
94                  }
95                  
96                  this.el.show();
97              }
98            },
99            xns : Roo.bootstrap,
100            '|xns' : 'Roo.bootstrap',
101            menu : {
102             xtype : 'Menu',
103             cls : 'user-menu',
104             listeners : {
105              show : function (_self)
106               {
107                   var width = Roo.lib.Dom.getViewWidth();
108                   
109                   var xy = this.el.getXY();
110                   
111                   if(width < 480){
112                       xy[0] = 0;
113                       this.el.setXY(xy);
114                       this.el.setStyle('width', width + 'px');
115                   }
116               }
117             },
118             xns : Roo.bootstrap,
119             '|xns' : 'Roo.bootstrap',
120             items  : [
121              {
122               xtype : 'MenuItem',
123               cls : 'user-body',
124               isContainer : true,
125               preventDefault : true,
126               xns : Roo.bootstrap,
127               '|xns' : 'Roo.bootstrap',
128               items  : [
129                {
130                 xtype : 'Row',
131                 xns : Roo.bootstrap,
132                 '|xns' : 'Roo.bootstrap',
133                 items  : [
134                  {
135                   xtype : 'Column',
136                   md : 3,
137                   xns : Roo.bootstrap,
138                   '|xns' : 'Roo.bootstrap',
139                   items  : [
140                    {
141                     xtype : 'Row',
142                     xns : Roo.bootstrap,
143                     '|xns' : 'Roo.bootstrap',
144                     items  : [
145                      {
146                       xtype : 'Column',
147                       md : 12,
148                       style : 'padding:0px 10px;',
149                       listeners : {
150                        render : function (_self)
151                         {
152                             this.el.setVisibilityMode(Roo.Element.DISPLAY);
153                            
154                             this.el.hide();
155                             
156                             if(
157                                 typeof(Hydra.authUser) == 'undefined' ||
158                                 typeof(Hydra.authUser.profile_photo) != 'object' ||
159                                 Hydra.authUser.profile_photo.id * 1 < 1
160                             ){
161                                 this.el.show();
162                             }
163                         }
164                       },
165                       xns : Roo.bootstrap,
166                       '|xns' : 'Roo.bootstrap',
167                       items  : [
168                        {
169                         xtype : 'Button',
170                         cls : 'fa fa-user fa-4x',
171                         preventDefault : true,
172                         removeClass : true,
173                         listeners : {
174                          click : function (e)
175                           {
176                               if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
177                                   return;
178                               }
179                               
180                               var type = Hydra.authUser.person_type.toLowerCase();
181                               
182                               window.location = baseURL + '/' + type.charAt(0).toUpperCase() + type.slice(1) + 'Main';
183                           }
184                         },
185                         xns : Roo.bootstrap,
186                         '|xns' : 'Roo.bootstrap'
187                        }
188                       ]
189                      },
190                      {
191                       xtype : 'Column',
192                       md : 12,
193                       style : 'padding:0px 10px;',
194                       listeners : {
195                        render : function (_self)
196                         {
197                             this.el.setVisibilityMode(Roo.Element.DISPLAY);
198                            
199                             this.el.show();
200                             
201                             if(
202                                 typeof(Hydra.authUser) == 'undefined' ||
203                                 typeof(Hydra.authUser.profile_photo) != 'object' ||
204                                 Hydra.authUser.profile_photo.id * 1 < 1
205                             ){
206                                 this.el.hide();
207                             }
208                         }
209                       },
210                       xns : Roo.bootstrap,
211                       '|xns' : 'Roo.bootstrap',
212                       items  : [
213                        {
214                         xtype : 'Img',
215                         style : 'cursor:pointer;',
216                         tooltip : 'View Dashboard',
217                         listeners : {
218                          click : function (e)
219                           {
220                               if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
221                                   return;
222                               }
223                               
224                               var type = Hydra.authUser.person_type.toLowerCase();
225                               
226                               window.location = baseURL + '/' + type.charAt(0).toUpperCase() + type.slice(1) + 'Main';
227                           },
228                          render : function (_self)
229                           {
230                               this.el.setVisibilityMode(Roo.Element.DISPLAY);
231                              
232                               this.el.show();
233                               
234                               if(
235                                   typeof(Hydra.authUser) == 'undefined' ||
236                                   typeof(Hydra.authUser.profile_photo) != 'object' ||
237                                   Hydra.authUser.profile_photo.id * 1 < 1
238                               ){
239                                   this.el.hide();
240                                   return;
241                               }
242                               
243                               this.el.attr('src', baseURL + '/Images/Thumb/50/' + Hydra.authUser.profile_photo.id + '/' + Hydra.authUser.profile_photo.filename);
244                               
245                           }
246                         },
247                         xns : Roo.bootstrap,
248                         '|xns' : 'Roo.bootstrap'
249                        }
250                       ]
251                      }
252                     ]
253                    }
254                   ]
255                  },
256                  {
257                   xtype : 'Column',
258                   md : 9,
259                   xns : Roo.bootstrap,
260                   '|xns' : 'Roo.bootstrap',
261                   items  : [
262                    {
263                     xtype : 'Row',
264                     xns : Roo.bootstrap,
265                     '|xns' : 'Roo.bootstrap',
266                     items  : [
267                      {
268                       xtype : 'Column',
269                       md : 12,
270                       style : 'color:#333;',
271                       listeners : {
272                        render : function (_self)
273                         {
274                             if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
275                                 return;
276                             }
277                             
278                             this.el.dom.innerHTML = '<b>' + Hydra.authUser.firstname + ' ' + Hydra.authUser.lastname + '</b>';
279                             
280                         }
281                       },
282                       xns : Roo.bootstrap,
283                       '|xns' : 'Roo.bootstrap'
284                      },
285                      {
286                       xtype : 'Column',
287                       md : 12,
288                       style : 'color:#333;',
289                       listeners : {
290                        render : function (_self)
291                         {
292                             if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
293                                 return;
294                             }
295                             
296                             this.el.dom.innerHTML = Hydra.authUser.email;
297                             
298                         }
299                       },
300                       xns : Roo.bootstrap,
301                       '|xns' : 'Roo.bootstrap'
302                      },
303                      {
304                       xtype : 'Column',
305                       md : 12,
306                       style : 'color:#333;',
307                       xns : Roo.bootstrap,
308                       '|xns' : 'Roo.bootstrap',
309                       items  : [
310                        {
311                         xtype : 'Link',
312                         href : '#',
313                         html : _this._strings['54d2e870aca5e99bf69f0ee1d494c3b3'] /* Update profile */,
314                         preventDefault : true,
315                         listeners : {
316                          click : function (e)
317                           {
318                               
319                               
320                               if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
321                                   return;
322                               }
323                               
324                              
325                               window.location = baseURL + '/Talent';
326                           },
327                          render : function (_self)
328                           {
329                                this.el.setVisibilityMode(Roo.Element.DISPLAY);
330                              
331                               this.el.show();
332                               
333                               if(
334                                   typeof(Hydra.authUser) == 'undefined' ||
335                                   typeof(Hydra.authUser.person_type) == 'undefined' ||
336                                   Hydra.authUser.person_type != 'TALENT'
337                               ){
338                                   this.el.hide();
339                                   return;
340                               }
341                               
342                           }
343                         },
344                         xns : Roo.bootstrap,
345                         '|xns' : 'Roo.bootstrap'
346                        }
347                       ]
348                      }
349                     ]
350                    }
351                   ]
352                  }
353                 ]
354                }
355               ]
356              },
357              {
358               xtype : 'MenuItem',
359               cls : 'user-footer',
360               isContainer : true,
361               preventDefault : true,
362               xns : Roo.bootstrap,
363               '|xns' : 'Roo.bootstrap',
364               items  : [
365                {
366                 xtype : 'Row',
367                 xns : Roo.bootstrap,
368                 '|xns' : 'Roo.bootstrap',
369                 items  : [
370                  {
371                   xtype : 'Column',
372                   md : 6,
373                   sm : 6,
374                   xs : 6,
375                   xns : Roo.bootstrap,
376                   '|xns' : 'Roo.bootstrap',
377                   items  : [
378                    {
379                     xtype : 'Button',
380                     _change_passwd_success_body : _this._strings['617114bd6ef10884239510062dffa933'] /* Your password has been changed */,
381                     _change_passwd_success_title : _this._strings['24efa7ee4511563b16144f39706d594f'] /* Notice */,
382                     html : _this._strings['8f1e77e0d2be21da93cd4d9a939148f7'] /* Change Password */,
383                     style : 'text-transform:none;',
384                     listeners : {
385                      click : function (e)
386                       {
387                           if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
388                               return;
389                           }
390                           
391                           var _self = this;
392                           
393                           Hydra.Dialog.ChangePassword.show({}, function(res) {
394                               Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
395                           });
396                       }
397                     },
398                     xns : Roo.bootstrap,
399                     '|xns' : 'Roo.bootstrap'
400                    }
401                   ]
402                  },
403                  {
404                   xtype : 'Column',
405                   md : 6,
406                   sm : 6,
407                   style : 'text-align: right;',
408                   xs : 6,
409                   xns : Roo.bootstrap,
410                   '|xns' : 'Roo.bootstrap',
411                   items  : [
412                    {
413                     xtype : 'Button',
414                     html : _this._strings['0323de4f66a1700e2173e9bcdce02715'] /* Logout */,
415                     style : 'text-transform:none;',
416                     listeners : {
417                      click : function (e)
418                       {
419                           window.onbeforeunload = false;
420                           
421                           if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
422                               return;
423                           }
424                           
425                           Roo.Ajax.request({
426                                   url : baseURL + '/Login',
427                                   method: 'POST',
428                                   params : { 
429                                       logout : 1
430                                   },
431                                   success : function()
432                                   {
433                                       location.href = baseURL;
434                                   }
435                               });
436                       
437                       }
438                     },
439                     xns : Roo.bootstrap,
440                     '|xns' : 'Roo.bootstrap'
441                    }
442                   ]
443                  }
444                 ]
445                }
446               ]
447              }
448             ]
449            }
450           }
451          ]
452         }
453        ]
454       },
455       {
456        xtype : 'Form',
457        xns : Roo.bootstrap,
458        '|xns' : 'Roo.bootstrap',
459        items  : [
460         {
461          xtype : 'Img',
462          cls : 'header-logo',
463          imgResponsive : true,
464          style : 'height: 50px;',
465          listeners : {
466           render : function (_self)
467            {
468                if(appLogo) {
469                    _self.el.dom.src = appLogo;
470                }
471            }
472          },
473          xns : Roo.bootstrap,
474          '|xns' : 'Roo.bootstrap'
475         }
476        ]
477       }
478      ]
479     }
480    ]
481   };  }
482 });