settings: Can disable all submission button for maintenance
This commit is contained in:
parent
329bd246c7
commit
e9dd35f8ac
9 changed files with 41 additions and 10 deletions
|
|
@ -10,11 +10,13 @@
|
|||
ListGroupItem,
|
||||
Progress,
|
||||
Spinner,
|
||||
Tooltip,
|
||||
} from 'sveltestrap';
|
||||
|
||||
import { blake2b } from 'hash-wasm';
|
||||
|
||||
import { my } from '../stores/my.js';
|
||||
import { settings } from '../stores/settings.js';
|
||||
|
||||
import DateFormat from './DateFormat.svelte';
|
||||
import FlagKey from './FlagKey.svelte';
|
||||
|
|
@ -224,13 +226,17 @@
|
|||
<Button
|
||||
type="submit"
|
||||
color="danger"
|
||||
disabled={submitInProgress}
|
||||
id="submission-{exercice.id}"
|
||||
disabled={submitInProgress || $settings.disablesubmitbutton}
|
||||
>
|
||||
{#if submitInProgress}
|
||||
<Spinner size="sm" class="me-2" />
|
||||
{/if}
|
||||
Soumettre
|
||||
</Button>
|
||||
{#if $settings.disablesubmitbutton}
|
||||
<span class="text-muted">{$settings.disablesubmitbutton}</span>
|
||||
{/if}
|
||||
</div>
|
||||
</form>
|
||||
</CardBody>
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@
|
|||
{#if !(hint.content || hint.file) || (!hint.file && hint.hidden)}
|
||||
<div>
|
||||
{#if !(hint.content || hint.file)}
|
||||
<button type="button" on:click={openHint(hint)} class="btn btn-info" class:disabled={hints_submitted[hint.id]}>
|
||||
<button type="button" on:click={openHint(hint)} class="btn btn-info" class:disabled={hints_submitted[hint.id]} disabled={$settings.disablesubmitbutton}>
|
||||
{#if hints_submitted[hint.id]}
|
||||
<Spinner size="sm" class="me-2" />
|
||||
{:else}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@
|
|||
color="success"
|
||||
type="button"
|
||||
on:click={wantchoices}
|
||||
disabled={wcsubmitted}
|
||||
disabled={wcsubmitted || $settings.disablesubmitbutton}
|
||||
title="Cliquez pour échanger ce champ de texte par une liste de choix. L'opération vous coûtera {flag.choices_cost * $settings.wchoiceCurrentCoefficient} points."
|
||||
>
|
||||
{#if wcsubmitted}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
} from 'sveltestrap';
|
||||
|
||||
import { issues, issues_idx } from '../stores/issues.js';
|
||||
import { settings } from '../stores/settings.js';
|
||||
|
||||
export let exercice = null;
|
||||
export let issue = { };
|
||||
|
|
@ -41,7 +42,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Button type="submit" color="warning" class="float-end">
|
||||
<Button type="submit" color="warning" class="float-end" disabled={$settings.disablesubmitbutton}>
|
||||
Envoyer le rapport
|
||||
</Button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
} from 'sveltestrap';
|
||||
|
||||
import { my } from '../stores/my.js';
|
||||
import { settings } from '../stores/settings.js';
|
||||
|
||||
export let refresh_my;
|
||||
|
||||
|
|
@ -101,7 +102,7 @@
|
|||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="newName" bind:value={newTeamName} placeholder="{$my.name}">
|
||||
<Button type="submit" class="btn btn-info">Valider</Button>
|
||||
<Button type="submit" class="btn btn-info" disabled={$settings.disablesubmitbutton}>Valider</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ function createSettingsStore() {
|
|||
settings.generation = new Date(settings.generation);
|
||||
if (settings.activateTime)
|
||||
settings.activateTime = new Date(settings.activateTime);
|
||||
if (!settings.disablesubmitbutton)
|
||||
settings.disablesubmitbutton = null;
|
||||
|
||||
settings.recvTime = recvTime;
|
||||
const x_fic_time = res_settings.headers.get("x-fic-time");
|
||||
|
|
|
|||
Reference in a new issue