public override void Layout() { set("adminUrl", to(new Admin.MyController().My)); set("photo.AppUrl", Link.To(new PhotoController().Index)); IBlock block = getBlock("list"); List <PhotoAlbum> albumList = albumService.GetListByApp(ctx.app.Id); foreach (PhotoAlbum album in albumList) { block.Set("category.Title", album.Name); block.Set("category.Url", Link.To(new PhotoController().Album, album.Id)); String coverImg = PhotoHelper.getCover(album); block.Set("category.Cover", coverImg); block.Next(); } bindComments("comment"); }
//--------------------------------------------------------------------------------------------------- private void bindAlbumList(List <PhotoAlbum> albumList) { IBlock block = getBlock("list"); foreach (PhotoAlbum album in albumList) { block.Set("album.Name", album.Name); block.Set("album.Link", to(Album, album.Id)); int dataCount = PhotoHelper.getDataCount(album); block.Set("album.DataCount", dataCount); block.Set("album.Updated", album.Created.ToShortDateString()); String desc = strUtil.HasText(album.Description) ? "<div>" + album.Description + "</div>" : ""; block.Set("album.Description", desc); String coverImg = PhotoHelper.getCover(album); block.Set("album.Cover", coverImg); block.Next(); } }