Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Foundation/Features/Blog/BlogListPage/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
</div>
<div id="blog-list">
@Html.Partial("_BlogList", Model)
@Html.Partial("_Paging", Model)
</div>
</div>
</div>
228 changes: 0 additions & 228 deletions src/Foundation/Features/Blog/BlogListPage/Preview.cshtml

This file was deleted.

103 changes: 32 additions & 71 deletions src/Foundation/Features/Blog/BlogListPage/_BlogList.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,88 +4,49 @@

@model BlogListPageViewModel

@if (string.IsNullOrEmpty(Model.CurrentContent.Template) || Model.CurrentContent.Template == TemplateSelections.Grid)
@if (string.IsNullOrEmpty(Model.CurrentContent.Template))
{
@Html.Partial("_GridTemplate", Model)
Model.CurrentContent.Template = TemplateSelections.Grid;
}

@if (Model.CurrentContent.Template == TemplateSelections.Card)
@switch(Model.CurrentContent.Template)
{
<div class="row jsBlogListLoadMore">
case TemplateSelections.Grid:
@Html.Partial("_GridTemplate", Model)
break;

case TemplateSelections.Card:
@Html.Partial("_CardTemplate", Model)
</div>
}
break;

@if (Model.CurrentContent.Template == TemplateSelections.Insight)
{
<div class="row jsBlogListLoadMore">
case TemplateSelections.Insight:
@Html.Partial("_InsightTemplate", Model)
</div>
}
break;

@if (Model.CurrentContent.Template == TemplateSelections.ImageLeft)
{
if (Model.Blogs != null && Model.Blogs.Any())
{
foreach (var blog in Model.Blogs)
{
@Html.Partial("Preview", blog)
}
}
}
case TemplateSelections.ImageLeft:
@Html.Partial("_ImageLeftTemplate", Model)
break;

@if (Model.CurrentContent.Template == TemplateSelections.ImageTop || Model.CurrentContent.Template == TemplateSelections.NoImage)
{
if (Model.Blogs != null && Model.Blogs.Any())
{
<div class="row">
@foreach (var blog in Model.Blogs)
{
@Html.Partial("Preview", blog)
}
</div>
}
}
case TemplateSelections.ImageTop:
@Html.Partial("_ImageTopTemplate", Model)
break;

@if (Model.CurrentContent.Template == TemplateSelections.Highlight)
{
if (Model.Blogs != null && Model.Blogs.Any())
{
var flip = false;
foreach (var blog in Model.Blogs)
case TemplateSelections.NoImage:
@Html.Partial("_NoImageTemplate", Model)
break;

case TemplateSelections.Highlight:
if (Model.Blogs != null && Model.Blogs.Any())
{
@Html.Partial("Preview", blog, new ViewDataDictionary { { "Flip", flip } })
if (!blog.CurrentContent.Highlight)
var flip = false;
foreach (var blog in Model.Blogs)
{
flip = !flip;
@Html.Partial("_HighLightTemplate", blog, new ViewDataDictionary { { "Flip", flip } })
if (!blog.CurrentContent.Highlight)
{
flip = !flip;
}
}
}
}
}

@* Paging *@

@using (Html.BeginForm("BlogListBlock", "Test", FormMethod.Get, new { id = "jsGetBlogItemListPage" }))
{
<input hidden id="RequestUrl" type="text" value="/BlogListPage/GetItemList" />
<input hidden id="PageId" name="PageId" type="text" value="@Model.PagingInfo.PageId" />
<input hidden id="PageNumber" name="PageNumber" type="text" value="@Model.PagingInfo.PageNumber" />
<input hidden id="PageSize" name="PageSize" type="text" value="@Model.PagingInfo.PageSize" />
}

@if (Model.CurrentContent.Template == TemplateSelections.Card || Model.CurrentContent.Template == TemplateSelections.Insight)
{
<div class="flex-center jsLoadMoreDiv">
<button class="button-transparent-black @(Model.PagingInfo.PageCount <= Model.PagingInfo.PageNumber ? "" : "jsLoadMoreBlogs")"
pageNumber="@Model.PagingInfo.PageNumber"
pageId="@Model.PagingInfo.PageId"
pageCount="@Model.PagingInfo.PageCount"
@(Model.PagingInfo.PageCount <= Model.PagingInfo.PageNumber ? "disabled" : "")>
@(Model.PagingInfo.PageCount <= Model.PagingInfo.PageNumber ? "No More" : "Load More")
</button>
</div>
}
else
{
@Html.Partial("_Paging", Model)
break;
}
Loading