mirror of
https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
synced 2025-10-29 17:25:32 +00:00
50 lines
1.7 KiB
C#
50 lines
1.7 KiB
C#
namespace HaWeb.Models;
|
|
using System.Web;
|
|
|
|
public class RegisterViewModel {
|
|
public string Category { get; private set; }
|
|
public string Id { 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; }
|
|
|
|
// 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 = HttpUtility.HtmlEncode(title);
|
|
}
|
|
} |