@using WebsitePanel.WebDav.Core @using WebsitePanel.WebDav.Core.Client @using WebsitePanel.WebDav.Core.Config @using WebsitePanel.WebDavPortal.FileOperations @using Ninject; @using WebsitePanel.WebDavPortal.UI @using WebsitePanel.WebDavPortal.UI.Routes @model IHierarchyItem @{ string actualPath = Model.ItemType == ItemType.Folder ? "~/Content/Images/folder_100x100.png" : WebDavAppConfigManager.Instance.FileIcons[Path.GetExtension(Model.DisplayName.Trim('/'))]; string name = Model.DisplayName.Trim('/'); var opener = new FileOpenerManager()[Path.GetExtension(Model.DisplayName)]; bool isTargetBlank; string href = "/"; switch (opener) { case FileOpenerType.OfficeOnline: isTargetBlank = true; var pathPart = Model.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/'); href = string.Concat(Url.RouteUrl(FileSystemRouteNames.ShowOfficeOnlinePath, new { org = WspContext.User.OrganizationId, pathPart = "" }), pathPart); break; default: isTargetBlank = false; href = Model.Href.LocalPath; break; } var resource = Model as IResource; bool showStatistic = Model.ItemType == ItemType.Folder && Model.IsRootItem && resource != null; int percent = 0; if (showStatistic) { percent = (int)(resource.AllocatedSpace != 0 ? 100 * resource.ContentLength / resource.AllocatedSpace : 0); } }

@name

@if (showStatistic) {

@percent%

@Math.Round(Convert.ToDecimal(resource.ContentLength) / 1024, 2) / @Math.Round(Convert.ToDecimal(resource.AllocatedSpace) / 1024, 2) @Resources.GigabyteShort

}