Skip to content

Commit

Permalink
Warn before creating flight if no glider or location is available (#165)
Browse files Browse the repository at this point in the history
Fixes #21.
  • Loading branch information
dbrgn authored Apr 1, 2024
1 parent ef135ab commit da2435c
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions frontend/src/routes/flights/add/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,25 @@
<a href="/locations/add">add it</a> before filling out this form! Currently locations cannot be
created automatically.
</p>

{#if data.locations.length === 0}
<article class="message is-warning">
<div class="message-body">
<i class="fa-solid fa-warning" />&ensp;Warning: You haven't added any locations so far. To
be able to link a launch or landing location to your flight,
<a href="/locations/">add a location</a> before adding a flight.
</div>
</article>
{/if}

{#if data.gliders.length === 0}
<article class="message is-warning">
<div class="message-body">
<i class="fa-solid fa-warning" />&ensp;Warning: You haven't added any gliders so far. To
be able to link a glider to your flight,
<a href="/gliders/">add a glider</a> before adding a flight.
</div>
</article>
{/if}
</section>
</FlightForm>

0 comments on commit da2435c

Please sign in to comment.