Merge "Group resource icons by project"
This commit is contained in:
commit
25d10dd303
@ -77,16 +77,27 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row table_action">
|
||||
<div class="row">
|
||||
|
||||
<span flex></span>
|
||||
|
||||
<!-- Icon Drag sidebar -->
|
||||
<div class="col-sm-11" style="text-align:center" ng-controller="horizon.dashboard.project.heat_dashboard.template_generator.IconController">
|
||||
<div draggable ng-repeat="(reskey, resobj) in resource_types" class="os-resource" draggable="true" id="{$ reskey $}" ng-if="admin || !resource_admin[reskey]">
|
||||
<md-tooltip md-direction="top" style="font-size:12px !important;">{$ resobj.name $}</md-tooltip>
|
||||
<md-icon style="height: 36px; width: 36px;" md-svg-src="{$ basePath $}js/resources/{$ reskey|lowercase $}/{$ reskey|lowercase $}.svg"></md-icon>
|
||||
</div>
|
||||
<div class="col-sm-10" ng-controller="horizon.dashboard.project.heat_dashboard.template_generator.IconController" >
|
||||
<md-nav-bar md-selected-nav-item="currentNavItem" nav-bar-aria-label="Icon Group Nav">
|
||||
<md-nav-item md-nav-click="showIcon()" ng-repeat="(level, level_item) in project_types" name="{$ level $}">
|
||||
{$ level $}
|
||||
</md-nav-item>
|
||||
</md-nav-bar>
|
||||
<div class="navbar-content">
|
||||
<div ng-repeat="(level, level_item) in project_types" >
|
||||
<div ng-show="level == currentNavItem">
|
||||
<div draggable ng-repeat="(reskey, resobj) in level_item" class="os-resource" draggable="true" id="{$ reskey $}" ng-if="admin || !resource_admin[reskey]">
|
||||
<md-tooltip md-direction="top" style="font-size:12px !important;">{$ resobj.name $}</md-tooltip>
|
||||
<md-icon style="height: 36px; width: 36px;" md-svg-src="{$ basePath $}js/resources/{$ reskey|lowercase $}/{$ reskey|lowercase $}.svg"></md-icon>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Drag sidebar -->
|
||||
</div>
|
||||
|
@ -169,3 +169,14 @@ md-icon.spinner{
|
||||
overflow: auto;
|
||||
max-height: 500px;
|
||||
}
|
||||
.md-nav-bar {
|
||||
border-style: none;
|
||||
border-width: 0 0;
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
.navbar-content{
|
||||
margin-top: 3%;
|
||||
text-align: center;
|
||||
}
|
||||
|
@ -9,8 +9,25 @@
|
||||
$scope.resource_admin = hotgenGlobals.get_node_admin();
|
||||
$scope.admin = hotgenGlobals.get_resource_options().auth.admin;
|
||||
$scope.basePath = basePath;
|
||||
}]);
|
||||
|
||||
$scope.project_types = {};
|
||||
for (var idx in $scope.resource_types){
|
||||
var pidx = idx.split('__');
|
||||
if (!pidx || pidx.length != 3){
|
||||
continue
|
||||
}
|
||||
var level = pidx[0]+'::'+pidx[1]
|
||||
if (! (level in $scope.project_types)){
|
||||
$scope.project_types[level] = {}
|
||||
}
|
||||
$scope.project_types[level][idx] = $scope.resource_types[idx];
|
||||
}
|
||||
$scope.currentNavItem = Object.keys($scope.project_types)[0];
|
||||
$scope.showIcon = function(){
|
||||
// console.log($scope.currentNavItem)
|
||||
};
|
||||
|
||||
}]);
|
||||
})();
|
||||
|
||||
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
beforeEach(inject(function($injector){
|
||||
hotgenGlobals = $injector.get('hotgenGlobals');
|
||||
hotgenGlobals.update_resource_icons('OS__Project__Resource', '');
|
||||
hotgenGlobals.update_resource_icons('OS__Key', '');
|
||||
}));
|
||||
|
||||
beforeEach(inject(function(_$controller_, $rootScope) {
|
||||
@ -33,6 +35,7 @@
|
||||
expect($scope.basePath).toBe($window.STATIC_URL + 'dashboard/project/heat_dashboard/template_generator/');
|
||||
|
||||
}]));
|
||||
|
||||
});
|
||||
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user