Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
little adjustments, and db updata
Browse files Browse the repository at this point in the history
  • Loading branch information
GreatNovaDragon committed Feb 27, 2024
1 parent 936150e commit fb52dff
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 44 deletions.
8 changes: 7 additions & 1 deletion DBInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ 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("1/16", "gradD4")
.Replace("1/16", "gradD4")
.Replace("1/8", "(2*Grad)D4")
: m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en") != null
? m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en").FlavorText
Expand All @@ -309,6 +309,12 @@ private static async Task TransferMoves(ApplicationDbContext context, PokeApiCli
? m.FlavorTextEntries.FirstOrDefault(n => n.Language.Name == "en").FlavorText
: "No Data";

if (!m.Priority.Equals(0))
{
var prio = $"\n\n Has a priority of {m.Priority}.";
ShortEffect += prio;
Effect += prio;
}

Effect = accuracy_string_en(m.Accuracy) + Effect;
Effect = Effect.Replace("Inflicts regular damage.", "");
Expand Down
41 changes: 21 additions & 20 deletions Pages/LearnSet/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page
@model pkmnWildLife.Pages.LearnSet.IndexModel
@model IndexModel

@{
ViewData["Title"] = "Index";
Expand All @@ -15,7 +15,7 @@
<tr>
<th>Who</th>
<th>What</th>

<th>
@Html.DisplayNameFor(model => model.Learnset[0].how)
</th>
Expand All @@ -26,22 +26,23 @@
</tr>
</thead>
<tbody>
@foreach (var item in Model.Learnset) {
<tr>
<td>@item.mon.Name</td>
<td>@item.move.Name</td>
<td>
@Html.DisplayFor(modelItem => item.how)
</td>
<td>
@Html.DisplayFor(modelItem => item.level)
</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.ID">Edit</a> |
<a asp-page="./Details" asp-route-id="@item.ID">Details</a> |
<a asp-page="./Delete" asp-route-id="@item.ID">Delete</a>
</td>
</tr>
}
@foreach (var item in Model.Learnset)
{
<tr>
<td>@item.mon.Name</td>
<td>@item.move.Name</td>
<td>
@Html.DisplayFor(modelItem => item.how)
</td>
<td>
@Html.DisplayFor(modelItem => item.level)
</td>
<td>
<a asp-page="./Edit" asp-route-id="@item.ID">Edit</a> |
<a asp-page="./Details" asp-route-id="@item.ID">Details</a> |
<a asp-page="./Delete" asp-route-id="@item.ID">Delete</a>
</td>
</tr>
}
</tbody>
</table>
</table>
32 changes: 13 additions & 19 deletions Pages/LearnSet/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
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
namespace pkmnWildLife.Pages.LearnSet;

public class IndexModel : PageModel
{
public class IndexModel : PageModel
{
private readonly pkmnWildLife.Data.ApplicationDbContext _context;
private readonly ApplicationDbContext _context;

public IndexModel(pkmnWildLife.Data.ApplicationDbContext context)
{
_context = context;
}
public IndexModel(ApplicationDbContext context)
{
_context = context;
}

public IList<Learnset> Learnset { get;set; } = default!;
public IList<Learnset> Learnset { get; set; } = default!;

public async Task OnGetAsync()
{
Learnset = await _context.Learnsets.ToListAsync();
}
public async Task OnGetAsync()
{
Learnset = await _context.Learnsets.ToListAsync();
}
}
}
5 changes: 2 additions & 3 deletions Pages/pokemon/listwithstats.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<td>@item.SP_ATK</td>
<td>@item.SP_DEF</td>
<td>@item.SPEED</td>


<td style="display:none;">
@Html.Raw($"{item.Type1.Name}")
Expand All @@ -83,5 +83,4 @@
</tr>
}
</tbody>
</table>

</table>
Binary file modified app.db
Binary file not shown.
1 change: 0 additions & 1 deletion wwwroot/css/w3.css
Original file line number Diff line number Diff line change
Expand Up @@ -1170,7 +1170,6 @@ a {
}



.w3-left-align {
text-align: left !important
}
Expand Down

0 comments on commit fb52dff

Please sign in to comment.