136 lines
6.5 KiB
Plaintext
136 lines
6.5 KiB
Plaintext
@page "/pokemonsleep/add-new-pokemon"
|
|
|
|
@inject IPokemonService PokemonService
|
|
@inject NavigationManager Navigation
|
|
|
|
@attribute [StreamRendering]
|
|
@rendermode InteractiveServer
|
|
|
|
|
|
<PageTitle>Add New Pokémon</PageTitle>
|
|
<PokemonHeader />
|
|
|
|
|
|
@if (isSubmitting)
|
|
{
|
|
<p><em>Submitting...</em></p>
|
|
}
|
|
else
|
|
{
|
|
<div class="w-50 mt-5 m-auto create-container bg-info border border-5 border-info-subtle">
|
|
|
|
<div class="card-header rounded-top-3 bg-info py-3">
|
|
<div class="row text-center">
|
|
<h2 class="text-white text-decoration-underline">Add New Pokémon</h2>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="p-3" >
|
|
<EditForm class=" col" Model="NewPokemon" OnValidSubmit="HandleSubmit">
|
|
<DataAnnotationsValidator />
|
|
|
|
<!-- Pokemon Number and Name -->
|
|
<div class="row mt-3">
|
|
<div class="col-sm-3 input-group mb-3">
|
|
<!-- Pokemon #-->
|
|
<span for="PokemonId" class="input-group-text">#</span>
|
|
<InputNumber min="0" placeholder="Pokedex #" id="PokemonId" @bind-Value="NewPokemon.PokemonId" class="form-control " required />
|
|
<!-- Pokemon Name-->
|
|
<InputText placeholder="Pokemon Name" id="PokemonName" @bind-Value="NewPokemon.PokemonName" class="form-control w-75" required />
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Pokemon Type, Sleep Type, and Speciality -->
|
|
<div class="row mb-3">
|
|
<!-- Pokemon Type -->
|
|
<div class="col m-auto">
|
|
<label for="PokemonType" class="form-label">Pokemon Type</label>
|
|
<InputSelect id="PokemonType" @bind-Value="NewPokemon.PokemonType" class="form-select">
|
|
<option dsabled value="">Select Type</option>
|
|
<option value="Grass">Grass</option>
|
|
<option value="Fire">Fire</option>
|
|
<option value="Water">Water</option>
|
|
<option value="Normal">Normal</option>
|
|
<option value="Flying">Flying</option>
|
|
<option value="Bug">Bug</option>
|
|
<option value="Poison">Poison</option>
|
|
<option value="Electric">Electric</option>
|
|
<option value="Ground">Ground</option>
|
|
<option value="Rock">Rock</option>
|
|
<option value="Ice">Ice</option>
|
|
<option value="Steel">Steel</option>
|
|
<option value="Fighting">Fighting</option>
|
|
<option value="Psychic">Psychic</option>
|
|
<option value="Dark">Dark</option>
|
|
<option value="Fairy">Fairy</option>
|
|
<option value="Ghost">Ghost</option>
|
|
<option value="Dragon">Dragon</option>
|
|
</InputSelect>
|
|
</div>
|
|
<!-- Sleep Type -->
|
|
<div class="col m-auto">
|
|
<label for="SleepType" class="form-label">Sleep Type</label>
|
|
<InputSelect id="SleepType" @bind-Value="NewPokemon.SleepType" class="form-select">
|
|
<option value="Dozing">Dozing</option>
|
|
<option value="Snoozing">Snoozing</option>
|
|
<option value="Slumbering">Slumbering</option>
|
|
</InputSelect>
|
|
</div>
|
|
<!-- Speciality-->
|
|
<div class="col m-auto">
|
|
<label for="Speciality" class="form-label">Specialty</label>
|
|
<InputSelect id="Speciality" @bind-Value="NewPokemon.Speciality" class="form-select">
|
|
<option value="Berries">Berries</option>
|
|
<option value="Ingredients">Ingredients</option>
|
|
<option value="Skills">Skills</option>
|
|
<option value="All">All</option>
|
|
</InputSelect>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- If New Pokemon is Variant -->
|
|
<div class="row mb-3">
|
|
<div class="input-group align-items-center">
|
|
<!-- Variation Check -->
|
|
<div class="d-flex">
|
|
<InputCheckbox id="IsVariation" @bind-Value="NewPokemon.IsVariation" @onclick="@Toggle" class="form-check-input checkbox-styling p-3 rounded" />
|
|
<span for="IsVariation" class="input-group-text mx-2">Variation?</span>
|
|
</div>
|
|
|
|
<!-- Variation Region Input -->
|
|
<div class="flex-fill">
|
|
|
|
<InputText placeholder="What Variant? (Alolan, Paldean)" hidden="@HideLabel" id="VariationName" @bind-Value="NewPokemon.VariationName" class="form-control" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- New Image URL Field -->
|
|
<div class="row mb-3 m-auto">
|
|
<label for="ImageUrl" class="form-label">Base Image URL</label>
|
|
<InputText id="ImageUrl" @bind-Value="NewPokemon.PokemonImageUrl" class="form-control" />
|
|
</div>
|
|
<!-- Shiny Image URL Input -->
|
|
<div class="row mb-3 m-auto">
|
|
<label for="ImageUrl" class="form-label">Shiny Image URL</label>
|
|
<InputText id="ImageUrl" @bind-Value="NewPokemon.PokemonShinyImageUrl" class="form-control" />
|
|
</div>
|
|
|
|
<!-- Flavor Text Input -->
|
|
<div class="row mb-3 m-auto">
|
|
<label for="FlavorText" class="form-label">Flavor Text</label>
|
|
<InputText id="FlavorText" @bind-Value="NewPokemon.FlavorText" class="form-control" />
|
|
</div>
|
|
|
|
<!-- Form Buttons -->
|
|
<div class="d-flex mt-5 justify-content-between">
|
|
<button type="button" class="btn btn-danger rounded rouneded-4 mb-3 " @onclick="Cancel">Cancel</button>
|
|
<button type="submit" class="btn btn-success rounded rouneded-4 mb-3 ">Add Pokemon</button>
|
|
</div>
|
|
</EditForm>
|
|
</div>
|
|
</div>
|
|
}
|
|
|