Compare commits
No commits in common. "8d436e659a9dfe6d0b255d8988157a4cd1f9e716" and "1daad24db795e400f0d7d144fe47f9b7821fe5cd" have entirely different histories.
8d436e659a
...
1daad24db7
|
|
@ -1,15 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Portfolio.Domain.Features.Pokemon
|
||||
{
|
||||
public class Ingredient
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string ImageURL { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -19,9 +19,6 @@ namespace Portfolio.Domain.Features.Pokemon
|
|||
public string? PokemonImageUrl { get; set; }
|
||||
public string? PokemonShinyImageUrl { get; set; }
|
||||
public string? FlavorText { get; set; }
|
||||
public string? Ingredient1 { get; set; }
|
||||
public string? Ingredient2 { get; set; }
|
||||
public string? Ingredient3 { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,130 +0,0 @@
|
|||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Portfolio.Infrastructure;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Portfolio.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20251117160500_updatePokemonAddIngredients")]
|
||||
partial class updatePokemonAddIngredients
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Portfolio.Domain.Features.Pokemon.Pokemon", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("FlavorText")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.PrimitiveCollection<string>("Ingredients")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsVariation")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("PokemonId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PokemonImageUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PokemonName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PokemonShinyImageUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PokemonType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SleepType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Speciality")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("VariationName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Pokemons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Portfolio.Domain.Features.Pokemon_Natures.PokemonNature", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("BerryRating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IngredientRating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Nature")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("SkillRating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PokemonNatures");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Portfolio.Domain.Features.Pokemon_Subskills.PokemonSubskill", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("BerryRank")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IngredientRank")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SkillRank")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SubSkill")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PokemonSubskills");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Portfolio.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatePokemonAddIngredients : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Ingredients",
|
||||
table: "Pokemons",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ingredients",
|
||||
table: "Pokemons");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
// <auto-generated />
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Portfolio.Infrastructure;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Portfolio.Infrastructure.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20251117171147_updatePokemonChangeIngredient")]
|
||||
partial class updatePokemonChangeIngredient
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "9.0.2")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 128);
|
||||
|
||||
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
|
||||
|
||||
modelBuilder.Entity("Portfolio.Domain.Features.Pokemon.Pokemon", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<string>("FlavorText")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ingredient1")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ingredient2")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ingredient3")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsVariation")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<int>("PokemonId")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("PokemonImageUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PokemonName")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PokemonShinyImageUrl")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("PokemonType")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("SleepType")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Speciality")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("VariationName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("Pokemons");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Portfolio.Domain.Features.Pokemon_Natures.PokemonNature", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("BerryRating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IngredientRating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Nature")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("SkillRating")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PokemonNatures");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Portfolio.Domain.Features.Pokemon_Subskills.PokemonSubskill", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("int");
|
||||
|
||||
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));
|
||||
|
||||
b.Property<int>("BerryRank")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("IngredientRank")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<int>("SkillRank")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("SubSkill")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("PokemonSubskills");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Portfolio.Infrastructure.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class updatePokemonChangeIngredient : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Ingredients",
|
||||
table: "Pokemons",
|
||||
newName: "Ingredient3");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Ingredient1",
|
||||
table: "Pokemons",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Ingredient2",
|
||||
table: "Pokemons",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ingredient1",
|
||||
table: "Pokemons");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Ingredient2",
|
||||
table: "Pokemons");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "Ingredient3",
|
||||
table: "Pokemons",
|
||||
newName: "Ingredients");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,15 +32,6 @@ namespace Portfolio.Infrastructure.Migrations
|
|||
b.Property<string>("FlavorText")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ingredient1")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ingredient2")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("Ingredient3")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<bool>("IsVariation")
|
||||
.HasColumnType("bit");
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
|
||||
|
||||
To Update Entites in the Database:
|
||||
|
||||
1. Make necessary changes to Enttities within .Domain
|
||||
2. Open NuGet Packet Manager
|
||||
3. Ensure default project is pointed to .Infrastructure
|
||||
4. Enter `Add-Migration [Migration Tag Name, ex: updateEntityAddChange]`
|
||||
5. Enter `Update-Database`
|
||||
6. Check SSMS to ensure changes.
|
||||
|
|
@ -1,11 +1,4 @@
|
|||
$width: 200px;
|
||||
$height: 80px;
|
||||
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.badge {
|
||||
.badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
|
@ -16,14 +9,9 @@ $height: 80px;
|
|||
color: white;
|
||||
font-size: clamp(0.7rem, 1vw, 0.9rem);
|
||||
text-align: center;
|
||||
font-weight: 400;
|
||||
text-shadow: 0 2px 2px rgba(0,0,0,0.25);
|
||||
box-shadow: 0 1px 2px 0 rgba(0,0,0,0.35);
|
||||
transition: all 0.2s ease;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
.statText {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
|
|
|
|||
|
|
@ -50,8 +50,6 @@
|
|||
right: 2%;
|
||||
width: clamp(1.5rem, 2.5vw, 2.5rem);
|
||||
height: clamp(1.5rem, 2.5vw, 2.5rem);
|
||||
box-shadow: 0 1px 2px 1px rgba(0,0,0,0.35);
|
||||
border-radius: 20px;
|
||||
}
|
||||
|
||||
.pokemon-flavor-text {
|
||||
|
|
|
|||
|
|
@ -1,425 +1,317 @@
|
|||
@inject IPokemonService PokemonService
|
||||
@inject IHttpClientFactory ClientFactory
|
||||
|
||||
@if(Ingredients == null)
|
||||
@if(formUse == "ADD")
|
||||
{
|
||||
<Loading />
|
||||
}
|
||||
else
|
||||
{
|
||||
@if(formUse == "ADD")
|
||||
{
|
||||
<div class="pokemon-form-container m-auto bg-info border border-5 border-info-subtle rounded-4 p-3">
|
||||
<EditForm class="col" Model="NewPokemon">
|
||||
<DataAnnotationsValidator />
|
||||
<div class="pokemon-form-container m-auto bg-info border border-5 border-info-subtle rounded-4 p-3">
|
||||
<EditForm class="col" Model="NewPokemon">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<div class="bg-primary-subtle rounded"><p class="fs-3 fw-light text-center card-title">New Pokemon</p></div>
|
||||
<div class="bg-primary-subtle rounded"><p class="fs-3 fw-light text-center card-title">New Pokemon</p></div>
|
||||
|
||||
<!-- Pokemon Number and Name -->
|
||||
<div class="row mt-1">
|
||||
<div class="col input-group mb-2">
|
||||
<span class="input-group-text text-sm-center rounded-start">#</span>
|
||||
<InputNumber min="1"
|
||||
placeholder="Pokedex #"
|
||||
id="PokemonId"
|
||||
@bind-Value="NewPokemon.PokemonId"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control "
|
||||
type="number" />
|
||||
<InputText placeholder="Pokemon Name"
|
||||
id="PokemonName"
|
||||
@bind-Value="NewPokemon.PokemonName"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control w-50 rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Variation Check -->
|
||||
<div class="d-flex flex-row justify-content-start input-group ">
|
||||
<InputCheckbox id="IsVariation"
|
||||
@bind-Value="NewPokemon.IsVariation"
|
||||
@onclick="@Toggle"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-check-input p-3 rounded" />
|
||||
<span class="input-group-text ms-1 @GetRoundingClass()">Variation?</span>
|
||||
<InputText placeholder="How So?"
|
||||
id="VariationName"
|
||||
@bind-Value="NewPokemon.VariationName"
|
||||
<!-- Pokemon Number and Name -->
|
||||
<div class="row mt-1">
|
||||
<div class="col input-group mb-2">
|
||||
<span class="input-group-text text-sm-center rounded-start">#</span>
|
||||
<InputNumber min="1"
|
||||
placeholder="Pokedex #"
|
||||
id="PokemonId"
|
||||
@bind-Value="NewPokemon.PokemonId"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control "
|
||||
type="number" />
|
||||
<InputText placeholder="Pokemon Name"
|
||||
id="PokemonName"
|
||||
@bind-Value="NewPokemon.PokemonName"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control rounded-end"
|
||||
hidden="@HideLabel" />
|
||||
class="form-control w-50 rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Variation Check -->
|
||||
<div class="d-flex flex-row justify-content-start input-group ">
|
||||
<InputCheckbox id="IsVariation"
|
||||
@bind-Value="NewPokemon.IsVariation"
|
||||
@onclick="@Toggle"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-check-input p-3 rounded" />
|
||||
<span class="input-group-text ms-1 @GetRoundingClass()">Variation?</span>
|
||||
<InputText placeholder="How So?"
|
||||
id="VariationName"
|
||||
@bind-Value="NewPokemon.VariationName"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control rounded-end"
|
||||
hidden="@HideLabel" />
|
||||
</div>
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
<!-- Pokemon Type -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="PokemonType" class="input-group-text rounded-start">Pokemon Type</span>
|
||||
<InputSelect id="PokemonType" @bind-Value="NewPokemon.PokemonType" @onchange="@SendPokemon" class="form-select rounded-end">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var pt in PokemonTypes)
|
||||
{
|
||||
<option value="@pt">@pt</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
</div>
|
||||
|
||||
<!-- Pokemon Type -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="PokemonType" class="input-group-text rounded-start">Pokemon Type</span>
|
||||
<InputSelect id="PokemonType" @bind-Value="NewPokemon.PokemonType" @onchange="@SendPokemon" class="form-select rounded-end">
|
||||
<!-- Pokemon Sleep Type, Specialty -->
|
||||
<div class="row mb-3 mx-0">
|
||||
<!-- Sleep Type -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="SleepType" class="input-group-text rounded-top">Sleep Type</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="SleepType" @bind-Value="NewPokemon.SleepType" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var pt in PokemonTypes)
|
||||
@foreach (var st in SleepTypes)
|
||||
{
|
||||
<option value="@pt">@pt</option>
|
||||
<option value="@st">@st</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Pokemon Sleep Type, Specialty -->
|
||||
<div class="row mb-3 mx-0">
|
||||
<!-- Sleep Type -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="SleepType" class="input-group-text rounded-top">Sleep Type</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="SleepType" @bind-Value="NewPokemon.SleepType" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var st in SleepTypes)
|
||||
{
|
||||
<option value="@st">@st</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
<!-- Speciality -->
|
||||
<div class="col ps-1 pe-0">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Speciality" class="input-group-text rounded-top">Specialty</span>
|
||||
</div>
|
||||
<!-- Speciality -->
|
||||
<div class="col ps-1 pe-0">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Speciality" class="input-group-text rounded-top">Specialty</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Speciality" @bind-Value="NewPokemon.Speciality" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var sp in Specialities)
|
||||
{
|
||||
<option value="@sp">@sp</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Speciality" @bind-Value="NewPokemon.Speciality" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var sp in Specialities)
|
||||
{
|
||||
<option value="@sp">@sp</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Pokemon Ingredients -->
|
||||
<div class="row mb-3 mx-0">
|
||||
<!-- Ingredient 1 -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Ingredient1" class="input-group-text rounded-top">Ingredient 1</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Ingredient1" @bind-Value="NewPokemon.Ingredient1" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var ingredient in Ingredients)
|
||||
{
|
||||
<option value="@ingredient.Name">@ingredient.Name</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ingredient 2 -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Ingredient2" class="input-group-text rounded-top">Ingredient 2</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Ingredient2" @bind-Value="NewPokemon.Ingredient2" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var ingredient in Ingredients)
|
||||
{
|
||||
<option value="@ingredient.Name">@ingredient.Name</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ingredient 3 -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Ingredient3" class="input-group-text rounded-top">Ingredient 3</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Ingredient3" @bind-Value="NewPokemon.Ingredient3" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var ingredient in Ingredients)
|
||||
{
|
||||
<option value="@ingredient.Name">@ingredient.Name</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
<!-- Images -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ImageUrl" class="input-group-text rounded-start">Base Image URL</span>
|
||||
<InputText id="ImageUrl" @bind-Value="NewPokemon.PokemonImageUrl" @onchange="@SendPokemon" class="form-control rounded-end" />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
<!-- Images -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ImageUrl" class="input-group-text rounded-start">Base Image URL</span>
|
||||
<InputText id="ImageUrl" @bind-Value="NewPokemon.PokemonImageUrl" @onchange="@SendPokemon" class="form-control rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ShinyImageUrl" class="input-group-text rounded-start">Shiny Image URL</span>
|
||||
<InputText id="ShinyImageUrl" @bind-Value="NewPokemon.PokemonShinyImageUrl" @onchange="@SendPokemon" class="form-control rounded-end" />
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ShinyImageUrl" class="input-group-text rounded-start">Shiny Image URL</span>
|
||||
<InputText id="ShinyImageUrl" @bind-Value="NewPokemon.PokemonShinyImageUrl" @onchange="@SendPokemon" class="form-control rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flavor -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="FlavorText" class="input-group-text rounded-start">Flavor Text</span>
|
||||
<InputText id="FlavorText" @bind-Value="NewPokemon.FlavorText" @onchange="@SendPokemon" class="form-control rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flavor -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="FlavorText" class="input-group-text rounded-start">Flavor Text</span>
|
||||
<InputText id="FlavorText" @bind-Value="NewPokemon.FlavorText" @onchange="@SendPokemon" class="form-control rounded-end" />
|
||||
</div>
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
@if (showErrors && !IsComplete)
|
||||
{
|
||||
<div class="alert alert-warning mt-2">
|
||||
Please complete: @string.Join(", ", MissingFields())
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
<div class="d-flex mt-3 justify-content-center gap-3">
|
||||
<button type="button"
|
||||
class="btn btn-success rounded rounded-5 p-1"
|
||||
@onclick="@SendPokemon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4" />
|
||||
</svg>
|
||||
|
||||
@if (showErrors && !IsComplete)
|
||||
</button>
|
||||
@if (mostRecentForm)
|
||||
{
|
||||
<div class="alert alert-warning mt-2">
|
||||
Please complete: @string.Join(", ", MissingFields())
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="d-flex mt-3 justify-content-center gap-3">
|
||||
<button type="button"
|
||||
class="btn btn-success rounded rounded-5 p-1"
|
||||
@onclick="@SendPokemon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16">
|
||||
class="btn btn-danger rounded rounded-5 p-1"
|
||||
@onclick="@HandleRemove">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" />
|
||||
</svg>
|
||||
|
||||
</button>
|
||||
@if (mostRecentForm)
|
||||
{
|
||||
<button type="button"
|
||||
class="btn btn-danger rounded rounded-5 p-1"
|
||||
@onclick="@HandleRemove">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button"
|
||||
class="btn btn-danger rounded rounded-5 p-1"
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button"
|
||||
class="btn btn-danger rounded rounded-5 p-1"
|
||||
|
||||
disabled>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</EditForm>
|
||||
</div>
|
||||
disabled>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</EditForm>
|
||||
</div>
|
||||
|
||||
}
|
||||
else if (formUse == "EDIT")
|
||||
{
|
||||
<div class="pokemon-form-container m-auto bg-info border border-5 border-info-subtle rounded-4 p-3">
|
||||
<EditForm class="col" Model="PokemonToEdit">
|
||||
<DataAnnotationsValidator />
|
||||
}
|
||||
else if (formUse == "EDIT")
|
||||
{
|
||||
<div class="pokemon-form-container m-auto bg-info border border-5 border-info-subtle rounded-4 p-3">
|
||||
<EditForm class="col" Model="PokemonToEdit">
|
||||
<DataAnnotationsValidator />
|
||||
|
||||
<div class="bg-primary-subtle rounded"><p class="fs-3 fw-light text-center card-title">Edit Pokemon</p></div>
|
||||
<div class="bg-primary-subtle rounded"><p class="fs-3 fw-light text-center card-title">Edit Pokemon</p></div>
|
||||
|
||||
<!-- Pokemon Number and Name -->
|
||||
<div class="row mt-1">
|
||||
<div class="col input-group mb-2">
|
||||
<span class="input-group-text text-sm-center rounded-start">#</span>
|
||||
<InputNumber min="1"
|
||||
placeholder="Pokedex #"
|
||||
id="PokemonId"
|
||||
@bind-Value="PokemonToEdit.PokemonId"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control "
|
||||
type="number" />
|
||||
<InputText placeholder="Pokemon Name"
|
||||
id="PokemonName"
|
||||
@bind-Value="PokemonToEdit.PokemonName"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control w-50 rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Variation Check -->
|
||||
<div class="d-flex flex-row justify-content-start input-group ">
|
||||
<InputCheckbox id="IsVariation"
|
||||
@bind-Value="PokemonToEdit.IsVariation"
|
||||
@onclick="@Toggle"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-check-input p-3 rounded" />
|
||||
<span class="input-group-text ms-1 @GetRoundingClass()">Variation?</span>
|
||||
<InputText placeholder="How So?"
|
||||
id="VariationName"
|
||||
@bind-Value="PokemonToEdit.VariationName"
|
||||
<!-- Pokemon Number and Name -->
|
||||
<div class="row mt-1">
|
||||
<div class="col input-group mb-2">
|
||||
<span class="input-group-text text-sm-center rounded-start">#</span>
|
||||
<InputNumber min="1"
|
||||
placeholder="Pokedex #"
|
||||
id="PokemonId"
|
||||
@bind-Value="PokemonToEdit.PokemonId"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control "
|
||||
type="number" />
|
||||
<InputText placeholder="Pokemon Name"
|
||||
id="PokemonName"
|
||||
@bind-Value="PokemonToEdit.PokemonName"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control rounded-end"
|
||||
hidden="@HideLabel" />
|
||||
class="form-control w-50 rounded-end" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Variation Check -->
|
||||
<div class="d-flex flex-row justify-content-start input-group ">
|
||||
<InputCheckbox id="IsVariation"
|
||||
@bind-Value="PokemonToEdit.IsVariation"
|
||||
@onclick="@Toggle"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-check-input p-3 rounded" />
|
||||
<span class="input-group-text ms-1 @GetRoundingClass()">Variation?</span>
|
||||
<InputText placeholder="How So?"
|
||||
id="VariationName"
|
||||
@bind-Value="PokemonToEdit.VariationName"
|
||||
@onchange="@SendPokemon"
|
||||
class="form-control rounded-end"
|
||||
hidden="@HideLabel" />
|
||||
</div>
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
<!-- Pokemon Type -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="PokemonType" class="input-group-text rounded-start">Pokemon Type</span>
|
||||
<InputSelect id="PokemonType" @bind-Value="PokemonToEdit.PokemonType" class="form-select rounded-end" @onchange="@SendPokemon">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var pt in PokemonTypes)
|
||||
{
|
||||
<option value="@pt">@pt</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
</div>
|
||||
|
||||
<!-- Pokemon Type -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="PokemonType" class="input-group-text rounded-start">Pokemon Type</span>
|
||||
<InputSelect id="PokemonType" @bind-Value="PokemonToEdit.PokemonType" class="form-select rounded-end" @onchange="@SendPokemon">
|
||||
<!-- Pokemon Sleep Type, Specialty -->
|
||||
<div class="row mb-3 mx-0">
|
||||
<!-- Sleep Type -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="SleepType" class="input-group-text rounded-top">Sleep Type</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="SleepType" @bind-Value="PokemonToEdit.SleepType" class="form-select rounded-bottom" @onchange="@SendPokemon">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var pt in PokemonTypes)
|
||||
@foreach (var st in SleepTypes)
|
||||
{
|
||||
<option value="@pt">@pt</option>
|
||||
<option value="@st">@st</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Pokemon Sleep Type, Specialty -->
|
||||
<div class="row mb-3 mx-0">
|
||||
<!-- Sleep Type -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="SleepType" class="input-group-text rounded-top">Sleep Type</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="SleepType" @bind-Value="PokemonToEdit.SleepType" class="form-select rounded-bottom" @onchange="@SendPokemon">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var st in SleepTypes)
|
||||
{
|
||||
<option value="@st">@st</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
<!-- Speciality -->
|
||||
<div class="col ps-1 pe-0">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Speciality" class="input-group-text rounded-top">Specialty</span>
|
||||
</div>
|
||||
<!-- Speciality -->
|
||||
<div class="col ps-1 pe-0">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Speciality" class="input-group-text rounded-top">Specialty</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Speciality" @bind-Value="PokemonToEdit.Speciality" class="form-select rounded-bottom" @onchange="@SendPokemon">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var sp in Specialities)
|
||||
{
|
||||
<option value="@sp">@sp</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Speciality" @bind-Value="PokemonToEdit.Speciality" class="form-select rounded-bottom" @onchange="@SendPokemon">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var sp in Specialities)
|
||||
{
|
||||
<option value="@sp">@sp</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Pokemon Ingredients -->
|
||||
<div class="row mb-3 mx-0">
|
||||
<!-- Ingredient 1 -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Ingredient1" class="input-group-text rounded-top">Ingredient 1</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Ingredient1" @bind-Value="PokemonToEdit.Ingredient1" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var ingredient in Ingredients)
|
||||
{
|
||||
<option value="@ingredient.Name">@ingredient.Name</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ingredient 2 -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Ingredient2" class="input-group-text rounded-top">Ingredient 2</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Ingredient2" @bind-Value="PokemonToEdit.Ingredient2" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var ingredient in Ingredients)
|
||||
{
|
||||
<option value="@ingredient.Name">@ingredient.Name</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ingredient 3 -->
|
||||
<div class="col ps-0 pe-1">
|
||||
<div class="row input-group m-auto">
|
||||
<span for="Ingredient3" class="input-group-text rounded-top">Ingredient 3</span>
|
||||
</div>
|
||||
<div class="row input-group m-auto">
|
||||
<InputSelect id="Ingredient3" @bind-Value="PokemonToEdit.Ingredient3" @onchange="@SendPokemon" class="form-select rounded-bottom">
|
||||
<option disabled value="" selected>Select...</option>
|
||||
@foreach (var ingredient in Ingredients)
|
||||
{
|
||||
<option value="@ingredient.Name">@ingredient.Name</option>
|
||||
}
|
||||
</InputSelect>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
<!-- Images -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ImageUrl" class="input-group-text rounded-start">Base Image URL</span>
|
||||
<InputText id="ImageUrl" @bind-Value="PokemonToEdit.PokemonImageUrl" class="form-control rounded-end" @onchange="@SendPokemon" />
|
||||
</div>
|
||||
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
<!-- Images -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ImageUrl" class="input-group-text rounded-start">Base Image URL</span>
|
||||
<InputText id="ImageUrl" @bind-Value="PokemonToEdit.PokemonImageUrl" class="form-control rounded-end" @onchange="@SendPokemon" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ShinyImageUrl" class="input-group-text rounded-start">Shiny Image URL</span>
|
||||
<InputText id="ShinyImageUrl" @bind-Value="PokemonToEdit.PokemonShinyImageUrl" class="form-control rounded-end" @onchange="@SendPokemon" />
|
||||
</div>
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="ShinyImageUrl" class="input-group-text rounded-start">Shiny Image URL</span>
|
||||
<InputText id="ShinyImageUrl" @bind-Value="PokemonToEdit.PokemonShinyImageUrl" class="form-control rounded-end" @onchange="@SendPokemon" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flavor -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="FlavorText" class="input-group-text rounded-start">Flavor Text</span>
|
||||
<InputText id="FlavorText" @bind-Value="PokemonToEdit.FlavorText" class="form-control rounded-end" @onchange="@SendPokemon" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Flavor -->
|
||||
<div class="row mb-2">
|
||||
<div class="input-group m-auto">
|
||||
<span for="FlavorText" class="input-group-text rounded-start">Flavor Text</span>
|
||||
<InputText id="FlavorText" @bind-Value="PokemonToEdit.FlavorText" class="form-control rounded-end" @onchange="@SendPokemon" />
|
||||
</div>
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
@if (showErrors && !IsComplete)
|
||||
{
|
||||
<div class="alert alert-warning mt-2">
|
||||
Please complete: @string.Join(", ", MissingFields())
|
||||
</div>
|
||||
}
|
||||
|
||||
<!-- <br> -->
|
||||
<div class="border-bottom border-3 border-info-subtle rounded m-1 my-3"></div>
|
||||
|
||||
@if (showErrors && !IsComplete)
|
||||
<div class="d-flex mt-3 justify-content-center gap-3">
|
||||
@if (mostRecentForm)
|
||||
{
|
||||
<div class="alert alert-warning mt-2">
|
||||
Please complete: @string.Join(", ", MissingFields())
|
||||
</div>
|
||||
<button type="button"
|
||||
class="btn btn-danger rounded rounded-5 p-1"
|
||||
@onclick="@HandleRemove">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
|
||||
<div class="d-flex mt-3 justify-content-center gap-3">
|
||||
@if (mostRecentForm)
|
||||
{
|
||||
<button type="button"
|
||||
class="btn btn-danger rounded rounded-5 p-1"
|
||||
@onclick="@HandleRemove">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-x-circle" viewBox="0 0 16 16">
|
||||
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16" />
|
||||
<path d="M4.646 4.646a.5.5 0 0 1 .708 0L8 7.293l2.646-2.647a.5.5 0 0 1 .708.708L8.707 8l2.647 2.646a.5.5 0 0 1-.708.708L8 8.707l-2.646 2.647a.5.5 0 0 1-.708-.708L7.293 8 4.646 5.354a.5.5 0 0 1 0-.708" />
|
||||
</svg>
|
||||
</button>
|
||||
}
|
||||
</div>
|
||||
</EditForm>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</EditForm>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ using Microsoft.AspNetCore.Components.Web;
|
|||
using Microsoft.EntityFrameworkCore.Metadata.Internal;
|
||||
using Portfolio.Application.Services.PokemonService;
|
||||
using Portfolio.Domain.Features.Pokemon;
|
||||
using Portfolio.Domain.Features.Portfolio;
|
||||
|
||||
namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
||||
{
|
||||
|
|
@ -39,7 +38,6 @@ namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
|||
|
||||
|
||||
// General Form
|
||||
|
||||
protected static readonly string[] PokemonTypes = new[]
|
||||
{
|
||||
"Grass","Fire","Water","Normal","Flying","Bug","Poison","Electric","Ground","Rock","Ice",
|
||||
|
|
@ -48,7 +46,6 @@ namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
|||
protected static readonly string[] SleepTypes = new[] { "Dozing", "Snoozing", "Slumbering" };
|
||||
protected static readonly string[] Specialities = new[] { "Berries", "Ingredients", "Skills", "All" };
|
||||
|
||||
private List<Ingredient>? Ingredients;
|
||||
|
||||
private bool HideLabel { get; set; }
|
||||
private bool showErrors { get; set; } = false;
|
||||
|
|
@ -56,9 +53,6 @@ namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
|||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
var http = ClientFactory.CreateClient("LocalClient");
|
||||
Ingredients = await http.GetFromJsonAsync<List<Ingredient>>("data/ingredients.json");
|
||||
|
||||
if (formUse == "EDIT")
|
||||
{
|
||||
if (PokemonToEdit.IsVariation == true)
|
||||
|
|
@ -121,7 +115,6 @@ namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
|||
|
||||
private async Task SendPokemon()
|
||||
{
|
||||
Console.WriteLine("onchange");
|
||||
if(formUse == "ADD")
|
||||
{
|
||||
if (!IsComplete)
|
||||
|
|
@ -143,10 +136,7 @@ namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
|||
VariationName = NewPokemon.VariationName,
|
||||
PokemonImageUrl = NewPokemon.PokemonImageUrl,
|
||||
PokemonShinyImageUrl = NewPokemon.PokemonShinyImageUrl,
|
||||
FlavorText = NewPokemon.FlavorText,
|
||||
Ingredient1 = NewPokemon.Ingredient1,
|
||||
Ingredient2 = NewPokemon.Ingredient2,
|
||||
Ingredient3 = NewPokemon.Ingredient3
|
||||
FlavorText = NewPokemon.FlavorText
|
||||
};
|
||||
|
||||
await OnPokemonReady.InvokeAsync(copy);
|
||||
|
|
@ -167,10 +157,7 @@ namespace Portfolio.WebUI.Server.Components.Component.Pokemon_Components
|
|||
VariationName = PokemonToEdit.VariationName,
|
||||
PokemonImageUrl = PokemonToEdit.PokemonImageUrl,
|
||||
PokemonShinyImageUrl = PokemonToEdit.PokemonShinyImageUrl,
|
||||
FlavorText = PokemonToEdit.FlavorText,
|
||||
Ingredient1 = PokemonToEdit.Ingredient1,
|
||||
Ingredient2 = PokemonToEdit.Ingredient2,
|
||||
Ingredient3 = PokemonToEdit.Ingredient3
|
||||
FlavorText = PokemonToEdit.FlavorText
|
||||
};
|
||||
|
||||
await OnPokemonReady.InvokeAsync(edit);
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
<!-- Section 4: Pokemon Type -->
|
||||
<td>
|
||||
<div class="d-flex justify-content-center">
|
||||
<img src="@GetTypeImageUrl(pokemon.PokemonType)" style="width:36px; height:36px;box-shadow: 0 1px 2px 1px rgba(0,0,0,0.35);border-radius: 20px;" />
|
||||
<img src="@GetTypeImageUrl(pokemon.PokemonType)" style="width:36px; height:36px;" />
|
||||
</div>
|
||||
</td>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
[
|
||||
{
|
||||
"name": "Large Leek",
|
||||
"description": "Whether this is the kind of vegetable stalk that Farfetch'd like is unknown.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/largeleek.png"
|
||||
},
|
||||
{
|
||||
"name": "Tasty Mushroom",
|
||||
"description": "A juicy mushroom with an abundance of umami flavor.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/tastymushroom.png"
|
||||
},
|
||||
{
|
||||
"name": "Fancy Egg",
|
||||
"description": "A nutritious cooking name that goes well with all sorts of seasonings.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/fancyegg.png"
|
||||
},
|
||||
{
|
||||
"name": "Soft Potato",
|
||||
"description": "Its mellow flavor makes both body and spirit feel warm and fuzzy.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/softpotato.png"
|
||||
},
|
||||
{
|
||||
"name": "Fancy Apple",
|
||||
"description": "An apple chosen above others. It has spectacular form and a brilliant sheen.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/fancyapple.png"
|
||||
},
|
||||
{
|
||||
"name": "Fiery Herb",
|
||||
"description": "The fiery taste of this bright-red herb will wake anyone right up.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/fieryherb.png"
|
||||
},
|
||||
{
|
||||
"name": "Bean Sausage",
|
||||
"description": "A healthy sausage made from beans that Pok<6F>mon like to eat.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/beansausage.png"
|
||||
},
|
||||
{
|
||||
"name": "Moomoo Milk",
|
||||
"description": "Highly nutritious milk. Pok<6F>mon that drink it become full of energy.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/moomoomilk.png"
|
||||
},
|
||||
{
|
||||
"name": "Honey",
|
||||
"description": "A sweet honey collected by Pok<6F>mon.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/honey.png"
|
||||
},
|
||||
{
|
||||
"name": "Pure Oil",
|
||||
"description": "All-purpose oil that can be used in any type of cuisine.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/pureoil.png"
|
||||
},
|
||||
{
|
||||
"name": "Warming Ginger",
|
||||
"description": "Spicy ginger that warms the body better than any other name.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/warmingginger.png"
|
||||
},
|
||||
{
|
||||
"name": "Snoozy Tomato",
|
||||
"description": "A bright-red tomato. Eat it and you'll sleep like a baby.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/snoozytomato.png"
|
||||
},
|
||||
{
|
||||
"name": "Soothing Cacao",
|
||||
"description": "This cacao bean is time-consuming to process, but its soothing effects make the effort worthwhile.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/soothingcacao.png"
|
||||
},
|
||||
{
|
||||
"name": "Slowpoke Tail",
|
||||
"description": "A very tasty tail of something. When it falls off, it grows back quickly.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/slowpoketail.png"
|
||||
},
|
||||
{
|
||||
"name": "Greengrass Soybeans",
|
||||
"description": "This Greengrass Isle specialty is easy to process into foods that are great for training.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/greengrasssoybeans.png"
|
||||
},
|
||||
{
|
||||
"name": "Greengrass Corn",
|
||||
"description": "This Greengrass Isle specialty can be eaten raw. It's remarkably sweet.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/greengrasscorn.png"
|
||||
},
|
||||
{
|
||||
"name": "Rousing Coffee",
|
||||
"description": "You may have trouble sleeping if you drink too much of this. It may help make you feel more alert.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/rousingcoffee.png"
|
||||
},
|
||||
{
|
||||
"name": "Plump Pumpkin",
|
||||
"description": "A big pumpkin packed full of pulp.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/plumppumpkin.png"
|
||||
},
|
||||
{
|
||||
"name": "Glossy Avocado",
|
||||
"description": "The glossy green shine is a sign it' s freshly picked.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/names/glossyavocado.png"
|
||||
}
|
||||
|
||||
]
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
[
|
||||
{
|
||||
"type": "Grass",
|
||||
"berry": "Durin",
|
||||
"description": "This Berry is tremendously bitter. Just one bite is enough to instantly stop hiccups.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/durinberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Fire",
|
||||
"berry": "Leppa",
|
||||
"description": "It takes longer to grow than Berries such as Cheri. The smaller Berries taste better.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/leppaberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Water",
|
||||
"berry": "Oran",
|
||||
"description": "Nature's gifts came together as one in this Berry. It has a wondrous mix of flavors that spread in the mouth.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/oranberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Normal",
|
||||
"berry": "Persim",
|
||||
"description": "The more this Berry absorbs energy from sunlight, the more vividly colorful it grows.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/persimberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Flying",
|
||||
"berry": "Pamtre",
|
||||
"description": "This Berry drifted from a faraway sea. It can now be cultivated even on this island.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/pamtreberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Bug",
|
||||
"berry": "Lum",
|
||||
"description": "This Berry's gradual process of storing nutrients beneficial to Pok<6F>mon health causes it to mature slowly.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/lumberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Poison",
|
||||
"berry": "Chesto",
|
||||
"description": "This Berry's thick skin and fruit are very tough and dry-tasting. However, every bit of it can be eaten.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/chestoberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Electric",
|
||||
"berry": "Grepa",
|
||||
"description": "One bite of this very tender Berry fills the mouth with its sweet and tangy flavor.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/grepaberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Ground",
|
||||
"berry": "Figy",
|
||||
"description": "This Berry is oddly shaped, appearing as if someone took a bite out of it. It's packed full of spicy substances.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/figyberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Rock",
|
||||
"berry": "Sitrus",
|
||||
"description": "Sitrus came from the same family as Oran. It's larger and smoother- tasting than Oran.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/sitrusberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Ice",
|
||||
"berry": "Rawst",
|
||||
"description": "If the leaves grow longer and curlier than average, this Berry will have a somewhat bitter taste.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/rawstberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Steel",
|
||||
"berry": "Belue",
|
||||
"description": "This glossy and colorful Berry has a mouthwateringly delicious appearance. However, it's awfully sour.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/belueberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Fighting",
|
||||
"berry": "Cheri",
|
||||
"description": "This bright red Berry is very spicy and has a provocative flavor. It blooms with delicate, pretty flowers.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/cheriberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Psychic",
|
||||
"berry": "Mago",
|
||||
"description": "This Berry progressively curves as it grows. The curvier the Berry, the sweeter it tastes.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/magoberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Dark",
|
||||
"berry": "Wiki",
|
||||
"description": "It's said that this Berry grew lumps to help Pok<6F>mon grip it, allowing propagation farther afield.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/wikiberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Fairy",
|
||||
"berry": "Pecha",
|
||||
"description": "Because of its hollow inside pocket, there isn't a lot to eat. What can be eaten is very sweet and delicious.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/pechaberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Ghost",
|
||||
"berry": "Bluk",
|
||||
"description": "Though this small, delicately skinned Berry is blue in color, it dyes the mouth black when eaten.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/blukberry.png"
|
||||
},
|
||||
{
|
||||
"type": "Dragon",
|
||||
"berry": "Yache",
|
||||
"description": "This Berry has a refreshing flavor that strikes a good balance of dryness and sourness. It tastes better chilled.",
|
||||
"imageURL": "https://www.serebii.net/pokemonsleep/berries/yacheberry.png"
|
||||
}
|
||||
|
||||
]
|
||||
Loading…
Reference in New Issue