Commit b1d3b537 authored by Hervé Ménager's avatar Hervé Ménager

bioweb "sections" are now centrally defined in app.js

parent a403e156
......@@ -57,20 +57,8 @@
<li>
<a ng-href="/home">Home</a>
</li>
<li>
<a ng-href="/topics">Topics</a>
</li>
<li>
<a ng-href="/data">Databanks</a>
</li>
<li>
<a ng-href="/web">Web interfaces</a>
</li>
<li>
<a ng-href="/packages">Tools and packages</a>
</li>
<li>
<a ng-href="/pasteur">Pasteur</a>
<li ng-repeat="section in sections">
<a ng-href="/{{section.name}}">{{section.label}}</a>
</li>
<li>
<a ng-href="/news">News</a>
......
......@@ -23,7 +23,7 @@ angular.module('biowebEvolApp', [
return {
'responseError': function (rejection) {
if(rejection.status===503){
$rootScope.unavailable = "This website is currently unavailable";
$rootScope.unavailable = "This website is currently unavailable";
}
}
}
......@@ -130,7 +130,55 @@ angular.module('biowebEvolApp', [
});
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
}).run(function(Angularytics, $rootScope) {
}).run(function(Angularytics, $rootScope, Catalog, $routeParams) {
Angularytics.init();
$rootScope._ = _;
// $rootScope.sections quick doc:
// item keys are 'name' for the key
// 'label' for the human readable title
// 'subtitle' for the subtitle
// 'loader' for the loading function
// 'icon' for the icon class
$rootScope.sections = [
{'name': 'topics',
'label': 'Topics',
'subtitle': 'Alignment, Structure, etc.',
'loader': function(){
return Catalog.packageTopics($routeParams.search, true);
},
'icon':'fa-question-circle'
},
{'name': 'data',
'label': 'Databanks',
'subtitle': 'Banks and Genomes',
'loader': function(){
return Catalog.banks($routeParams.search, true);
},
'icon':'fa-database'
},
{'name': 'packages',
'label': 'Tools and packages',
'subtitle': 'Available software packages',
'loader': function(){
return Catalog.searchPackages($routeParams.search, $routeParams.topicId, false, true);
},
'icon':'fa-wrench'
},
{'name': 'web',
'label': 'Web interfaces',
'subtitle': 'Mobyle, Galaxy',
'loader': function(){
return Catalog.searchPackages($routeParams.search, $routeParams.topicId, true, true);
},
'icon':'fa-desktop'
},
{'name': 'pasteur',
'label': 'Pasteur software',
'subtitle': 'Software from the Institut Pasteur',
'loader': function(){
return Catalog.searchPackages($routeParams.search, $routeParams.topicId, true, true, 'pasteur');
},
'icon':'fa-compass'
},
];
});
......@@ -6,54 +6,6 @@ angular.module('biowebEvolApp')
$rootScope.title = 'Welcome!';
$scope.routeParams = $routeParams;
$scope.searchSources = [];
// faire une liste nommée sections
// item keys are 'name' for the key
// 'label' for the human readable title
// 'subtitle' for the subtitle
// 'loader' for the loading function
// 'icon' for the icon class
$scope.sections = [
{'name': 'topics',
'label': 'Topics',
'subtitle': 'Alignment, Structure, etc.',
'loader': function(){
return Catalog.packageTopics($routeParams.search, true);
},
'icon':'fa-question-circle'
},
{'name': 'data',
'label': 'Databanks',
'subtitle': 'Banks and Genomes',
'loader': function(){
return Catalog.banks($routeParams.search, true);
},
'icon':'fa-database'
},
{'name': 'packages',
'label': 'Tools and packages',
'subtitle': 'Available software packages',
'loader': function(){
return Catalog.searchPackages($routeParams.search, $routeParams.topicId, false, true);
},
'icon':'fa-wrench'
},
{'name': 'web',
'label': 'Web interfaces',
'subtitle': 'Mobyle, Galaxy',
'loader': function(){
return Catalog.searchPackages($routeParams.search, $routeParams.topicId, true, true);
},
'icon':'fa-desktop'
},
{'name': 'pasteur',
'label': 'Pasteur software',
'subtitle': 'Software from the Institut Pasteur',
'loader': function(){
return Catalog.searchPackages($routeParams.search, $routeParams.topicId, true, true, 'pasteur');
},
'icon':'fa-compass'
},
];
// this loop precomputes the span of the different sections
for (var i = 0; i < $scope.sections.length; i++) {
if($scope.sections.length%2===1 && i>=$scope.sections.length-3){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment