diff --git a/DiscImageChef.Server/Areas/Admin/Views/MmcSds/Details.cshtml b/DiscImageChef.Server/Areas/Admin/Views/MmcSds/Details.cshtml index 46e369e2..deea9385 100644 --- a/DiscImageChef.Server/Areas/Admin/Views/MmcSds/Details.cshtml +++ b/DiscImageChef.Server/Areas/Admin/Views/MmcSds/Details.cshtml @@ -1,3 +1,5 @@ +@using DiscImageChef.Decoders.SecureDigital +@using DiscImageChef.Server.Core @model DiscImageChef.CommonTypes.Metadata.MmcSd @{ @@ -37,36 +39,83 @@

MmcSd


-
- @Html.DisplayNameFor(model => model.CID) -
-
- @Html.DisplayFor(model => model.CID) -
-
- @Html.DisplayNameFor(model => model.CSD) -
-
- @Html.DisplayFor(model => model.CSD) -
-
- @Html.DisplayNameFor(model => model.OCR) -
-
- @Html.DisplayFor(model => model.OCR) -
-
- @Html.DisplayNameFor(model => model.SCR) -
-
- @Html.DisplayFor(model => model.SCR) -
-
- @Html.DisplayNameFor(model => model.ExtendedCSD) -
-
- @Html.DisplayFor(model => model.ExtendedCSD) -
+ @if (Model.SCR != null) + { + if (Model.CID != null) + { +
+ @Html.DisplayNameFor(model => model.CID) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyCID(Model.CID))) +
+ } + if (Model.CSD != null) + { +
+ @Html.DisplayNameFor(model => model.CSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyCSD(Model.CSD))) +
+ } + if (Model.OCR != null) + { +
+ @Html.DisplayNameFor(model => model.OCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifyOCR(Model.OCR))) +
+ } + +
+ @Html.DisplayNameFor(model => model.SCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(Decoders.PrettifySCR(Model.SCR))) +
+ } + else + { + if (Model.CID != null) + { +
+ @Html.DisplayNameFor(model => model.CID) +
+
+ @Html.Raw(Html.EncodedMultiLineText(DiscImageChef.Decoders.MMC.Decoders.PrettifyCID(Model.CID))) +
+ } + if (Model.CSD != null) + { +
+ @Html.DisplayNameFor(model => model.CSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(DiscImageChef.Decoders.MMC.Decoders.PrettifyCSD(Model.CSD))) +
+ } + if (Model.OCR != null) + { +
+ @Html.DisplayNameFor(model => model.OCR) +
+
+ @Html.Raw(Html.EncodedMultiLineText(DiscImageChef.Decoders.MMC.Decoders.PrettifyOCR(Model.OCR))) +
+ } + + if (Model.ExtendedCSD != null) + { +
+ @Html.DisplayNameFor(model => model.ExtendedCSD) +
+
+ @Html.Raw(Html.EncodedMultiLineText(DiscImageChef.Decoders.MMC.Decoders.PrettifyExtendedCSD(Model.ExtendedCSD))) +
+ } + }
diff --git a/DiscImageChef.Server/Core/HtmlHelpers.cs b/DiscImageChef.Server/Core/HtmlHelpers.cs index 78413fa8..30fab4f5 100644 --- a/DiscImageChef.Server/Core/HtmlHelpers.cs +++ b/DiscImageChef.Server/Core/HtmlHelpers.cs @@ -13,5 +13,9 @@ namespace DiscImageChef.Server.Core public static string EncodedMultiLineText(this IHtmlHelper helper, string text) => string.IsNullOrEmpty(text) ? string.Empty : Regex.Replace(helper.Encode(text), " | | ", "
"); + + public static string EncodedMultiLineText(this IHtmlHelper helper, string text) => + string.IsNullOrEmpty(text) ? string.Empty + : Regex.Replace(helper.Encode(text), " | | ", "
"); } } \ No newline at end of file