public: can control up to 9 separate displays
This commit is contained in:
parent
eb858ba90a
commit
c574b85fd5
7 changed files with 31 additions and 19 deletions
|
|
@ -31,7 +31,7 @@
|
|||
<li class="nav-item"><a class="nav-link" href="/teams">Équipes</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/themes">Thèmes</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/exercices">Exercices</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/public">Public</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/public/0">Public</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/events">Événements</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="/settings">Paramètres</a></li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"])
|
|||
controller: "TeamController",
|
||||
templateUrl: "views/team-stats.html"
|
||||
})
|
||||
.when("/public", {
|
||||
.when("/public/:screenId", {
|
||||
controller: "PublicController",
|
||||
templateUrl: "views/public.html"
|
||||
})
|
||||
|
|
@ -77,7 +77,7 @@ angular.module("FICApp")
|
|||
})
|
||||
})
|
||||
.factory("Scene", function($resource) {
|
||||
return $resource("/api/public.json", null, {
|
||||
return $resource("/api/public/:screenId", { screenId: '@id' }, {
|
||||
'update': {method: 'PUT', isArray: true},
|
||||
})
|
||||
})
|
||||
|
|
@ -377,11 +377,20 @@ angular.module("FICApp")
|
|||
};
|
||||
})
|
||||
|
||||
.controller("PublicController", function($scope, $rootScope, Scene, Theme, Teams, Exercice) {
|
||||
$scope.scenes = Scene.query();
|
||||
.controller("PublicController", function($scope, $rootScope, $routeParams, $location, Scene, Theme, Teams, Exercice) {
|
||||
$scope.screens = [0,1,2,3,4,5,6,7,8,9];
|
||||
$scope.screenid = $routeParams.screenId;
|
||||
$scope.scenes = Scene.query({ screenId: $routeParams.screenId });
|
||||
$scope.themes = Theme.query();
|
||||
$scope.teams = Teams.get();
|
||||
|
||||
$scope.chScreen = function(sid) {
|
||||
if ($scope.screenid)
|
||||
$location.url("/public/" + $scope.screenid);
|
||||
else
|
||||
$location.url("/public/");
|
||||
}
|
||||
|
||||
$scope.types = {
|
||||
"welcome": "Messages de bienvenue",
|
||||
"countdown": "Compte à rebours",
|
||||
|
|
@ -462,9 +471,10 @@ angular.module("FICApp")
|
|||
];
|
||||
}
|
||||
};
|
||||
|
||||
$scope.saveScenes = function() {
|
||||
$scope.someUpdt = false;
|
||||
var prms = Scene.update($scope.scenes);
|
||||
var prms = Scene.update({ screenId: $scope.screenid }, $scope.scenes);
|
||||
prms.$promise.then(function() {
|
||||
$rootScope.newBox('success', 'Scene successfully published!');
|
||||
}, function(response) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<form ng-submit="saveScenes()" class="form-horizontal">
|
||||
<h2>
|
||||
Interface publique
|
||||
<select class="custom-select" id="screenid" ng-model="screenid" ng-options="k as 'Écran ' + v for (k, v) in screens" ng-change="chScreen()"></select>
|
||||
<div class="float-right dropdown">
|
||||
<button class="btn btn-secondary dropdown-toggle mr-sm-2" type="button" data-toggle="dropdown">
|
||||
Charger scène
|
||||
|
|
|
|||
Reference in a new issue