portainer/app/directives/header-title.js

19 lines
976 B
JavaScript
Raw Normal View History

angular
.module('portainer')
.directive('rdHeaderTitle', ['Authentication', 'StateManager', function rdHeaderTitle(Authentication, StateManager) {
var directive = {
requires: '^rdHeader',
scope: {
2016-06-08 07:15:47 +00:00
title: '@'
},
link: function (scope, iElement, iAttrs) {
scope.username = Authentication.getUserDetails().username;
scope.displayDonationHeader = StateManager.getState().application.displayDonationHeader;
},
transclude: true,
template: '<div class="page white-space-normal">{{title}}<span class="header_title_content" ng-transclude></span><span class="pull-right user-box" ng-if="username"><i class="fa fa-user-circle-o" aria-hidden="true"></i> {{username}}</span><a ng-if="displayDonationHeader" ui-sref="settings_about" class="pull-right" style="font-size:14px;margin-right:15px;margin-top:2px;"><span class="fa fa-heart fa-fw red-icon"></span> Help support portainer</a></div>',
restrict: 'E'
};
return directive;
}]);