Updated admin page to be more streamlined and added the beginning of the blogging features
This commit is contained in:
@@ -64,6 +64,11 @@ public class ArtifactEntry
|
||||
public int ArtifactGroupingId { get; set; }
|
||||
|
||||
public required ArtifactGrouping ArtifactGrouping { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// For keeping track of how many of this artifact are owned
|
||||
/// </summary>
|
||||
public int Quantity { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
|
||||
@@ -19,6 +19,7 @@ public class ArtifactEntryTag
|
||||
|
||||
public List<ArtifactEntry> ArtifactEntries { get; set; } = [];
|
||||
|
||||
public List<SearchPageSliderEntry> SearchPageSliders { get; set; } = [];
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
|
||||
@@ -62,6 +62,13 @@ public class ArtifactGrouping
|
||||
|
||||
public required List<ArtifactEntry> ChildArtifactEntries { get; set; } = new();
|
||||
|
||||
public ArtifactGroupingViewCount? ViewCount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The list of all blog posts about this grouping
|
||||
/// </summary>
|
||||
public List<BlogPost> BlogPosts { get; set; } = [];
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
12
OpenArchival.DataAccess/Models/ArtifactGroupingViewCount.cs
Normal file
12
OpenArchival.DataAccess/Models/ArtifactGroupingViewCount.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace OpenArchival.DataAccess;
|
||||
|
||||
public class ArtifactGroupingViewCount
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public required ArtifactGrouping Grouping { get; set; }
|
||||
|
||||
public int ArtifactGroupingId { get; set; }
|
||||
|
||||
public int Views { get; set; }
|
||||
}
|
||||
39
OpenArchival.DataAccess/Models/Blog/BlogPost.cs
Normal file
39
OpenArchival.DataAccess/Models/Blog/BlogPost.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using NpgsqlTypes;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace OpenArchival.DataAccess;
|
||||
|
||||
public class BlogPost
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The title of the blog post
|
||||
/// </summary>
|
||||
public string Title { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// The HTML content of the post
|
||||
/// </summary>
|
||||
public string Content { get; set; } = "";
|
||||
|
||||
public DateTime CreationTime { get; set; }
|
||||
|
||||
public DateTime ModifiedTime { get; set; }
|
||||
|
||||
public List<BlogPostTag> Tags { get; set; } = [];
|
||||
|
||||
public List<ArtifactGrouping> ArtifactGroupings { get; set; } = [];
|
||||
|
||||
public NpgsqlTsVector ContentSearchVector { get; set; } = default!;
|
||||
|
||||
public NpgsqlTsVector TitleSearchVector { get; set; } = default!;
|
||||
|
||||
public string TagsSearchString { get; set; } = "";
|
||||
public NpgsqlTsVector TagsSearchVector { get; set; } = default!;
|
||||
|
||||
public string AllSearchString { get; set; } = "";
|
||||
public NpgsqlTsVector AllSearchVector { get; set; } = default!;
|
||||
|
||||
}
|
||||
24
OpenArchival.DataAccess/Models/Blog/BlogPostTag.cs
Normal file
24
OpenArchival.DataAccess/Models/Blog/BlogPostTag.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace OpenArchival.DataAccess;
|
||||
|
||||
public class BlogPostTag
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of this tags
|
||||
/// </summary>
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Blog posts assocaited with this tag
|
||||
/// </summary>
|
||||
public List<BlogPostTag> BlogPostTags { get; set; } = [];
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return Name;
|
||||
}
|
||||
}
|
||||
26
OpenArchival.DataAccess/Models/SearchPageSliderEntry.cs
Normal file
26
OpenArchival.DataAccess/Models/SearchPageSliderEntry.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace OpenArchival.DataAccess;
|
||||
|
||||
/// <summary>
|
||||
/// Used to display sliders of featured artifacts on the search page before a search is entered.
|
||||
/// </summary>
|
||||
public class SearchPageSliderEntry
|
||||
{
|
||||
[Key]
|
||||
public int Id { get; set; }
|
||||
|
||||
public string Title { get; set; } = "";
|
||||
|
||||
public string Description { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// The tags used to find artifacts for the slider
|
||||
/// </summary>
|
||||
public List<ArtifactEntryTag> FilterTags { get; set; } = [];
|
||||
|
||||
/// <summary>
|
||||
/// The maximum number of artifact entries that should be pulled for this slider
|
||||
/// </summary>
|
||||
public int MaxCount { get; set; } = 10;
|
||||
}
|
||||
Reference in New Issue
Block a user