settings: add title and authors
This commit is contained in:
parent
963c6ff4f2
commit
6148897dac
@ -25,7 +25,7 @@ func getSettings(_ httprouter.Params, body []byte) (interface{}, error) {
|
||||
if settings.ExistsSettings(path.Join(TeamsDir, settings.SettingsFile)) {
|
||||
return settings.ReadSettings(path.Join(TeamsDir, settings.SettingsFile))
|
||||
} else {
|
||||
return settings.FICSettings{time.Unix(0,0), time.Unix(0,0), time.Unix(0,0), fic.FirstBlood, fic.SubmissionCostBase, false, false, false, true, true}, nil
|
||||
return settings.FICSettings{"Challenge FIC", "Laboratoire SRS, ÉPITA", time.Unix(0,0), time.Unix(0,0), time.Unix(0,0), fic.FirstBlood, fic.SubmissionCostBase, false, false, false, true, true}, nil
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,20 @@
|
||||
|
||||
<input type="hidden" class="form-control" id="lastRegeneration" ng-model="config.generation">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="challengeName" class="col-sm-2 control-label">Nom du challenge</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="challengeName" ng-model="config.title">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="challengeAuthors" class="col-sm-2 control-label">Auteurs du challenge</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" class="form-control" id="challengeAuthors" ng-model="config.authors">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="startTime" class="col-sm-2 control-label">Début du challenge</label>
|
||||
<div class="col-sm-8">
|
||||
|
@ -90,7 +90,7 @@
|
||||
<div class="page-header">
|
||||
<h1 ng-if="(current_theme)" ng-cloak>{{ themes[current_theme].name }} <small class="authors" ng-if="themes[current_theme].authors">{{ themes[current_theme].authors }}</small></h1>
|
||||
<h1 ng-if="(!current_theme && title)" ng-cloak>{{ title }} <small class="authors" ng-if="authors">{{ authors }}</small></h1>
|
||||
<h1 ng-if="(!current_theme && !title)">Challenge forensic 2017 <small class="authors">Laboratoire SRS, Epita</small></h1>
|
||||
<h1 ng-if="(!current_theme && !title)">{{ settings.title }} <small class="authors">{{ settings.authors }}</small></h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -129,6 +129,9 @@ angular.module("FICApp")
|
||||
$http.get("/stats.json").success(function(stats) {
|
||||
$scope.stats = stats;
|
||||
});
|
||||
$http.get("/settings.json").success(function(settings) {
|
||||
$scope.settings = settings;
|
||||
});
|
||||
$http.get("/themes.json").then(function(response) {
|
||||
if ($scope.lastthemeetag == response.headers().etag)
|
||||
return;
|
||||
|
@ -48,7 +48,7 @@
|
||||
|
||||
<div class="panel panel-success" ng-if="s.type == 'welcome' && !s.params.hide && s.params.kind == 'countdown'">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title"><strong>Le challenge forensic 2017 est sur le point de commencer !</strong></h3>
|
||||
<h3 class="panel-title"><strong>Le {{ settings.title }} est sur le point de commencer !</strong></h3>
|
||||
</div>
|
||||
<div class="panel-body text-center" style="font-size: 450%;" ng-if="startIn">{{ startIn }}</div>
|
||||
<div class="panel-body text-center" style="font-size: 450%;" ng-if="!startIn">Go, go, go !</div>
|
||||
|
@ -13,6 +13,9 @@ import (
|
||||
const SettingsFile = "settings.json"
|
||||
|
||||
type FICSettings struct {
|
||||
Title string `json:"title"`
|
||||
Authors string `json:"authors"`
|
||||
|
||||
Start time.Time `json:"start"`
|
||||
End time.Time `json:"end"`
|
||||
Generation time.Time `json:"generation"`
|
||||
|
Loading…
Reference in New Issue
Block a user