admin: add ability to add files from local storage

This commit is contained in:
nemunaire 2016-11-19 15:54:32 +01:00
commit b41180c7b0
4 changed files with 76 additions and 42 deletions

View file

@ -4,6 +4,7 @@ import (
"encoding/hex"
"fmt"
"time"
"path"
)
type myTeamFile struct {
@ -86,7 +87,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
return nil, err
} else {
for _, f := range files {
exercice.Files = append(exercice.Files, myTeamFile{f.Path, f.Name, hex.EncodeToString(f.Checksum), f.Size})
exercice.Files = append(exercice.Files, myTeamFile{path.Join(FilesDir, f.Path), f.Name, hex.EncodeToString(f.Checksum), f.Size})
}
}