Pman.Tab = new Roo.XComponent({
_strings : {
+ '7b7bc2512ee1fedcd76bdc68926d4f7b' :"Administrator",
'0323de4f66a1700e2173e9bcdce02715' :"Logout",
'8f1e77e0d2be21da93cd4d9a939148f7' :"Change Password",
- '54d2e870aca5e99bf69f0ee1d494c3b3' :"Update profile",
'617114bd6ef10884239510062dffa933' :"Your password has been changed",
'24efa7ee4511563b16144f39706d594f' :"Notice"
},
xtype : 'Border',
el : document.body,
is_root : true,
+ listeners : {
+ render : function (_self)
+ {
+
+ }
+ },
xns : Roo.bootstrap.layout,
'|xns' : 'Roo.bootstrap.layout',
center : {
xtype : 'Region',
alwaysShowTabs : true,
+ cls : 'pman-admin-center',
tabPosition : 'top',
xns : Roo.bootstrap.layout,
'|xns' : 'Roo.bootstrap.layout'
xtype : 'Region',
height : 50,
hideTabs : true,
+ overflow : 'visible',
xns : Roo.bootstrap.layout,
'|xns' : 'Roo.bootstrap.layout'
},
{
xtype : 'NavHeaderbar',
autohide : true,
- brand : '<img src="' + appLogo ? appLogo : Roo.BLANK_IMAGE_URL + '">',
- brand_href : baseURL,
- cls : 'headroom animated slideDown container no-srButton',
- desktopCenter : true,
+ brand : '<img cls="header-logo" src="' + Roo.BLANK_IMAGE_URL + '">',
+ cls : 'headroom animated slideDown no-srButton pman-admin-header',
+ desktopCenter : false,
inverse : false,
- position : 'static-top',
+ position : 'fixed-top',
srButton : true,
- style : 'padding-bottom:0px;',
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
xtype : 'NavGroup',
align : 'right',
- style : 'margin-top:0px;margin-bottom:0px;',
type : 'nav',
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
xtype : 'NavItem',
- html : Pman.Login.authUser.name,
+ html : Pman.Login.authUser.name + '<span style="margin-left: 5px;" class="badge badge-primary"></span>',
icon : 'fa fa-user',
preventDefault : true,
+ updateBadge : function() { },
listeners : {
render : function (_self)
{
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
+ _this.user_box = this;
- this.el.hide();
-
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
+ this.el.setVisibilityMode(Roo.Element.DISPLAY);
this.el.show();
}
'|xns' : 'Roo.bootstrap',
menu : {
xtype : 'Menu',
+ allowDomMove : false,
cls : 'user-menu',
+ hideTrigger : true,
listeners : {
show : function (_self)
{
var width = Roo.lib.Dom.getViewWidth();
var xy = this.el.getXY();
+ this.el.setStyle('position', 'absolute');
if(width < 480){
xy[0] = 0;
items : [
{
xtype : 'Column',
- md : 3,
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Row',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Column',
- md : 12,
- style : 'padding:0px 10px;',
- listeners : {
- render : function (_self)
- {
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.hide();
-
- if(
- typeof(Hydra.authUser) == 'undefined' ||
- typeof(Hydra.authUser.profile_photo) != 'object' ||
- Hydra.authUser.profile_photo.id * 1 < 1
- ){
- this.el.show();
- }
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Button',
- cls : 'fa fa-user fa-4x',
- preventDefault : true,
- removeClass : true,
- listeners : {
- click : function (e)
- {
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
-
- var type = Hydra.authUser.person_type.toLowerCase();
-
- window.location = baseURL + '/' + type.charAt(0).toUpperCase() + type.slice(1) + 'Main';
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- },
- {
- xtype : 'Column',
- md : 12,
- style : 'padding:0px 10px;',
- listeners : {
- render : function (_self)
- {
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.show();
-
- if(
- typeof(Hydra.authUser) == 'undefined' ||
- typeof(Hydra.authUser.profile_photo) != 'object' ||
- Hydra.authUser.profile_photo.id * 1 < 1
- ){
- this.el.hide();
- }
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Img',
- style : 'cursor:pointer;',
- tooltip : 'View Dashboard',
- listeners : {
- click : function (e)
- {
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
-
- var type = Hydra.authUser.person_type.toLowerCase();
-
- window.location = baseURL + '/' + type.charAt(0).toUpperCase() + type.slice(1) + 'Main';
- },
- render : function (_self)
- {
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.show();
-
- if(
- typeof(Hydra.authUser) == 'undefined' ||
- typeof(Hydra.authUser.profile_photo) != 'object' ||
- Hydra.authUser.profile_photo.id * 1 < 1
- ){
- this.el.hide();
- return;
- }
-
- this.el.attr('src', baseURL + '/Images/Thumb/50/' + Hydra.authUser.profile_photo.id + '/' + Hydra.authUser.profile_photo.filename);
-
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
- }
- ]
- }
- ]
- },
- {
- xtype : 'Column',
- md : 9,
+ md : 12,
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
items : [
{
xtype : 'Column',
+ cls : 'text-primary',
md : 12,
- style : 'color:#333;',
listeners : {
render : function (_self)
{
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
-
- this.el.dom.innerHTML = '<b>' + Hydra.authUser.firstname + ' ' + Hydra.authUser.lastname + '</b>';
+ this.el.dom.innerHTML = '<b>' + Pman.Login.authUser.name + '</b>';
}
},
{
xtype : 'Column',
md : 12,
- style : 'color:#333;',
+ style : 'color:#777;',
listeners : {
render : function (_self)
{
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
-
- this.el.dom.innerHTML = Hydra.authUser.email;
+
+ this.el.dom.innerHTML = Pman.Login.authUser.email;
}
},
{
xtype : 'Column',
md : 12,
- style : 'color:#333;',
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
{
- xtype : 'Link',
- href : '#',
- html : _this._strings['54d2e870aca5e99bf69f0ee1d494c3b3'] /* Update profile */,
- preventDefault : true,
+ xtype : 'Button',
+ html : _this._strings['7b7bc2512ee1fedcd76bdc68926d4f7b'] /* Administrator */,
+ style : 'padding: 0px;text-decoration: none; color:#777;',
+ weight : 'link',
listeners : {
- click : function (e)
+ click : function (_self, e)
{
-
-
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
+ if(window.location.href.indexOf('_super_admin=1') * 1 != -1) {
+ window.open(baseURL,'_self');
return;
}
-
- window.location = baseURL + '/Talent';
+ window.open(baseURL + '?_super_admin=1','_self');
},
render : function (_self)
{
- this.el.setVisibilityMode(Roo.Element.DISPLAY);
-
- this.el.show();
-
- if(
- typeof(Hydra.authUser) == 'undefined' ||
- typeof(Hydra.authUser.person_type) == 'undefined' ||
- Hydra.authUser.person_type != 'TALENT'
- ){
- this.el.hide();
- return;
- }
+ _this.super_admin_btn = this;
}
},
cls : 'user-footer',
isContainer : true,
preventDefault : true,
+ listeners : {
+ childrenrendered : function (_self)
+ {
+ _this.super_admin_btn.hide();
+
+ if(Pman.Login.authUser.groups.indexOf('Administrators') * 1 != -1) {
+ _this.super_admin_btn.show();
+ }
+ }
+ },
xns : Roo.bootstrap,
'|xns' : 'Roo.bootstrap',
items : [
listeners : {
click : function (e)
{
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
-
var _self = this;
- Hydra.Dialog.ChangePassword.show({}, function(res) {
- Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
- });
+ Pman.Dialog.BAdminPassword.show(
+ {},
+ function(res) {
+ Roo.bootstrap.MessageBox.alert(_self._change_passwd_success_title, _self._change_passwd_success_body);
+ }
+ );
+
}
},
xns : Roo.bootstrap,
{
window.onbeforeunload = false;
- if(typeof(Hydra.authUser) == 'undefined' || !Hydra.authUser || Hydra.authUser.id * 1 < 1){
- return;
- }
Roo.Ajax.request({
url : baseURL + '/Login',
]
}
]
- },
- {
- xtype : 'Form',
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap',
- items : [
- {
- xtype : 'Img',
- cls : 'header-logo',
- imgResponsive : true,
- style : 'height: 50px;',
- listeners : {
- render : function (_self)
- {
- if(appLogo) {
- _self.el.dom.src = appLogo;
- }
- }
- },
- xns : Roo.bootstrap,
- '|xns' : 'Roo.bootstrap'
- }
- ]
}
]
}