Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
Licenser committed Jan 9, 2013
2 parents b30f5bf + ec67427 commit ec2a19f
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 89 deletions.
27 changes: 14 additions & 13 deletions app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,18 +93,19 @@


<div class='container-fluid' id='ui' ng-show="loggedUser && loggedUser.username">
<div class="tabs-left">
<nav-tabs>
<nav-tab href="#/status" icon="camera">Status</nav-tab>
<nav-tab href="#/dashboard" icon="dashboard">Dashboard</nav-tab>
<nav-tab href="#/virtual-machines" icon="display">Virtual Machines</nav-tab>
<nav-tab href="#/hypervisors" icon="cloud">Hypervisors</nav-tab>
<nav-tab href="#/networks" icon="share_alt">Networks</nav-tab>
<nav-tab href="#/datasets" icon="hdd">Datasets</nav-tab>
<nav-tab href="#/packages" icon="cargo">Packages</nav-tab>
<nav-tab href="#/groups" icon="group">Groups</nav-tab>
<nav-tab href="#/users" icon="user">Users</nav-tab>
</nav-tabs>
<div class="tabs-left">
<nav-tabs>
<nav-tab href="#/status" icon="camera">Status</nav-tab>
<nav-tab href="#/dashboard" icon="dashboard">Dashboard</nav-tab>
<nav-tab href="#/virtual-machines" icon="display">Virtual Machines</nav-tab>
<nav-tab href="#/hypervisors" icon="cloud">Hypervisors</nav-tab>
<nav-tab href="#/networks" icon="share_alt">Networks</nav-tab>
<nav-tab href="#/datasets" icon="hdd">Datasets</nav-tab>
<nav-tab href="#/packages" icon="cargo">Packages</nav-tab>
<nav-tab href="#/groups" icon="group">Groups</nav-tab>
<nav-tab href="#/users" icon="user">Users</nav-tab>
</nav-tabs>

<div class='tab-content main-tab-content' style="margin-left:170px">
<div class='tab-pane active' ng-view></div>
</div>
Expand Down Expand Up @@ -144,11 +145,11 @@
<script src="scripts/services/wiggle.js"></script>
<script src="scripts/services/howl.js"></script>
<script src="scripts/services/status.js"></script>
<script src="scripts/services/jq-run.js"></script>
<script src="scripts/services/modal.js"></script>
<script src="scripts/services/user.js"></script>
<script src="scripts/services/vm.js"></script>
<script src="scripts/filters/filters.js"></script>
<script src="scripts/directives/directives.js"></script>
<!-- endbuild -->

</body>
Expand Down
49 changes: 0 additions & 49 deletions app/scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,52 +71,3 @@ var fifoApp = angular.module('fifoApp', ['ngResource', 'ngCookies'])
user.login($cookies.token, $cookies.login)

})

/**
* bootstrap directives from datasets.at
*/
fifoApp
.directive('navTabs', function() {
return {
restrict: 'E',
transclude: true,
template:
'<ul class="nav nav-tabs" data-spy="affix" ng-transclude>' +
'</ul>',
replace: true
};
})
.directive('navTab', ['$location', function($location) {
var match = function(href, url) {
var href_a = href.split('/');
var url_a = url.split('/');
var i;

for (i in href_a) {
if (href_a[i] !== url_a[i]) {
return false;
}
}

return true;
}

return {
restrict: 'E',
transclude: true,
scope: {
'href': '@',
'icon': '@'
},
link: function (scope) {
scope.location = function (href) {
return match(href.substr(1), $location.url());
};
},
template:
'<li ng-class="{active: location(href)}">' +
'<a href="{{href}}" class="glyphicons {{icon}}" ng-transclude><i></i></a>' +
'</li>',
replace: true
};
}]);
76 changes: 76 additions & 0 deletions app/scripts/directives/directives.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
fifoApp.directive('jqRun', function () {
return {
restrict: 'A',
compile: function () {
return function (scope, elm, attrs) {

//FIXME: when clicking on the a, the tooltip keep showing
if (attrs.jqRun == 'tooltip') {
//attrs.placement = 'right'
if (elm.children().length>0) {
var child = elm.children()[0]
$(child).on('click',function() {
$(elm).tooltip('hide')
})
}

}

//FIXME: if not inside a timeout, the tooltip gets processed before the templace, so title='{{data}}' will show as {{data}}.. :P
setTimeout(function() {
$(elm)[attrs.jqRun](attrs)
}, 100);

};
}
};
});

/**
* bootstrap directives from datasets.at
*/
fifoApp
.directive('navTabs', function() {
return {
restrict: 'E',
transclude: true,
template:
'<ul class="nav nav-tabs" data-spy="affix" ng-transclude>' +
'</ul>',
replace: true
};
})
.directive('navTab', ['$location', function($location) {
var match = function(href, url) {
var href_a = href.split('/');
var url_a = url.split('/');
var i;

for (i in href_a) {
if (href_a[i] !== url_a[i]) {
return false;
}
}

return true;
}

return {
restrict: 'E',
transclude: true,
scope: {
'href': '@',
'icon': '@'
},
link: function (scope) {
scope.location = function (href) {
return match(href.substr(1), $location.url());
};
},
template:
'<li ng-class="{active: location(href)}">' +
'<a href="{{href}}" class="glyphicons {{icon}}" ng-transclude><i></i></a>' +
'</li>',
replace: true
};
}]);
27 changes: 0 additions & 27 deletions app/scripts/services/jq-run.js

This file was deleted.

0 comments on commit ec2a19f

Please sign in to comment.