aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarcinzelent <marcin@zelent.net>2017-05-04 10:46:54 +0200
committermarcinzelent <marcin@zelent.net>2017-05-04 10:46:54 +0200
commit5a64086e866db65a1c023b04cb57cd936aa3e55e (patch)
tree229d683da0f1f24bb71ea372ed4a6053a4a65c36 /ApartmentManager/HousingWebApi-fix/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml
parentbb023f7e5d86060c6d7e8a51709ccdafb6000e37 (diff)
Fix duplicated directories.
Diffstat (limited to 'ApartmentManager/HousingWebApi-fix/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml')
-rw-r--r--ApartmentManager/HousingWebApi-fix/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml30
1 files changed, 30 insertions, 0 deletions
diff --git a/ApartmentManager/HousingWebApi-fix/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml b/ApartmentManager/HousingWebApi-fix/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml
new file mode 100644
index 0000000..c19596f
--- /dev/null
+++ b/ApartmentManager/HousingWebApi-fix/Areas/HelpPage/Views/Help/DisplayTemplates/Samples.cshtml
@@ -0,0 +1,30 @@
+@using System.Net.Http.Headers
+@model Dictionary<MediaTypeHeaderValue, object>
+
+@{
+ // Group the samples into a single tab if they are the same.
+ Dictionary<string, object> samples = Model.GroupBy(pair => pair.Value).ToDictionary(
+ pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()),
+ pair => pair.Key);
+ var mediaTypes = samples.Keys;
+}
+<div>
+ @foreach (var mediaType in mediaTypes)
+ {
+ <h4 class="sample-header">@mediaType</h4>
+ <div class="sample-content">
+ <span><b>Sample:</b></span>
+ @{
+ var sample = samples[mediaType];
+ if (sample == null)
+ {
+ <p>Sample not available.</p>
+ }
+ else
+ {
+ @Html.DisplayFor(s => sample);
+ }
+ }
+ </div>
+ }
+</div> \ No newline at end of file