Skip to content
This repository has been archived by the owner on Jan 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from chrinor2002/feature/team-search
Browse files Browse the repository at this point in the history
adding team searching
  • Loading branch information
chrinor2002 authored Nov 17, 2017
2 parents 2c26d19 + e653efa commit f11cbe7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,22 @@ server.register([
}
});

server.route({
method: 'GET',
path: '/team/{team}',
handler: {
file: 'public/index.html'
}
});

server.route({
method: 'GET',
path: '/team/{team}/search/{pattern*}',
handler: {
file: 'public/index.html'
}
});

server.route({
method: 'GET',
path: '/e',
Expand Down
18 changes: 16 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,17 @@
$scope.concourseInfo = jsinfo;
}

var pathSearch = $window.location.pathname.split('/').slice(1);
pathSearch = pathSearch[0] === 'search' ? pathSearch.slice(1).join('/') : false;
var windowPath = $window.location.pathname.split('/').slice(1);
var pathTeam;
if (windowPath[0] === 'team') {
windowPath.shift(); // team
pathTeam = windowPath.shift();
}
var pathSearch;
if (windowPath[0] === 'search') {
windowPath.shift(); // search
pathSearch = windowPath.shift();
}
$scope.getPipes = function() {
$http({
method: 'GET',
Expand All @@ -540,6 +549,11 @@
return item.name.includes(pathSearch);
});
}
if (pathTeam) {
response.data = response.data.filter(function(item) {
return item.team_name.includes(pathTeam);
});
}
$scope.setPipes(response.data);
}, function(err) {
console.error(err);
Expand Down

0 comments on commit f11cbe7

Please sign in to comment.