add custom logo

This commit is contained in:
Davide Alberani 2015-05-10 10:30:37 +02:00
parent ec04251960
commit 708ea866d0
3 changed files with 29 additions and 11 deletions

View file

@ -43,13 +43,16 @@
-->
<body>
<nav class="navbar navbar-default navbar-fixed-top" ng-controller="NavigationCtrl as n">
<nav class="navbar navbar-default navbar-fixed-top" ng-controller="NavigationCtrl">
<div class="container">
<div class="collapse navbar-collapse">
<div class="navbar-header">
<div ng-if="logo.imgURL" class="navbar-brand"><img src="{{logo.imgURL}}" /></div>
<ul class="nav navbar-nav">
<li ng-class="{active: n.isActive('/events') || n.isActive('/event')}"><a ui-sref="events">{{'Events' | translate}}</a></li>
<li ng-class="{active: n.isActive('/persons') || n.isActive('/person') || n.isActive('/import/persons')}"><a ui-sref="persons">{{'Persons' | translate}}</a></li>
<li ng-class="{active: isActive('/events') || isActive('/event')}"><a ui-sref="events">{{'Events' | translate}}</a></li>
<li ng-class="{active: isActive('/persons') || isActive('/person') || isActive('/import/persons')}"><a ui-sref="persons">{{'Persons' | translate}}</a></li>
</ul>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<button class="btn btn-link">

View file

@ -7,13 +7,21 @@ var eventManControllers = angular.module('eventManControllers', []);
/* A controller that can be used to navigate. */
eventManControllers.controller('NavigationCtrl', ['$location',
function ($location) {
this.go = function(url) {
eventManControllers.controller('NavigationCtrl', ['$scope', '$location', 'Setting',
function ($scope, $location, Setting) {
$scope.logo = {};
$scope.go = function(url) {
$location.url(url);
};
this.isActive = function (view) {
Setting.query({setting: 'logo'}, function(data) {
if (data && data.length) {
$scope.logo = data[0];
}
});
$scope.isActive = function(view) {
if (view === $location.path()) {
return true;
}

View file

@ -2,6 +2,13 @@
/* nav-bar padding */
body { padding-top: 70px; }
/* logo padding */
.navbar-brand {
padding-top: 0px;
padding-right: 0px;
padding-bottom: 0px;
}
/* fix styling for empty href */
.nav, .pagination, .carousel, .panel-title a { cursor: pointer; }
@ -50,8 +57,8 @@ body { padding-top: 70px; }
/* a small table with a fixed height */
.small-table {
height:200px;
overflow-x:hidden;
overflow-y:scroll;
height: 200px !important;
overflow-x: hidden !important;
overflow-y: scroll !important;
}