From 6b51a916858180ec6996aec756b442c876402c97 Mon Sep 17 00:00:00 2001 From: Jeff Leung Date: Sat, 10 Dec 2022 20:08:00 -0800 Subject: [PATCH] Implement tags since adding tags can crash the app on the netbox side --- .../Models/RouteTargets.cs | 12 +++++++++++- .../Views/Home/Index.cshtml | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/AS1024.CommunityDocumentationPage/Models/RouteTargets.cs b/AS1024.CommunityDocumentationPage/Models/RouteTargets.cs index 6f37637..c7d6f94 100644 --- a/AS1024.CommunityDocumentationPage/Models/RouteTargets.cs +++ b/AS1024.CommunityDocumentationPage/Models/RouteTargets.cs @@ -12,7 +12,7 @@ public string Name { get; set; } public string Tenant { get; set; } public string Description { get; set; } - public IList Tags { get; set; } + public IList Tags { get; set; } public CustomFields CustomFields { get; set; } public DateTime Created { get; set; } public DateTime LastUpdated { get; set; } @@ -25,4 +25,14 @@ public object Previous { get; set; } public IList Results { get; set; } } + + public class Tag + { + public int id { get; set; } + public string url { get; set; } + public string display { get; set; } + public string name { get; set; } + public string slug { get; set; } + public string color { get; set; } + } } diff --git a/AS1024.CommunityDocumentationPage/Views/Home/Index.cshtml b/AS1024.CommunityDocumentationPage/Views/Home/Index.cshtml index e80686a..609f7af 100644 --- a/AS1024.CommunityDocumentationPage/Views/Home/Index.cshtml +++ b/AS1024.CommunityDocumentationPage/Views/Home/Index.cshtml @@ -13,12 +13,18 @@ Community Tag Description + Community Type @foreach (var item in Model) { @item.Name @item.Description + + @foreach (var tags in item.Tags) { +
@tags.display
+ } + } \ No newline at end of file