Fixing that container pager shape was not displayed

--HG--
branch : 1.x
extra : rebase_source : 80295bb54f53c656d8da9113f4dfcb43d2040fe9
This commit is contained in:
piedone@pyrocenter.hu
2011-11-27 22:50:16 +01:00
parent a6f5f8ad21
commit 77656edc7f
4 changed files with 19 additions and 7 deletions

View File

@@ -68,17 +68,20 @@ namespace Orchard.Core.Containers.Drivers {
? pager.PageSize
: part.PageSize;
// var pagerShape = _shapeFactory.Pager(pager).TotalItemCount(query.Count());
var pagerShape = shapeHelper.Pager(pager).TotalItemCount(query.Count());
var startIndex = part.Paginated ? pager.GetStartIndex() : 0;
var pageOfItems = query.Slice(startIndex, pager.PageSize).ToList();
var list = _shapeFactory.List();
list.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary")));
list.Classes.Add("content-items");
list.Classes.Add("list-items");
var listShape = shapeHelper.List();
listShape.AddRange(pageOfItems.Select(item => _contentManager.BuildDisplay(item, "Summary")));
listShape.Classes.Add("content-items");
listShape.Classes.Add("list-items");
return list;
return shapeHelper.Parts_Container_Contained(
List: listShape,
Pager: pagerShape
);
}),
ContentShape("Parts_Container_Contained_Summary",
() => shapeHelper.Parts_Container_Contained_Summary(ContentPart: part)),

View File

@@ -0,0 +1,3 @@
@Display(Model.List)
@Display(Model.Pager)

View File

@@ -490,6 +490,9 @@
<ItemGroup>
<Content Include="Shapes\Views\ErrorPage.cshtml" />
</ItemGroup>
<ItemGroup>
<None Include="Containers\Views\Parts.Container.Contained.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.