first commit

This commit is contained in:
2022-02-18 18:17:03 +01:00
commit a54d4be5b4
32 changed files with 998 additions and 0 deletions

View File

@ -0,0 +1,3 @@
{
"id": 1
}

View File

@ -0,0 +1,22 @@
{
"id": {{ .Params.id }},
"sort": {{ .Params.sort }},
"title": "{{ .Title }}",
"questions": [{{ range $index, $question := .Params.questions }}
{{ if $index }}, {{ end }}
{
"id": {{ $question.id }},
"sort": {{ $index }},
"title": "{{ $question.title }}",
"answers": [{{ range $i, $answer := $question.answers }}
{
"id": {{ $answer.id }},
"sort": {{ $i }},
"title": "{{ $answer.title }}",
"weight": "{{ $answer.weight }}",
}
{{ end }}]
}
{{ end }}]
"permalink" : "{{ .Permalink }}"
}

34
layouts/index.html Normal file
View File

@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Hello World</title>
<link rel="apple-touch-icon" href="images/pwa-icon-256.png" />
{{ $style := resources.Get "styles/main.sass" }}
{{ with $style }}
{{ $styleCSS := . | toCSS }}
<link rel="stylesheet" href="{{ $styleCSS.Permalink }}">
{{ end }}
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="white" />
</head>
<body>
<h1>Ceiba App</h1>
{{ partial "scores" . }}
{{ $js := resources.Get "js/sw.js" }}
{{ with $js }}
{{ $secureJS := . | js.Build }}
<!--script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script-->
{{ end }}
{{ $js := resources.Get "js/main.js" }}
{{ with $js }}
{{ $secureJS := . | js.Build }}
<script src="{{ $secureJS.Permalink }}" integrity="{{ $secureJS.Data.Integrity }}"></script>
{{ end }}
</body>
</html>

View File

@ -0,0 +1,29 @@
{{ $formId := .Params.id }}
<div class="forms">
<h2>{{ .Title }}</h2>
<form class="form" data-id="{{ $formId }}">
{{ range .Params.questions }}
<fieldset>
<legend>{{ .title }}</legend>
{{ $questionId := .id }}
{{ range .answers }}
<div>
<label>
<input type="radio" name="form_{{ $formId }}-question_{{ $questionId }}" value="{{ .weight }}"> {{ .title }}
</label>
</div>
{{ end }}
</fieldset>
{{ end }}
{{ range .Params.results }}
<div class="score" data-min="{{ .min }}" data-max="{{ .max }}">
Score : <span class="score_{{ $formId }}"></span><br>
Facteur de sécurité : {{ .facteur }}<br>
Effets sur la capacité de charge : {{ .effets }}<br>
Probabilité d'échec (PdE) : {{ .pde }}<br>
PdE QTRA : {{ .pde_qtra }}
</div>
{{ end }}
</form>
</div>