diff --git a/DBInitializer.cs b/DBInitializer.cs index 5775a31..6f5008f 100644 --- a/DBInitializer.cs +++ b/DBInitializer.cs @@ -194,15 +194,13 @@ private static async Task TransferAbilities(ApplicationDbContext context, PokeAp : Item.Name; var Name_DE = Item.Names.FirstOrDefault(n => n.Language.Name == "de")?.Name; var Effect = Item.EffectEntries.FirstOrDefault(n => n.Language.Name == "en") != null - ? Item.EffectEntries.FirstOrDefault(n => n.Language.Name == "en").Effect.Replace("one stage", "2") - .Replace("two stages", "4").Replace("three stages", "6") + ? Item.EffectEntries.FirstOrDefault(n => n.Language.Name == "en").Effect : Item.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en") != null ? Item.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en").FlavorText : "No Entry"; var ShortEffect = Item.EffectEntries.FirstOrDefault(n => n.Language.Name == "en") != null - ? Item.EffectEntries.FirstOrDefault(n => n.Language.Name == "en").ShortEffect.Replace("one stage", "2") - .Replace("two stages", "4").Replace("three stages", "6") + ? Item.EffectEntries.FirstOrDefault(n => n.Language.Name == "en").ShortEffect : Item.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en") != null ? Item.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en").FlavorText : "No Entry"; @@ -289,9 +287,8 @@ private static async Task TransferMoves(ApplicationDbContext context, PokeApiCli ? m.EffectEntries.FirstOrDefault(n => n.Language.Name == "de").Effect : m.EffectEntries.FirstOrDefault(n => n.Language.Name == "en") != null ? m.EffectEntries.FirstOrDefault(n => n.Language.Name == "en").Effect - .Replace("$effect_chance", $"{m.EffectChance}").Replace("1/16", "gradD4") + .Replace("1/16", "gradD4") .Replace("1/8", "(2*Grad)D4") - .Replace("user's max HP", "").Replace("max HP", "") : m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en") != null ? m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en").FlavorText : "No Data"; @@ -306,9 +303,8 @@ private static async Task TransferMoves(ApplicationDbContext context, PokeApiCli ? m.EffectEntries.FirstOrDefault(n => n.Language.Name == "de").ShortEffect : m.EffectEntries.FirstOrDefault(n => n.Language.Name == "en") != null ? m.EffectEntries.FirstOrDefault(n => n.Language.Name == "en").ShortEffect - .Replace("$effect_chance", $"{m.EffectChance}").Replace("1/16", "gradD4") + .Replace("1/16", "gradD4") .Replace("1/8", "(2*Grad)D4") - .Replace("user's max HP", "").Replace("max HP", "") : m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en") != null ? m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en").FlavorText : "No Data"; diff --git a/Pages/LearnSet/Index.cshtml b/Pages/LearnSet/Index.cshtml new file mode 100644 index 0000000..56c7f21 --- /dev/null +++ b/Pages/LearnSet/Index.cshtml @@ -0,0 +1,47 @@ +@page +@model pkmnWildLife.Pages.LearnSet.IndexModel + +@{ + ViewData["Title"] = "Index"; +} + +

Index

+ +

+ Create New +

+ + + + + + + + + + + + +@foreach (var item in Model.Learnset) { + + + + + + + +} + +
WhoWhat + @Html.DisplayNameFor(model => model.Learnset[0].how) + + @Html.DisplayNameFor(model => model.Learnset[0].level) +
@item.mon.Name@item.move.Name + @Html.DisplayFor(modelItem => item.how) + + @Html.DisplayFor(modelItem => item.level) + + Edit | + Details | + Delete +
diff --git a/Pages/LearnSet/Index.cshtml.cs b/Pages/LearnSet/Index.cshtml.cs new file mode 100644 index 0000000..166ae89 --- /dev/null +++ b/Pages/LearnSet/Index.cshtml.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.EntityFrameworkCore; +using pkmnWildLife.Data; + +namespace pkmnWildLife.Pages.LearnSet +{ + public class IndexModel : PageModel + { + private readonly pkmnWildLife.Data.ApplicationDbContext _context; + + public IndexModel(pkmnWildLife.Data.ApplicationDbContext context) + { + _context = context; + } + + public IList Learnset { get;set; } = default!; + + public async Task OnGetAsync() + { + Learnset = await _context.Learnsets.ToListAsync(); + } + } +} diff --git a/Pages/pokemon/listwithstats.cshtml b/Pages/pokemon/listwithstats.cshtml new file mode 100644 index 0000000..554031c --- /dev/null +++ b/Pages/pokemon/listwithstats.cshtml @@ -0,0 +1,87 @@ +@page +@model IndexModel + +@{ + ViewData["Title"] = "Index"; + ViewData["HeaderColor"] = "#f00"; +} + +

Index

+ +

+ Create New +

+ + + + + + + + + + + + + + + + + + + @foreach (var item in Model.Pokemon.OrderBy(c => c.Dex)) + { + + + + + + + + + + + + + + + } + +
Name en + @Html.DisplayNameFor(model => model.Pokemon[0].Name) + HPATKDEFSpATKSpDEFSpeed + Typen +
@Html.DisplayFor(modelItem => item.Name) + + @if (!string.IsNullOrEmpty(item.Form_DE)) + { + @Html.Raw($"{item.Form_DE}") + } + else if (!string.IsNullOrEmpty(item.Form)) + { + @Html.Raw($"{item.Form}") + } + else if (!string.IsNullOrEmpty(item.Name_DE)) + { + @Html.Raw(item.Name_DE) + } + else + { + @Html.DisplayFor(modelItem => item.Name) + } + + + + @item.HEALTH@item.ATK@item.DEF@item.SP_ATK@item.SP_DEF@item.SPEED + @Html.Raw($"{item.Type1.Name}") + @if (item.Type2 != null) + { + @Html.Raw($"{item.Type2.Name}") + } + @Html.Raw($"{item.Type1.Name_DE}") + @if (item.Type2 != null) + { + @Html.Raw($"{item.Type2.Name_DE}") + } +
+ diff --git a/Pages/traits/Index.cshtml b/Pages/traits/Index.cshtml index a769ddf..4f03d37 100644 --- a/Pages/traits/Index.cshtml +++ b/Pages/traits/Index.cshtml @@ -22,7 +22,7 @@ @Html.DisplayNameFor(model => model.Ability[0].Effect) - @Html.DisplayFor(model => model.Ability[0].Requirement) + @Html.DisplayNameFor(model => model.Ability[0].Requirement) @@ -30,7 +30,7 @@ @foreach (var item in Model.Ability.OrderBy(item => item.Order)) { - + @Html.DisplayFor(modelItem => item.Order) diff --git a/app.db b/app.db index 26c2ea7..c6727f3 100644 Binary files a/app.db and b/app.db differ diff --git a/wwwroot/css/w3.css b/wwwroot/css/w3.css index ed85527..b315d9e 100644 --- a/wwwroot/css/w3.css +++ b/wwwroot/css/w3.css @@ -180,7 +180,6 @@ textarea { /* End extract */ html, body { font-family: Verdana, sans-serif; - font-size: 15px; line-height: 1.5 } @@ -188,30 +187,6 @@ html { overflow-x: hidden } -h1 { - font-size: 36px -} - -h2 { - font-size: 30px -} - -h3 { - font-size: 24px -} - -h4 { - font-size: 20px -} - -h5 { - font-size: 18px -} - -h6 { - font-size: 16px -} - .w3-serif { font-family: serif } @@ -992,7 +967,6 @@ a { .w3-code, .w3-codespan { font-family: Consolas, "courier new"; - font-size: 16px } .w3-code { @@ -1195,41 +1169,7 @@ a { filter: sepia(50%) } -.w3-verytiny { - font-size: 8px !important -} - -.w3-tiny { - font-size: 9px !important -} - -.w3-small { - font-size: 12px !important -} - -.w3-medium { - font-size: 15px !important -} - -.w3-large { - font-size: 18px !important -} -.w3-xlarge { - font-size: 24px !important -} - -.w3-xxlarge { - font-size: 36px !important -} - -.w3-xxxlarge { - font-size: 48px !important -} - -.w3-jumbo { - font-size: 64px !important -} .w3-left-align { text-align: left !important