settings: add title and authors

This commit is contained in:
nemunaire 2017-04-02 11:40:23 +02:00 committed by Pierre-Olivier Mercier
parent 963c6ff4f2
commit 6148897dac
6 changed files with 23 additions and 3 deletions

View File

@ -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
}
}

View File

@ -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">

View File

@ -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>

View File

@ -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;

View File

@ -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&nbsp;!</strong></h3>
<h3 class="panel-title"><strong>Le {{ settings.title }} est sur le point de commencer&nbsp;!</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&nbsp;!</div>

View File

@ -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"`