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