backlog routing done
This commit is contained in:
Родитель
50eb877c10
Коммит
e119952fc5
|
@ -0,0 +1,8 @@
|
|||
@page
|
||||
@model RPS.Web.Pages.Backlog.CreateModel
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.AspNetCore.Mvc.RazorPages;
|
||||
|
||||
namespace RPS.Web.Pages.Backlog
|
||||
{
|
||||
public class CreateModel : PageModel
|
||||
{
|
||||
public void OnGet()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,15 +33,17 @@ namespace RPS.Web.Pages.Backlog
|
|||
rpsCommentsRepo = rpsCommentsData;
|
||||
}
|
||||
|
||||
public void OnGet(int id)
|
||||
public IActionResult OnGet(int id)
|
||||
{
|
||||
var item = rpsItemsRepo.GetItemById(id);
|
||||
Item = rpsItemsRepo.GetItemById(id);
|
||||
var users = rpsUserRepo.GetAll();
|
||||
var currentUser = users.Single(u => u.Id == CURRENT_USER_ID);
|
||||
|
||||
//ViewBag.screen = DetailScreenEnum.Details;
|
||||
//ViewBag.users = users;
|
||||
//ViewBag.currentUser = currentUser;
|
||||
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -6,15 +6,13 @@
|
|||
<h1 class="h2">Backlog</h1>
|
||||
<div class="btn-toolbar mb-2 mb-md-0">
|
||||
<div class="btn-group mr-2">
|
||||
<button onclick="location.href = '@(Url.Action("Items", "Backlog", new { preset = "My" }))'">My Items</button>
|
||||
<button onclick="location.href = '@(Url.Action("Items", "Backlog", new { preset = "Open" }))'">Open Items</button>
|
||||
<button onclick="location.href = '@(Url.Action("Items", "Backlog", new { preset = "Closed" }))'">Done Items</button>
|
||||
<a class="btn btn-secondary" asp-page="Items" asp-route-Preset="My">My Items</a>
|
||||
<a class="btn btn-secondary" asp-page="Items" asp-route-Preset="Open">Open Items</a>
|
||||
<a class="btn btn-secondary" asp-page="Items" asp-route-Preset="Closed">Done Items</a>
|
||||
</div>
|
||||
|
||||
<div class="btn-group mr-2">
|
||||
<button onclick="location.href = '@(Url.Action("Create", "Backlog"))'">Add</button>
|
||||
<button asp-action="OnGet">On get</button>
|
||||
<a class="btn btn-secondary">On get ach</a>
|
||||
<a class="btn btn-secondary" asp-page="Create">Add</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -28,8 +28,13 @@ namespace RPS.Web.Pages.Backlog
|
|||
rpsItemsRepo = rpsItemsData;
|
||||
}
|
||||
|
||||
public void OnGet()
|
||||
public IActionResult OnGet()
|
||||
{
|
||||
if (!Preset.HasValue)
|
||||
{
|
||||
return RedirectToPage("Items", new { Preset = PresetEnum.Open });
|
||||
}
|
||||
|
||||
IEnumerable<PtItem> items = null;
|
||||
switch (Preset)
|
||||
{
|
||||
|
@ -47,6 +52,8 @@ namespace RPS.Web.Pages.Backlog
|
|||
break;
|
||||
}
|
||||
Items = items.ToList();
|
||||
|
||||
return Page();
|
||||
}
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче