diff --git a/admin/static.go b/admin/static.go index ab65e2b1..160ff758 100644 --- a/admin/static.go +++ b/admin/static.go @@ -6,6 +6,7 @@ import ( "strings" "srs.epita.fr/fic-server/admin/api" + "srs.epita.fr/fic-server/admin/sync" "srs.epita.fr/fic-server/libfic" "github.com/julienschmidt/httprouter" @@ -62,6 +63,13 @@ func init() { 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"))) }) + 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) { http.ServeFile(w, r, path.Join(StaticDir, "check_import.html")) diff --git a/admin/static/js/app.js b/admin/static/js/app.js index 90b3b5c7..d2a7516d 100644 --- a/admin/static/js/app.js +++ b/admin/static/js/app.js @@ -29,6 +29,10 @@ angular.module("FICApp", ["ngRoute", "ngResource", "ngSanitize"]) controller: "ExerciceController", templateUrl: "views/exercice.html" }) + .when("/exercices/:exerciceId/resolution", { + controller: "ExerciceController", + templateUrl: "views/exercice-resolution.html" + }) .when("/teams", { controller: "TeamsListController", templateUrl: "views/team-list.html" diff --git a/admin/static/views/exercice-resolution.html b/admin/static/views/exercice-resolution.html new file mode 100644 index 00000000..2a58267c --- /dev/null +++ b/admin/static/views/exercice-resolution.html @@ -0,0 +1,11 @@ +

+ {{exercice.title}} Vidéo de résolution +
+ + +
+

+ +
+ +
diff --git a/admin/static/views/exercice.html b/admin/static/views/exercice.html index 69b6841c..e9438d29 100644 --- a/admin/static/views/exercice.html +++ b/admin/static/views/exercice.html @@ -5,6 +5,7 @@ + Vidéo