admin: add a page to view resolution video
This commit is contained in:
parent
4ee70a8781
commit
2ac205bf83
@ -6,6 +6,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"srs.epita.fr/fic-server/admin/api"
|
"srs.epita.fr/fic-server/admin/api"
|
||||||
|
"srs.epita.fr/fic-server/admin/sync"
|
||||||
"srs.epita.fr/fic-server/libfic"
|
"srs.epita.fr/fic-server/libfic"
|
||||||
|
|
||||||
"github.com/julienschmidt/httprouter"
|
"github.com/julienschmidt/httprouter"
|
||||||
@ -62,6 +63,13 @@ func init() {
|
|||||||
api.Router().GET("/files/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
api.Router().GET("/files/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
http.ServeFile(w, r, path.Join(fic.FilesDir, strings.TrimPrefix(r.URL.Path, "/files")))
|
http.ServeFile(w, r, path.Join(fic.FilesDir, strings.TrimPrefix(r.URL.Path, "/files")))
|
||||||
})
|
})
|
||||||
|
api.Router().GET("/vids/*_", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
|
if importer, ok := sync.GlobalImporter.(sync.LocalImporter); ok {
|
||||||
|
http.ServeFile(w, r, path.Join(importer.Base, strings.TrimPrefix(r.URL.Path, "/vids")))
|
||||||
|
} else {
|
||||||
|
http.Error(w, "Only available with local importer.", 400)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
api.Router().GET("/check_import.html", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
api.Router().GET("/check_import.html", func(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
|
||||||
http.ServeFile(w, r, path.Join(StaticDir, "check_import.html"))
|
http.ServeFile(w, r, path.Join(StaticDir, "check_import.html"))
|
||||||
|
@ -29,6 +29,10 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"])
|
|||||||
controller: "ExerciceController",
|
controller: "ExerciceController",
|
||||||
templateUrl: "views/exercice.html"
|
templateUrl: "views/exercice.html"
|
||||||
})
|
})
|
||||||
|
.when("/exercices/:exerciceId/resolution", {
|
||||||
|
controller: "ExerciceController",
|
||||||
|
templateUrl: "views/exercice-resolution.html"
|
||||||
|
})
|
||||||
.when("/teams", {
|
.when("/teams", {
|
||||||
controller: "TeamsListController",
|
controller: "TeamsListController",
|
||||||
templateUrl: "views/team-list.html"
|
templateUrl: "views/team-list.html"
|
||||||
|
11
admin/static/views/exercice-resolution.html
Normal file
11
admin/static/views/exercice-resolution.html
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<h2>
|
||||||
|
<a href="exercices/{{exercice.id}}">{{exercice.title}}</a> <small class="text-muted">Vidéo de résolution</small>
|
||||||
|
<div class="btn-group" role="group" ng-if="themes[exercice.id_theme].exercices[exercice.id]">
|
||||||
|
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].previous }}/resolution" title="Exercice précédent" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].previous}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span></a>
|
||||||
|
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].next }}/resolution" title="Exercice suivant" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].next}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
|
||||||
|
</div>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
<div class="text-center">
|
||||||
|
<video src="vids/{{exercice.videoURI}}" controls style="height: 80vh; margin: auto;"></video>
|
||||||
|
</div>
|
@ -5,6 +5,7 @@
|
|||||||
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].previous }}" title="Exercice précédent" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].previous}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span></a>
|
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].previous }}" title="Exercice précédent" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].previous}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span></a>
|
||||||
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].next }}" title="Exercice suivant" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].next}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
|
<a href="exercices/{{ themes[exercice.id_theme].exercices[exercice.id].next }}" title="Exercice suivant" ng-class="{'disabled': !themes[exercice.id_theme].exercices[exercice.id].next}" class="btn btn-sm btn-light"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a>
|
||||||
</div>
|
</div>
|
||||||
|
<a href="exercices/{{exercice.id}}/resolution" ng-disabled="!exercice.videoURI" class="float-right btn btn-sm btn-info"><span class="glyphicon glyphicon-facetime-video" aria-hidden="true"></span> Vidéo</a>
|
||||||
<button type="button" ng-click="syncExo()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
|
<button type="button" ng-click="syncExo()" ng-class="{'disabled': inSync}" class="float-right btn btn-sm btn-light"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> Synchroniser</button>
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user