ui: Display writeup in interface
This commit is contained in:
parent
45a9240834
commit
a6adc1ac8c
3 changed files with 25 additions and 18 deletions
|
@ -1,25 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import {
|
import {
|
||||||
Card,
|
|
||||||
CardBody,
|
CardBody,
|
||||||
CardHeader,
|
|
||||||
CardText,
|
|
||||||
Icon,
|
Icon,
|
||||||
ListGroup,
|
|
||||||
ListGroupItem,
|
|
||||||
} from 'sveltestrap';
|
} from 'sveltestrap';
|
||||||
|
|
||||||
export let uri = "";
|
export let uri = "";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Card class="border-success mb-2">
|
|
||||||
<CardHeader class="bg-success text-light">
|
|
||||||
<Icon name="laptop-fill" />
|
|
||||||
Solution du défi
|
|
||||||
</CardHeader>
|
|
||||||
<CardBody class="text-indent ratio ratio-16x9">
|
<CardBody class="text-indent ratio ratio-16x9">
|
||||||
<iframe type="text/html" src="{uri.replace('$FILES$','/resolution')}" class="embed-responsive-item" title="Vidéo de résolution">
|
<iframe type="text/html" src="{uri.replace('$FILES$','/resolution')}" class="embed-responsive-item" title="Vidéo de résolution">
|
||||||
Regardez la vidéo de résolution de ce défi : <a href="{uri.replace('$FILES$','/resolution')}">{uri.replace('$FILES$','/resolution')}</a>.
|
Regardez la vidéo de résolution de ce défi : <a href="{uri.replace('$FILES$','/resolution')}">{uri.replace('$FILES$','/resolution')}</a>.
|
||||||
</iframe>
|
</iframe>
|
||||||
</CardBody>
|
</CardBody>
|
||||||
</Card>
|
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
Alert,
|
Alert,
|
||||||
Badge,
|
Badge,
|
||||||
Card,
|
Card,
|
||||||
|
CardBody,
|
||||||
|
CardHeader,
|
||||||
|
CardText,
|
||||||
Col,
|
Col,
|
||||||
Icon,
|
Icon,
|
||||||
Row,
|
Row,
|
||||||
|
@ -172,9 +175,22 @@
|
||||||
exercice={$my.exercices[exercice.id]}
|
exercice={$my.exercices[exercice.id]}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
{#if $my.exercices[exercice.id].resolution || $my.exercices[exercice.id].video_uri}
|
||||||
|
<Card class="border-success mb-2">
|
||||||
|
<CardHeader class="bg-success text-light">
|
||||||
|
<Icon name="laptop-fill" />
|
||||||
|
Solution du défi
|
||||||
|
</CardHeader>
|
||||||
|
{#if $my.exercices[exercice.id].resolution}
|
||||||
|
<CardBody>
|
||||||
|
{@html $my.exercices[exercice.id].resolution}
|
||||||
|
</CardBody>
|
||||||
|
{/if}
|
||||||
{#if $my.exercices[exercice.id].video_uri}
|
{#if $my.exercices[exercice.id].video_uri}
|
||||||
<ExerciceVideo uri={$my.exercices[exercice.id].video_uri} />
|
<ExerciceVideo uri={$my.exercices[exercice.id].video_uri} />
|
||||||
{/if}
|
{/if}
|
||||||
|
</Card>
|
||||||
|
{/if}
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
|
@ -76,6 +76,7 @@ type myTeamExercice struct {
|
||||||
Tries int64 `json:"tries,omitempty"`
|
Tries int64 `json:"tries,omitempty"`
|
||||||
TotalTries int64 `json:"total_tries,omitempty"`
|
TotalTries int64 `json:"total_tries,omitempty"`
|
||||||
VideoURI string `json:"video_uri,omitempty"`
|
VideoURI string `json:"video_uri,omitempty"`
|
||||||
|
Resolution string `json:"resolution,omitempty"`
|
||||||
Issue string `json:"issue,omitempty"`
|
Issue string `json:"issue,omitempty"`
|
||||||
IssueKind string `json:"issuekind,omitempty"`
|
IssueKind string `json:"issuekind,omitempty"`
|
||||||
}
|
}
|
||||||
|
@ -130,6 +131,7 @@ func MyJSONTeam(t *Team, started bool) (interface{}, error) {
|
||||||
exercice.Overview = strings.Replace(e.Overview, "$FILES$", FilesDir, -1)
|
exercice.Overview = strings.Replace(e.Overview, "$FILES$", FilesDir, -1)
|
||||||
exercice.Finished = strings.Replace(e.Finished, "$FILES$", FilesDir, -1)
|
exercice.Finished = strings.Replace(e.Finished, "$FILES$", FilesDir, -1)
|
||||||
exercice.VideoURI = e.VideoURI
|
exercice.VideoURI = e.VideoURI
|
||||||
|
exercice.Resolution = strings.Replace(e.Resolution, "$FILES$", FilesDir, -1)
|
||||||
exercice.TotalTries = e.TriedCount()
|
exercice.TotalTries = e.TriedCount()
|
||||||
exercice.Gain = int(float64(e.Gain) * e.Coefficient * GlobalScoreCoefficient)
|
exercice.Gain = int(float64(e.Gain) * e.Coefficient * GlobalScoreCoefficient)
|
||||||
} else {
|
} else {
|
||||||
|
|
Reference in a new issue