Added gallery stort in admin panel
This commit is contained in:
@@ -8,6 +8,7 @@ using System;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using MyWebsite.ViewModels;
|
||||||
|
|
||||||
namespace MyWebsite.Areas.Admin.Controllers
|
namespace MyWebsite.Areas.Admin.Controllers
|
||||||
{
|
{
|
||||||
@@ -18,7 +19,7 @@ namespace MyWebsite.Areas.Admin.Controllers
|
|||||||
public GalleryController(DatabaseContext context) : base(context) { }
|
public GalleryController(DatabaseContext context) : base(context) { }
|
||||||
|
|
||||||
public IActionResult Index() =>
|
public IActionResult Index() =>
|
||||||
View(Database.Gallery);
|
View(new ArtworkViewModel(Database));
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Edit(string id) =>
|
public IActionResult Edit(string id) =>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
@model IEnumerable<MyWebsite.Models.ImageModel>
|
@model ArtworkViewModel
|
||||||
@{
|
@{
|
||||||
ViewData["Title"] = "Gallery";
|
ViewData["Title"] = "Gallery";
|
||||||
}
|
}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<article>
|
<article>
|
||||||
<table>
|
<table>
|
||||||
@foreach (ImageModel item in Model)
|
@foreach (ImageModel item in Model.Images)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user