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