This repository has been archived by the owner on Mar 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ced9b9f
commit 936150e
Showing
7 changed files
with
168 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
@page | ||
@model pkmnWildLife.Pages.LearnSet.IndexModel | ||
|
||
@{ | ||
ViewData["Title"] = "Index"; | ||
} | ||
|
||
<h1>Index</h1> | ||
|
||
<p> | ||
<a asp-page="Create">Create New</a> | ||
</p> | ||
<table class="table"> | ||
<thead> | ||
<tr> | ||
<th>Who</th> | ||
<th>What</th> | ||
|
||
<th> | ||
@Html.DisplayNameFor(model => model.Learnset[0].how) | ||
</th> | ||
<th> | ||
@Html.DisplayNameFor(model => model.Learnset[0].level) | ||
</th> | ||
<th></th> | ||
</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> | ||
} | ||
</tbody> | ||
</table> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> Learnset { get;set; } = default!; | ||
|
||
public async Task OnGetAsync() | ||
{ | ||
Learnset = await _context.Learnsets.ToListAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
@page | ||
@model IndexModel | ||
|
||
@{ | ||
ViewData["Title"] = "Index"; | ||
ViewData["HeaderColor"] = "#f00"; | ||
} | ||
|
||
<h1>Index</h1> | ||
|
||
<p> | ||
<a asp-page="Create">Create New</a> | ||
</p> | ||
<table id="pokedex" class="display"> | ||
<thead> | ||
<tr> | ||
<th style="display:none;"> Name en</th> | ||
|
||
<th> | ||
@Html.DisplayNameFor(model => model.Pokemon[0].Name) | ||
</th> | ||
<th>HP</th> | ||
<th>ATK</th> | ||
<th>DEF</th> | ||
<th>SpATK</th> | ||
<th>SpDEF</th> | ||
<th>Speed</th> | ||
|
||
|
||
<th> | ||
Typen | ||
</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
@foreach (var item in Model.Pokemon.OrderBy(c => c.Dex)) | ||
{ | ||
<tr> | ||
<td style="display:none;">@Html.DisplayFor(modelItem => item.Name) </td> | ||
<td> | ||
<a asp-page="./Details" asp-route-id="@item.ID"> | ||
@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) | ||
} | ||
|
||
|
||
</a> | ||
</td> | ||
|
||
<td>@item.HEALTH</td> | ||
<td>@item.ATK</td> | ||
<td>@item.DEF</td> | ||
<td>@item.SP_ATK</td> | ||
<td>@item.SP_DEF</td> | ||
<td>@item.SPEED</td> | ||
|
||
|
||
<td style="display:none;"> | ||
@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}") | ||
} | ||
</td> | ||
</tr> | ||
} | ||
</tbody> | ||
</table> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters