diff --git a/Pages/Documents/Edit.cshtml b/Pages/Documents/Edit.cshtml index 0f98120..a64744f 100644 --- a/Pages/Documents/Edit.cshtml +++ b/Pages/Documents/Edit.cshtml @@ -3,7 +3,7 @@ @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @{ - ViewData["Title"] = "Edit"; + ViewData["Title"] = "Edit"; }
@@ -15,14 +15,23 @@ +
+ + +
+
+
+ + +
+
- @* *@ @Html.TextAreaFor(model => model.ed.Notes)
diff --git a/Pages/Documents/Edit.cshtml.cs b/Pages/Documents/Edit.cshtml.cs index f5b310a..ae35258 100644 --- a/Pages/Documents/Edit.cshtml.cs +++ b/Pages/Documents/Edit.cshtml.cs @@ -31,9 +31,9 @@ namespace Snootalogue.Pages.Documents { ed = new EditDocument { ID = Document.ID, Title = Document.Title, - Authors = Document.Authors, + Authors = string.Join(",", Document.Authors), Category = Document.Category, - Tags = Document.Tags, + Tags = Document.Tags == null ? "" : string.Join(",", Document.Tags), Read = Document.Read }; @@ -47,7 +47,9 @@ namespace Snootalogue.Pages.Documents { Document d = _context.Document.First(d => d.ID == ed.ID); d.Title = ed.Title; + d.Authors = ed.Authors.Split(",").ToList(); d.Category = ed.Category; + d.Tags = string.IsNullOrWhiteSpace(ed.Tags) ? null : ed.Tags.Split(",").ToList(); d.Notes = ed.Notes; d.Read = ed.Read; diff --git a/Pages/Index.cshtml b/Pages/Index.cshtml index 75b823e..a9117ab 100644 --- a/Pages/Index.cshtml +++ b/Pages/Index.cshtml @@ -16,7 +16,7 @@
By @Html.DisplayFor(modelItem => item.Authors)
Category: @Html.DisplayFor(modelItem => item.Category)
@Html.DisplayFor(modelItem => item.Tags)
- @{string hash = item.Hash.Substring(0, 8);} + @{string hash = item.Hash?.Substring(0, 8);}