1
0

Added gallery stort in admin panel

This commit is contained in:
Michael Gordeev
2020-04-28 12:28:50 +03:00
parent 12c43db185
commit 9d372367ce
2 changed files with 4 additions and 3 deletions
@@ -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>