ui: Fix base url mess

This commit is contained in:
nemunaire 2021-09-01 11:20:41 +02:00
commit 17839474e1
23 changed files with 66 additions and 43 deletions

View file

@ -72,7 +72,7 @@
<h3 class="display-4">{exercice.title}</h3>
<div>
{#each exercice.tags as tag, index}
<Badge href="/tags/{tag}" pill color="secondary" class="mx-1 mb-2" >#{tag}</Badge>
<Badge href="tags/{tag}" pill color="secondary" class="mx-1 mb-2" >#{tag}</Badge>
{/each}
</div>
{#if !$my || !$my.exercices[exercice.id]}
@ -105,7 +105,7 @@
aucune équipe
{:else}
{exercice.tried} {exercice.tried == 1?"équipe":"équipes"}
{#if $my && $my.exercices[exercice.id].total_tries}
{#if $my && $my.exercices[exercice.id] && $my.exercices[exercice.id].total_tries}
(cumulant {$my.exercices[exercice.id].total_tries} {$my.exercices[exercice.id].total_tries == 1?"tentative":"tentatives"})
{/if}
{/if}
@ -123,13 +123,13 @@
{#if $my && $my.team_id}
<Col>
{#if $settings.acceptNewIssue}
<a href="/issues/?eid={exercice.id}" class="float-end btn btn-sm btn-warning">
<a href="issues/?eid={exercice.id}" class="float-end btn btn-sm btn-warning">
<Icon name="bug" />
Rapporter une anomalie sur ce défi
</a>
{/if}
{#if $settings.QAenabled}
<a href="/qa/exercices/{exercice.id}" class="float-end btn btn-sm btn-info" target="_self">
<a href="qa/exercices/{exercice.id}" class="float-end btn btn-sm btn-info" target="_self">
<Icon name="bug" />
Voir les éléments QA sur ce défi
</a>

View file

@ -43,7 +43,7 @@
<div style="background-image: url({theme.image})" class="page-header">
<Container class="text-primary">
<h1 class="display-2">
<a href="/{theme.urlid}">{theme.name}</a>
<a href="{theme.urlid}">{theme.name}</a>
</h1>
<h2>{@html theme.authors}</h2>
</Container>

View file

@ -66,7 +66,7 @@
<li
class="list-group-item"
class:list-group-item-action={$my && $my.exercices[k]}
on:click={goto(`/${theme.urlid}/${theme.exercices[k].urlid}`)}
on:click={goto(`${theme.urlid}/${theme.exercices[k].urlid}`)}
>
<div class="row">
<div class="col-1" style="margin-top: -0.5rem; margin-bottom: -0.5rem; text-align: right; border-right: 5px solid #{$my && $my.exercices[k] && $my.exercices[k].solved_rank ? '62c462' : 'bbb'}">
@ -86,7 +86,7 @@
</svg>
</div>
{#each theme.exercices[k].tags as tag, idx}
<Badge href="/tags/{tag}" pill color="secondary" class="mx-1 float-end">#{tag}</Badge>
<Badge href="tags/{tag}" pill color="secondary" class="mx-1 float-end">#{tag}</Badge>
{/each}
<h5 class="fw-bold">
{#if $my && $my.exercices[k]}

View file

@ -0,0 +1,15 @@
<script context="module">
export function load({ error, status }) {
return {
props: {
title: `${status}: ${error.message}`
}
};
}
</script>
<script>
export let title;
</script>
<h1>{title}</h1>

View file

@ -33,7 +33,7 @@
};
}
settings.update(await fetch('/settings.json'), cb);
settings.update(await fetch('settings.json'), cb);
}
let refresh_interval_teams = null;
@ -45,7 +45,7 @@
}
refresh_interval_teams = setInterval(refresh_teams, interval);
teamsStore.update(await fetch('/teams.json'), cb);
teamsStore.update(await fetch('teams.json'), cb);
}
let refresh_interval_themes = null;
@ -57,7 +57,7 @@
}
refresh_interval_themes = setInterval(refresh_themes, interval);
await themesStore.update(await fetch('/themes.json'), cb);
await themesStore.update(await fetch('themes.json'), cb);
}
let refresh_interval_my = null;
@ -69,7 +69,7 @@
}
refresh_interval_my = setInterval(refresh_my, interval);
my.update(await fetch('/my.json'), cb);
my.update(await fetch('my.json'), cb);
}
let refresh_interval_issues = null;
@ -81,7 +81,7 @@
}
refresh_interval_issues = setInterval(refresh_issues, interval);
issuesStore.update(await fetch('/issues.json'), cb);
issuesStore.update(await fetch('issues.json'), cb);
}
export async function load({ page, fetch, session, context }) {

View file

@ -51,7 +51,7 @@
{:else}
<Alert color="danger">
<strong>Vous n'avez pas encore d'équipe&nbsp;!</strong>
Rendez-vous sur <a href="/register">la page d'inscription</a> pour plus d'information.
Rendez-vous sur <a href="register">la page d'inscription</a> pour plus d'information.
</Alert>
{/if}
</Container>

View file

@ -24,7 +24,7 @@
{#if !$my}
{#if $settings.allowRegistration}
<Alert color="warning" class="text-justify" fade={false}>
<strong>Votre équipe n'est pas encore enregistrée.</strong> Rendez-vous sur <a href="/register">cette page</a> pour procéder à votre inscription.
<strong>Votre équipe n'est pas encore enregistrée.</strong> Rendez-vous sur <a href="register">cette page</a> pour procéder à votre inscription.
</Alert>
{:else}
<Alert color="danger" class="text-justify" fade={false}>
@ -53,7 +53,7 @@
<CardTheme
class="{$my && $my.team_id && $myThemes[$themes[th].id].exercice_solved > 0?'border-success ':''}{$themes[th].exercice_coeff_max > 1?'border-warning ':''}"
theme={$themes[th]}
on:click={goto(`/${$themes[th].urlid}`)}
on:click={goto(`${$themes[th].urlid}`)}
/>
</Col>
{/each}

View file

@ -64,7 +64,7 @@
return false;
}
const response = await fetch('/issue', {
const response = await fetch('issue', {
method: "POST",
body: JSON.stringify(issue),
});
@ -151,7 +151,7 @@
<tr>
<td>
{issue.subject}
{#if issue.exercice} (défi <a href="/{issue.url}">{issue.exercice}</a>){/if}
{#if issue.exercice} (défi <a href="{issue.url}">{issue.exercice}</a>){/if}
</td>
<td>{issue.state} / {issue.priority}</td>
<td>{#if issue.assignee}{issue.assignee}{:else}En attente d'attribution{/if}</td>

View file

@ -38,7 +38,7 @@
function gotoHomeOnDiff(i) {
refresh_my((my) => {
if (my && my.team_id) {
goto('/');
goto('.');
} else if (i > 0) {
setTimeout(gotoHomeOnDiff, 650, i-1);
}
@ -66,7 +66,7 @@
return;
}
const response = await fetch('/registration', {
const response = await fetch('registration', {
method: "POST",
body: JSON.stringify(form),
})

View file

@ -56,7 +56,7 @@
<CardTheme
theme={theme}
exercice={exercice}
on:click={goto(`/${theme.urlid}/${exercice.urlid}`)}
on:click={goto(`${theme.urlid}/${exercice.urlid}`)}
/>
</Col>
{/each}