2020-12-16 09:15:33 +01:00
|
|
|
@model (Dictionary<string, object> Items, int Level)
|
2019-01-26 05:26:49 +01:00
|
|
|
|
2021-08-20 14:59:31 +02:00
|
|
|
<table class="table table-hover table-responsive-md removetopborder">
|
2020-12-16 09:15:33 +01:00
|
|
|
@foreach (var (key, value) in Model.Items)
|
2019-01-26 05:26:49 +01:00
|
|
|
{
|
|
|
|
<tr>
|
2021-09-10 00:08:38 +09:00
|
|
|
@if (value is string str)
|
2019-01-26 05:26:49 +01:00
|
|
|
{
|
2020-12-16 09:15:33 +01:00
|
|
|
if (!string.IsNullOrEmpty(key))
|
|
|
|
{
|
|
|
|
<th class="w-150px">@key</th>
|
|
|
|
}
|
2019-01-26 05:26:49 +01:00
|
|
|
<td>
|
2021-09-10 00:08:38 +09:00
|
|
|
@if (str.StartsWith("http"))
|
|
|
|
{
|
|
|
|
<a href="@str" target="_blank" rel="noreferrer noopener">@str</a>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@value
|
|
|
|
}
|
2019-01-26 05:26:49 +01:00
|
|
|
</td>
|
|
|
|
}
|
2020-12-16 09:15:33 +01:00
|
|
|
else if (value is Dictionary<string, object>subItems)
|
2019-01-26 05:26:49 +01:00
|
|
|
{
|
2020-12-16 09:15:33 +01:00
|
|
|
@* This is the array case *@
|
2021-09-10 00:08:38 +09:00
|
|
|
if (subItems.Count == 1 && subItems.First().Value is string str2)
|
2020-12-16 09:15:33 +01:00
|
|
|
{
|
|
|
|
<th class="w-150px">@key</th>
|
|
|
|
<td>
|
2021-09-10 00:08:38 +09:00
|
|
|
@if (str2.StartsWith("http"))
|
|
|
|
{
|
|
|
|
<a href="@str2" target="_blank" rel="noreferrer noopener">@str2</a>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
@subItems.First().Value
|
|
|
|
}
|
2020-12-16 09:15:33 +01:00
|
|
|
</td>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<td colspan="2">
|
|
|
|
@Html.Raw($"<h{Model.Level + 3} class='mt-3'>{key}</h{Model.Level + 3}>")
|
|
|
|
<partial name="PosData" model="(subItems, Model.Level + 1)"/>
|
|
|
|
</td>
|
|
|
|
}
|
2019-01-26 05:26:49 +01:00
|
|
|
}
|
|
|
|
</tr>
|
|
|
|
}
|
|
|
|
</table>
|
2020-12-16 09:15:33 +01:00
|
|
|
|