forked from vaishaksuresh/webdevchecklist.com
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_data.cshtml
More file actions
43 lines (37 loc) · 1.57 KB
/
_data.cshtml
File metadata and controls
43 lines (37 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
@using System.Xml
@{
XmlDocument doc = Checklist.GetXmlDocument(Request);
Page.BonusPoints = doc.SelectNodes("//rule[@optional]").Count;
}
@foreach (XmlNode node in doc.SelectNodes("//category"))
{
<section>
<h2>@node.Attributes["name"].InnerText</h2>
<ul>
@foreach (XmlNode item in node.SelectNodes("rule"))
{
HtmlString className = new HtmlString(item.Attributes["optional"] != null ? " class=\"optional\"" : null);
string name = item.Attributes["name"].InnerText;
string id = name.Replace(" ", string.Empty).ToLowerInvariant();
<li@className>
<input type="checkbox" id="@id" tabindex="1" />
<label for="@id">@name</label>
@{XmlNodeList links = item.SelectNodes("link");}
@if (links.Count > 0)
{
<em id="details-@id">◄</em>
<ul>
@foreach (XmlNode link in links)
{
<li>
<a href="@link.Attributes["url"].InnerText">@link.InnerText</a>
</li>
}
</ul>
}
</li>
}
</ul>
</section>
}
<p id="bonus">Optional: <mark aria-relevant="text" aria-live="polite">0</mark>/@Page.BonusPoints</p>