Merge branch 'master' of ssh://git.andreafazzi.eu:10022/andrea/oef

This commit is contained in:
Andrea Fazzi 2020-02-18 09:06:04 +01:00
commit dfd7791ba9
3 changed files with 37 additions and 2 deletions

View file

@ -1 +1 @@
0.4.1-6-gd46a26c-master
0.4.1-2-g70d36ac-master

View file

@ -85,7 +85,8 @@ func genCaptcha() string {
}
func markdown(text string) string {
unsafe := blackfriday.Run([]byte(text))
sanitized := strings.Replace(text, "\r\n", "\n", -1)
unsafe := blackfriday.Run([]byte(sanitized))
return string(bluemonday.UGCPolicy().SanitizeBytes(unsafe))
}
func version() string {

View file

@ -28,6 +28,16 @@
La gara è sempre attiva.
{{end}}
</dd>
{{if not (.Data.Contest.Date|zeroTime)}}
<dt class="col-sm-3">Prima visualizzazione</dt>
<dd class="col-sm-9">
{{if not (.Data.StartTime|zeroTime)}}
Giorno {{.Data.StartTime|prettyDate}} alle ore {{.Data.StartTime|convertTime}}
{{else}}
Il partecipante non ha ancora visualizzato la prova.
{{end}}
</dd>
{{end}}
{{if $isAdmin}}
<dt class="col-sm-3">Ordine delle domande</dt>
<dd class="col-sm-9">{{.Data.QuestionsOrder}}</dd>
@ -50,6 +60,30 @@
{{end}}
</dl>
{{if .Data.Contest.Description}}
<h2 class="karmen-relation-header">Descrizione della prova</h2>
<div class="row">
<div class="col-md-12">
{{.Data.Contest.Description|markdown|html}}
</div>
</div>
{{end}}
{{if or $isParticipant}}
<div class="row">
<div class="col-md-12">
<h2 class="karmen-relation-header">Suggerimenti</h2>
<p>
Per iniziare o riprendere la gara clicca sul pulsante a destra.
<a id="new_participant_subscribe" href="{{.Data.ID | update "Response"}}" class="float-right btn btn-primary btn-sm">
<span class="fa fa-edit" aria-hidden="true"></span>
Vai alla gara!
</a>
</p>
</div>
</div>
{{end}}
{{if $isAdmin}}
<div class="row">
<div class="col-md-12">