-
Notifications
You must be signed in to change notification settings - Fork 0
/
Complex_Tmpl.cshtml
33 lines (33 loc) · 1.27 KB
/
Complex_Tmpl.cshtml
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
@using Incoding.MvcContrib
@using Template.UI.Models
@using (var template = Html.Incoding().Template<ComplexVm>())
{
using (var each = template.ForEach())
{
<div>
<ul style="@each.IsInline(r => r.IsRed, "color:red;")">
@using (var countryEach = each.ForEach(r => r.Country))
{
<li>
@using (each.Up().Is(r => r.IsRed))
{
<span>Country @countryEach.For(r => r.Title) from red group @each.Up().For(r => r.Group)</span>
}
@using (each.Up().Not(r => r.IsRed))
{
<span>Country @countryEach.For(r => r.Title) by group @each.Up().For(r => r.Group)</span>
}
<dl>
@using (var cityEach = countryEach.ForEach(r => r.Cities))
{
<dd>
City: @cityEach.For(r => r.Name)
</dd>
}
</dl>
</li>
}
</ul>
</div>
}
}