mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-30 09:45:32 +00:00
Added a lot of stuff
This commit is contained in:
@@ -1,20 +1,56 @@
|
||||
namespace HaWeb.Models;
|
||||
using System.Web;
|
||||
|
||||
public class RegisterViewModel {
|
||||
public class RegisterViewModel
|
||||
{
|
||||
public string Category { get; private set; }
|
||||
public string Id { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
public string Title { get; private set; }
|
||||
|
||||
private List<(string, string)>? _AvailableCategories;
|
||||
private List<(string, string)>? _AvailableSideCategories;
|
||||
|
||||
public string? Search { get; set; } = null;
|
||||
public bool? MaxSearch { get; set; } = null;
|
||||
public List<CommentModel> ParsedComments { get; private set; }
|
||||
public List<(string, string)>? AvailableCategories { get; set; } = null;
|
||||
public List<(string, string)>? AvailableSideCategories { get; set; } = null;
|
||||
|
||||
public RegisterViewModel(string category, string id, List<CommentModel> parsedComments, string title) {
|
||||
this.Category = category;
|
||||
this.Id = id;
|
||||
// Title, URL
|
||||
public List<(string, string)>? AvailableCategories
|
||||
{
|
||||
get => _AvailableCategories;
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
_AvailableCategories = value.Select(x => (
|
||||
HttpUtility.HtmlEncode(x.Item1),
|
||||
HttpUtility.HtmlAttributeEncode(x.Item2))
|
||||
).ToList();
|
||||
else
|
||||
_AvailableCategories = null;
|
||||
}
|
||||
}
|
||||
|
||||
// Title, URL
|
||||
public List<(string, string)>? AvailableSideCategories
|
||||
{
|
||||
get => _AvailableSideCategories;
|
||||
set
|
||||
{
|
||||
if (value != null)
|
||||
_AvailableSideCategories = value.Select(x => (
|
||||
HttpUtility.HtmlEncode(x.Item1),
|
||||
HttpUtility.HtmlAttributeEncode(x.Item2))
|
||||
).ToList();
|
||||
else
|
||||
_AvailableSideCategories = null;
|
||||
}
|
||||
}
|
||||
|
||||
public RegisterViewModel(string category, string id, List<CommentModel> parsedComments, string title)
|
||||
{
|
||||
this.Category = HttpUtility.HtmlAttributeEncode(category);
|
||||
this.Id = HttpUtility.HtmlAttributeEncode(id);
|
||||
this.ParsedComments = parsedComments;
|
||||
this.Title = title;
|
||||
this.Title = HttpUtility.HtmlEncode(title);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user