Home reloaded
This commit is contained in:
@ -29,11 +29,11 @@ namespace Yavsc.Controllers
|
||||
DbContext = context;
|
||||
}
|
||||
|
||||
public IActionResult Index()
|
||||
public IActionResult Index(string id)
|
||||
{
|
||||
return View(DbContext.Activities.Include(a=>a.Forms).OrderByDescending(a=>a.Rate));
|
||||
return View(DbContext.Activities.Where(a=>a.ParentCode==id).Include(a=>a.Forms).Include(a=>a.Children)
|
||||
.OrderByDescending(a=>a.Rate));
|
||||
}
|
||||
|
||||
public IActionResult About()
|
||||
{
|
||||
return View();
|
||||
@ -45,7 +45,6 @@ namespace Yavsc.Controllers
|
||||
|
||||
public IActionResult Contact()
|
||||
{
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
|
@ -25,16 +25,28 @@
|
||||
<div class="@cls" style="background-image: url('@act.Photo'); background-repeat: no-repeat; ">
|
||||
<!-- <img src="@act.Photo" alt="@act.Name" class="img-responsive" /> -->
|
||||
<div class="carousel-caption-s" >
|
||||
|
||||
|
||||
@if (act.Children.Count>0) {
|
||||
<p><em><a asp-route-id="@act.Code">@act.Name</a></em><br/>
|
||||
@act.Description </p>
|
||||
<a asp-route-id="@act.Code">
|
||||
@foreach (var c in act.Children) {
|
||||
@(c.Name+" ")
|
||||
Html.DisplayFor(subact=>c);
|
||||
}
|
||||
</a>
|
||||
}
|
||||
else {
|
||||
<p><em>@act.Name</em><br/>
|
||||
@act.Description </p>
|
||||
|
||||
}
|
||||
|
||||
@foreach (var form in act.Forms) {
|
||||
<a class="btn btn-default" asp-controller="FrontOffice" asp-action="@form.Action" asp-route-id="@act.Code">
|
||||
@form.Title
|
||||
</a>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
i++; }
|
||||
|
@ -45,7 +45,7 @@
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
<a asp-controller="Home" asp-action="Index" class="navbar-brand">@SiteSettings.Value.Title</a>
|
||||
<a asp-controller="Home" asp-action="Index" asp-route-id="" class="navbar-brand">@SiteSettings.Value.Title</a>
|
||||
</div>
|
||||
<div class="navbar-collapse collapse">
|
||||
<ul class="nav navbar-nav">
|
||||
|
Reference in New Issue
Block a user