Moves static into webapp
This commit is contained in:
0
webapp/css/.gitkeep
Normal file
0
webapp/css/.gitkeep
Normal file
67
webapp/css/satbd.sateliite.bar.css
Normal file
67
webapp/css/satbd.sateliite.bar.css
Normal file
@@ -0,0 +1,67 @@
|
||||
html {
|
||||
position: relative;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
body > .container {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
body > .container-fluid {
|
||||
padding-top: 60px;
|
||||
}
|
||||
|
||||
/* collapses the navbar one media earlier ( french has long title name ) */
|
||||
@media (min-width: 768px) and (max-width: 991px) {
|
||||
.navbar-collapse.collapse {
|
||||
display: none !important;
|
||||
}
|
||||
.navbar-collapse.collapse.in {
|
||||
display: block !important;
|
||||
}
|
||||
.navbar-header .collapse, .navbar-toggle {
|
||||
display:block !important;
|
||||
}
|
||||
.navbar-header {
|
||||
float:none;
|
||||
}
|
||||
}
|
||||
|
||||
.album {
|
||||
padding-top:15px;
|
||||
padding-bottom:15px;
|
||||
overflow:hidden;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
.album {
|
||||
height: 70vw;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) and (max-width: 991px) {
|
||||
.album {
|
||||
height: 46vw;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) and (max-width: 1199px) {
|
||||
.album {
|
||||
height: 35vw;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.album {
|
||||
height: 23vw;
|
||||
}
|
||||
}
|
||||
|
||||
img.cover {
|
||||
width:100%;
|
||||
}
|
||||
|
||||
|
||||
|
||||
0
webapp/html/.gitkeep
Normal file
0
webapp/html/.gitkeep
Normal file
96
webapp/index.html
Normal file
96
webapp/index.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link href="/bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet" />
|
||||
<link rel="icon" href="https://satellite.bar/images/sat.ico" />
|
||||
<link href="/css/satbd.sateliite.bar.css" rel="stylesheet" />
|
||||
<title>satbd: explorez la betheque de sat</title>
|
||||
</head>
|
||||
<body ng-app="satbd.satellite.bar" ng-controller="GlobalCtrl" >
|
||||
<nav class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container" ng-controller="NavbarCollapseCtrl">
|
||||
<script type="text/ng-template" id="help.html">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">Aide</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<p> Bientôt disponible </p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-primary" type="button" ng-click="ok()">OK</button>
|
||||
</div>
|
||||
</script>
|
||||
<div class="navbar-header">
|
||||
<button type="button" class="navbar-toggle" ng-click="isCollapsed = !isCollapsed" aria-expanded="false" aria-controls="navbar">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="/"><img alt="brand" src="//satellite.bar/images/satellitenuit.png"/></a>
|
||||
</div>
|
||||
<div id="navbar" class="navbar-collapse" uib-collapse="isCollapsed">
|
||||
<ul class="nav navbar-nav">
|
||||
<li ng-class="{active: isActive('recents')}"><a ng-click="recents()" >Récents</a></li>
|
||||
<li ng-class="{active: isActive('collections')}"><a ng-click="collections()">Par Collection</a></li>
|
||||
<li ng-class="{active: isActive('authors')}"><a ng-click="authors()">Par Auteurs</a></li>
|
||||
</ul>
|
||||
<form class="navbar-form navbar-right" role="search" ng-submit="search()">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" ng-model="searchQuery" placeholder="Chercher ...">
|
||||
<div class="input-group-btn">
|
||||
<button class="btn btn-default" type="submit">Go!</button>
|
||||
<button type="button" class="btn btn-default" ng-click="openModal('lg')">
|
||||
<span class="glyphicon glyphicon-question-sign" aria-label="help"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div><!--/.nav-collapse -->
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Begin page content -->
|
||||
<div class="container-fluid" >
|
||||
|
||||
<!-- search results -->
|
||||
<div class="search row" ng-controller="SearchCtrl" ng-show="showResults" ng-cloak>
|
||||
<h3> {{searchResults.total_hits}} résultats en {{searchResults.took/1000000000}} secondes </h3>
|
||||
<div class="col-xs-12" ng-repeat="hit in searchResults.hits">
|
||||
<h3> {{hit.fields["série"]}} - {{hit.fields.titre}} </h3>
|
||||
<ul>
|
||||
<li><label>Référence:</label>{{hit.fields.ref}}</li>
|
||||
<li><label>Description:</label>{{hit.fields.description}}</li>
|
||||
<li><label>Collection:</label> {{hit.fields.collection}}</li>
|
||||
<li><label>Note:</label> {{hit.fields.Note}} / 5.0 </li>
|
||||
</ul>
|
||||
<ul>
|
||||
<li ng-repeat="(name,fragments) in hit.fragments" ><label>{{name}}</label>
|
||||
<ul>
|
||||
<li ng-repeat="f in fragments" ng-bind-html="f"></li>
|
||||
</ul>
|
||||
</li>
|
||||
</div>
|
||||
<!-- <p> <label>JSON:</label> {{searchResultsJSON}} </p>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Recent Albums -->
|
||||
<div class="recent row" ng-controller="RecentCtrl" ng-cloak>
|
||||
<div class="album col-xs-6 col-sm-4 col-md-3 col-lg-2" ng-repeat="id in albumIDs" ng-controller="RecentAlbumCtrl" ng-init="init_by_id(id)">
|
||||
<img class="cover img-responsive img-rounded center-block" ng-src="{{album.CoverURL}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="/bower_components/angular/angular.min.js"></script>
|
||||
<script src="/bower_components/angular-animate/angular-animate.min.js"></script>
|
||||
<script src="/bower_components/angular-sanitize/angular-sanitize.min.js"></script>
|
||||
<script src="/bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js"></script>
|
||||
<script src="/js/satbd.satellite.bar.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
0
webapp/js/.gitkeep
Normal file
0
webapp/js/.gitkeep
Normal file
121
webapp/js/satbd.satellite.bar.js
Normal file
121
webapp/js/satbd.satellite.bar.js
Normal file
@@ -0,0 +1,121 @@
|
||||
angular.module('satbd.satellite.bar', ['ui.bootstrap','ngAnimate','ngSanitize']);
|
||||
|
||||
angular.module('satbd.satellite.bar').controller('GlobalCtrl', function($scope,$log) {
|
||||
$scope.location = '';
|
||||
$scope.isActive = function(location) {
|
||||
return $scope.location === location
|
||||
};
|
||||
|
||||
$scope.recents = function() {
|
||||
$scope.location='recents';
|
||||
$scope.$broadcast('displayRecents')
|
||||
};
|
||||
|
||||
$scope.collections = function() {
|
||||
$scope.location='collections';
|
||||
$scope.$broadcast('displayCollections')
|
||||
};
|
||||
|
||||
$scope.authors = function() {
|
||||
$scope.location='authors';
|
||||
$scope.$broadcast('displayAuthors')
|
||||
};
|
||||
|
||||
$scope.$on('onSearchQuery', function(event,query) {
|
||||
if (query.length > 0) {
|
||||
$scope.location='search';
|
||||
$scope.$broadcast('displaySearch', query)
|
||||
}
|
||||
});
|
||||
|
||||
$scope.$on('recentsReady', function(event) {
|
||||
$scope.recents();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
angular.module('satbd.satellite.bar').controller('NavbarCollapseCtrl', function ($scope, $uibModal) {
|
||||
$scope.isCollapsed = true;
|
||||
$scope.openModal = function (size) {
|
||||
var modalInstance = $uibModal.open({
|
||||
templateUrl: 'help.html',
|
||||
controller: 'HelpInstanceCtrl',
|
||||
size: size,
|
||||
keyboard: true,
|
||||
});
|
||||
};
|
||||
|
||||
$scope.searchQuery = '';
|
||||
$scope.search = function() {
|
||||
$scope.$emit('onSearchQuery',$scope.searchQuery);
|
||||
};
|
||||
|
||||
});
|
||||
|
||||
angular.module('satbd.satellite.bar').controller('HelpInstanceCtrl', function($scope, $uibModalInstance) {
|
||||
$scope.ok = function () {
|
||||
$uibModalInstance.close('');
|
||||
};
|
||||
});
|
||||
|
||||
angular.module('satbd.satellite.bar').controller('RecentCtrl', function($scope, $http,$log) {
|
||||
$scope.albumIDs = [ ];
|
||||
$scope.clear = function(event) { $scope.albumIDs = [] };
|
||||
$scope.$on('displayAuthors', $scope.clear);
|
||||
$scope.$on('displayCollections', $scope.clear);
|
||||
$scope.$on('displaySearch', $scope.clear);
|
||||
$scope.$on('displayRecents', function(event) {
|
||||
$scope.clear();
|
||||
$log.info('fetching recent albums');
|
||||
$http.get('/api/recents').success(function(data){
|
||||
for (var i = 0; i < 10; i++) {
|
||||
$scope.albumIDs.push(data[i]);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$scope.$emit('recentsReady')
|
||||
});
|
||||
|
||||
|
||||
angular.module('satbd.satellite.bar').controller('RecentAlbumCtrl', function($scope, $http) {
|
||||
$scope.init_by_id = function(id) {
|
||||
$http.get('api/albums/'+ id).success(function (data) {
|
||||
$scope.album = data;
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
angular.module('satbd.satellite.bar').controller('SearchCtrl', function($scope, $http, $log) {
|
||||
$scope.showResults = false
|
||||
$scope.searchResults = null;
|
||||
$scope.searchResultsJSON = '';
|
||||
|
||||
$scope.clear = function () {
|
||||
$scope.showResults = false;
|
||||
$scope.searchResults = null;
|
||||
$scope.searchResultsJSON = '';
|
||||
};
|
||||
$scope.$on('displayAuthors', $scope.clear);
|
||||
$scope.$on('displayCollections', $scope.clear);
|
||||
$scope.$on('displayRecents', $scope.clear);
|
||||
$scope.$on('displaySearch', function(event, query) {
|
||||
$log.info("Submitting query " + query);
|
||||
$http.post('/api/search', {
|
||||
"size": 20,
|
||||
"explain": false,
|
||||
"highlight":{},
|
||||
"fields": ["série", "collection","titre","éditeur","ref","description","Note"],
|
||||
"query": {
|
||||
"query": query,
|
||||
}
|
||||
}).success(function(data) {
|
||||
$scope.searchResults = data;
|
||||
$scope.showResults = true;
|
||||
}).error(function(data, code) {
|
||||
$log.error("got " + code + " data: " + data);
|
||||
$scope.showResults = true;
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user