-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ian Bishop
committed
Jan 8, 2015
1 parent
87a5cb3
commit e4a964d
Showing
13 changed files
with
211 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<ul class="breadcrumbs"> | ||
<li ng-repeat="state in $navigationState.currentState.path"> | ||
<span> | ||
<a ui-sref="{{ state.name }}">{{$navigationState.getDisplayName(state, $navigationState.params)}}</a> | ||
</span> | ||
</li> | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
.breadcrumbs { | ||
overflow: hidden; | ||
width: 100%; | ||
margin: 0; | ||
padding: 0; | ||
list-style: none; | ||
} | ||
|
||
.breadcrumbs li{ | ||
float: left; | ||
margin: 0 .5em 0 1em; | ||
} | ||
|
||
.breadcrumbs a{ | ||
background: #ddd; | ||
padding: .7em 1em; | ||
float: left; | ||
text-decoration: none; | ||
color: #444; | ||
text-shadow: 0 1px 0 rgba(255,255,255,.5); | ||
position: relative; | ||
} | ||
|
||
.breadcrumbs a:hover{ | ||
background: #99db76; | ||
} | ||
|
||
.breadcrumbs a::before{ | ||
content: ""; | ||
position: absolute; | ||
top: 50%; | ||
margin-top: -1.5em; | ||
border-width: 1.5em 0 1.5em 1em; | ||
border-style: solid; | ||
border-color: #ddd #ddd #ddd transparent; | ||
left: -1em; | ||
} | ||
|
||
.breadcrumbs a:hover::before{ | ||
border-color: #99db76 #99db76 #99db76 transparent; | ||
} | ||
|
||
.breadcrumbs a::after{ | ||
content: ""; | ||
position: absolute; | ||
top: 50%; | ||
margin-top: -1.5em; | ||
border-top: 1.5em solid transparent; | ||
border-bottom: 1.5em solid transparent; | ||
border-left: 1em solid #ddd; | ||
right: -1em; | ||
} | ||
|
||
.breadcrumbs a:hover::after{ | ||
border-left-color: #99db76; | ||
} | ||
|
||
.breadcrumbs .current, | ||
.breadcrumbs .current:hover{ | ||
font-weight: bold; | ||
background: none; | ||
} | ||
|
||
.breadcrumbs .current::after, | ||
.breadcrumbs .current::before{ | ||
content: normal; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<breadcrumbs></breadcrumbs> | ||
|
||
<div ui-view="main"> | ||
<a ui-sref="p.servers">Servers</a> | ||
</div> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<h1>Servers</h1> | ||
<h2>Servers</h2> | ||
|
||
<table class="table table-striped"> | ||
<tr> | ||
<thead> | ||
<th>Name</th> | ||
<th>Server Type</th> | ||
<th>Version</th> | ||
</thead> | ||
</tr> | ||
<tbody> | ||
<tr ng-repeat="server in servers" ng-click="loadServer(server)" class="clickable"> | ||
<tr ng-repeat="server in servers" ng-click="viewZones(server)" class="clickable"> | ||
<td>{{server.id}}</td> | ||
<td>{{server.daemon_type}}</td> | ||
<td>{{server.version}}</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<div ui-view></div> | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,3 @@ <h2>Zones</h2> | |
</tr> | ||
</tbody> | ||
</table> | ||
|
||
<div ui-view></div> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
var appDirectives = angular.module('appDirectives',[]); | ||
|
||
// Credit to: Mauro Servienti, http://milestone.topics.it/2014/03/angularjs-ui-router-and-breadcrumbs.html | ||
appDirectives.directive('breadcrumbs', function () { | ||
return { | ||
restrict: 'EA', | ||
replace: false, | ||
scope: { | ||
itemDisplayNameResolver: '&' | ||
}, | ||
templateUrl: 'breadcrumbs/breadcrumbs.html', | ||
controller: function ($scope, $state, $stateParams) { | ||
|
||
var defaultResolver = function (state) { | ||
if( angular.isDefined($scope.$navigationState.params[state.data.name]) ) { | ||
return $scope.$navigationState.params[state.data.name]; | ||
} | ||
return state.data.name; | ||
}; | ||
|
||
var isCurrent = function(state){ | ||
return $state.$current.name === state.name; | ||
}; | ||
|
||
var setNavigationState = function () { | ||
$scope.$navigationState = { | ||
currentState: $state.$current, | ||
params: $stateParams, | ||
getDisplayName: function (state, stateParams) { | ||
if ($scope.hasCustomResolver) { | ||
return $scope.itemDisplayNameResolver({ | ||
defaultResolver: defaultResolver, | ||
state: state, | ||
stateParams: stateParams, | ||
isCurrent: isCurrent(state) | ||
}); | ||
} | ||
else { | ||
return defaultResolver(state); | ||
} | ||
}, | ||
isCurrent: function (state) { | ||
return isCurrent(state); | ||
} | ||
}; | ||
}; | ||
|
||
$scope.$on('$stateChangeSuccess', function () { | ||
setNavigationState(); | ||
}); | ||
|
||
setNavigationState(); | ||
}, | ||
link: function (scope, element, attrs, controller) { | ||
scope.hasCustomResolver = angular.isDefined(attrs.itemDisplayNameResolver); | ||
} | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters