Skip to content

Commit

Permalink
feat(front): add a route to go admin panel with password requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
BaptTF committed Apr 29, 2024
1 parent 2b793b9 commit 41830f6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
5 changes: 5 additions & 0 deletions frontend/src/lib/components/panel/modules.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@
color: 'bg-green-600',
link: '/panel/products/course'
});
modules.push({
name: 'Comptoir',
color: 'bg-yellow-600',
link: '/comptoir/c/transactions'
});
// Sort the modules by name
modules.sort((a, b) => a.name.localeCompare(b.name));
Expand Down
19 changes: 14 additions & 5 deletions frontend/src/routes/comptoir/c/transactions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import ChangePassword from '$lib/components/comptoir/changePassword.svelte';
import Password from '$lib/components/password.svelte';
import { transactionsApi } from '$lib/requests/requests';
import type { TransactionItem } from '$lib/api';
import TransactionsItems from '$lib/components/comptoir/transactionsItems.svelte';
Expand Down Expand Up @@ -47,8 +46,11 @@
});
}
let showTransactionItems = false;
const go_admin_panel = (card_id: string, password: string) => {
goto('/panel');
};
let showTransactionItems = false;
</script>

{#if askForCard}
Expand Down Expand Up @@ -129,6 +131,13 @@
askForCard = true;
}}>caisse</button
>
<button
class="text-xl bg-blue-700 p-2 rounded-xl hover:bg-blue-900 transition-all ml-2"
on:click={() => {
to_call = go_admin_panel;
askForCard = true;
}}>Admin panel</button
>
</div>

<button
Expand All @@ -138,15 +147,15 @@
{#if showTransactionItems}
<button
class="text-3xl bg-blue-700 p-2 rounded-xl hover:bg-blue-900 transition-all"
on:click={() => showTransactionItems = false}>Liste des commandes</button
on:click={() => (showTransactionItems = false)}>Liste des commandes</button
>
{:else}
<button
class="text-3xl bg-blue-700 p-2 rounded-xl hover:bg-blue-900 transition-all"
on:click={() => showTransactionItems = true}>Résumé des commandes</button
on:click={() => (showTransactionItems = true)}>Résumé des commandes</button
>
{/if}

<button
class="text-3xl bg-blue-700 p-2 rounded-xl hover:bg-blue-900 transition-all mr-2"
on:click={() => (newRefill = true)}>Nouvelle Recharge</button
Expand Down

0 comments on commit 41830f6

Please sign in to comment.