diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs index 830bccab..83d68d90 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs @@ -145,6 +145,7 @@ namespace WebsitePanel.Providers.OS } public string RelativeUrl { get; set; } + public string Summary { get; set; } public string DriveLetter { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs index e5ff425c..b2eed0b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs @@ -304,7 +304,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage var rootFolder = Path.Combine(settings.LocationDrive + ":\\", settings.HomeFolder); rootFolder = Path.Combine(rootFolder, organizationId); - var wsSql = string.Format(@"SELECT System.FileName, System.DateModified, System.Size, System.Kind, System.ItemPathDisplay, System.ItemType FROM SYSTEMINDEX WHERE System.FileName LIKE '%{0}%' AND ({1})", + var wsSql = string.Format(@"SELECT System.FileName, System.DateModified, System.Size, System.Kind, System.ItemPathDisplay, System.ItemType, System.Search.AutoSummary FROM SYSTEMINDEX WHERE System.FileName LIKE '%{0}%' AND ({1})", searchText, string.Join(" OR ", searchPaths.Select(x => string.Format("{0} = '{1}'", recursive ? "SCOPE" : "DIRECTORY", Path.Combine(rootFolder, x))).ToArray())); conn.Open(); @@ -318,7 +318,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage var file = new SystemFile {Name = reader[0] as string}; file.Changed = file.CreatedDate = reader[1] is DateTime ? (DateTime)reader[1] : new DateTime(); - file.Size = reader[2] is long ? (long) reader[2] : 0; + file.Size = reader[2] is Decimal ? Convert.ToInt64((Decimal) reader[2]) : 0; var kind = reader[3] is IEnumerable ? ((IEnumerable)reader[3]).Cast().ToList() : null; var itemType = reader[5] as string ?? string.Empty; @@ -342,6 +342,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage } } + file.Summary = reader[6] as string; + result.Add(file); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Extensions/UriExtensions.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Extensions/UriExtensions.cs index 3f6bd4c6..8ba4aeeb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Extensions/UriExtensions.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Extensions/UriExtensions.cs @@ -3,7 +3,7 @@ using System.Linq; namespace WebsitePanel.WebDav.Core.Extensions { - static class UriExtensions + public static class UriExtensions { public static Uri Append(this Uri uri, params string[] paths) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IItemContent.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IItemContent.cs index 399aeba0..681efa2e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IItemContent.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IItemContent.cs @@ -9,6 +9,7 @@ namespace WebsitePanel.WebDav.Core long ContentLength { get; } long AllocatedSpace { get; set; } string ContentType { get; } + string Summary { get; set; } void Download(string filename); byte[] Download(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IResource.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IResource.cs index 34f4f81a..1a099ebf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IResource.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/IResource.cs @@ -89,6 +89,8 @@ namespace WebsitePanel.WebDav.Core } } + public string Summary { get; set; } + /// /// Downloads content of the resource to a file specified by filename /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Managers/IWebDavManager.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Managers/IWebDavManager.cs index fd1fdc3a..bf634dd8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Managers/IWebDavManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Managers/IWebDavManager.cs @@ -19,5 +19,6 @@ namespace WebsitePanel.WebDav.Core.Interfaces.Managers string GetFileUrl(string path); void DeleteResource(string path); void LockFile(string path); + string GetFileFolderPath(string path); } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs index 4d1ab904..d3f837a7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs @@ -103,7 +103,7 @@ namespace WebsitePanel.WebDav.Core.Managers public bool IsFile(string path) { - string folder = GetFileFolder(path); + string folder = GetFileFolderPath(path); if (string.IsNullOrWhiteSpace(folder)) { @@ -124,7 +124,7 @@ namespace WebsitePanel.WebDav.Core.Managers { try { - string folder = GetFileFolder(path); + string folder = GetFileFolderPath(path); var resourceName = GetResourceName(path); @@ -212,7 +212,7 @@ namespace WebsitePanel.WebDav.Core.Managers path = RemoveLeadingFromPath(path, "edit"); path = RemoveLeadingFromPath(path, WspContext.User.OrganizationId); - string folderPath = GetFileFolder(path); + string folderPath = GetFileFolderPath(path); OpenFolder(folderPath); @@ -232,7 +232,7 @@ namespace WebsitePanel.WebDav.Core.Managers { try { - string folder = GetFileFolder(path); + string folder = GetFileFolderPath(path); var resourceName = GetResourceName(path); @@ -250,7 +250,7 @@ namespace WebsitePanel.WebDav.Core.Managers { try { - string folder = GetFileFolder(path); + string folder = GetFileFolderPath(path); var resourceName = GetResourceName(path); @@ -270,7 +270,7 @@ namespace WebsitePanel.WebDav.Core.Managers { try { - string folder = GetFileFolder(path); + string folder = GetFileFolderPath(path); var resourceName = GetResourceName(path); @@ -345,6 +345,7 @@ namespace WebsitePanel.WebDav.Core.Managers webDavitem.SetLastModified(file.Changed); webDavitem.ContentLength = file.Size; webDavitem.AllocatedSpace = file.FRSMQuotaMB; + webDavitem.Summary = file.Summary; convertResult.Add(webDavitem); } @@ -372,7 +373,7 @@ namespace WebsitePanel.WebDav.Core.Managers targetStream.Write(buffer, 0, n); } - private string GetFileFolder(string path) + public string GetFileFolderPath(string path) { path = path.TrimEnd('/'); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs index 1a5981a4..a5dc75e8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs @@ -46,6 +46,18 @@ namespace WebsitePanel.WebDavPortal #region Enterprise storage + routes.MapRoute( + name: FileSystemRouteNames.SearchFiles, + url: "storage/search/{org}/{*pathPart}", + defaults: new { controller = "FileSystem", action = "SearchFiles", pathPart = UrlParameter.Optional } + ); + + routes.MapRoute( + name: FileSystemRouteNames.SearchFilesContent, + url: "storage/ajax/search/{org}/{*pathPart}", + defaults: new { controller = "FileSystem", action = "SearchFilesContent", pathPart = UrlParameter.Optional } + ); + routes.MapRoute( name: FileSystemRouteNames.ChangeWebDavViewType, url: "storage/change-view-type/{viewType}", diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/FileSystemRouteNames.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/FileSystemRouteNames.cs index 23ac46e2..9a6832b2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/FileSystemRouteNames.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/FileSystemRouteNames.cs @@ -21,5 +21,8 @@ namespace WebsitePanel.WebDavPortal.UI.Routes public const string DeleteFiles = "DeleteFilesRoute"; public const string DownloadFile = "DownloadFileRoute"; + + public const string SearchFiles = "SearchFilesRoute"; + public const string SearchFilesContent = "SearchFilesPostRoute"; } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css index 9137665c..988dabfa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css @@ -60,6 +60,17 @@ tr.selected-file { .table-icon { height: 30px; + vertical-align: top; +} + +.column-name .file-info { + display: inline-block; + padding-left: 5px; + width: 90%; +} + +.table-icon.search { + height: 45px; } .noselect { @@ -77,6 +88,8 @@ tr.selected-file { #webdav-items-table .file-link { padding-left: 5px; + padding-top: 5px; + display: inline-block; vertical-align: middle !important; } @@ -86,6 +99,11 @@ tr.selected-file { height: 32px; } +#summary.summary { + font-size: 11px; + color: rgb(152, 152, 152); +} + .drag-and-drop-area input { /* IE 8 */ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; @@ -252,16 +270,29 @@ tr.selected-file { width: 200px; } -.search-block { - float: right; +.breadcrumb-wsp { + display: inline-block; + padding-top: 5px; } -.search-block input, .search-block label { +.search-block { + float: right; + margin-right: 10px !important; + width: 36%; +} + +.search-block input{ + display: inline-block; + font-weight: normal; +} + +.search-block label { display: inline-block; width: initial; font-weight: normal; } + .elements-container { padding-top: 10px; } @@ -371,4 +402,10 @@ div#breadcrumb_wrapper a:last-child { .header-portal-title { float: none; display: inline-block; +} + +@media (min-width: 768px) { + .navbar-right { + margin-right: 0; + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs index 46beea31..9d4016e1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs @@ -35,6 +35,7 @@ using WebsitePanel.WebDavPortal.Models.Common.Enums; using WebsitePanel.WebDavPortal.Models.FileSystem; using WebsitePanel.WebDavPortal.UI; using WebsitePanel.WebDavPortal.UI.Routes; +using WebsitePanel.WebDav.Core.Extensions; namespace WebsitePanel.WebDavPortal.Controllers @@ -143,7 +144,6 @@ namespace WebsitePanel.WebDavPortal.Controllers } } - [HttpGet] public ActionResult GetContentDetails(string org, string pathPart, [ModelBinder(typeof (JqueryDataTableModelBinder))] JqueryDataTableRequest dtRequest) { @@ -160,7 +160,7 @@ namespace WebsitePanel.WebDavPortal.Controllers var tableItems = Mapper.Map, IEnumerable>(folderItems).ToList(); - FillContentModel(tableItems); + FillContentModel(tableItems, org); var orders = dtRequest.Orders.ToList(); orders.Insert(0, new JqueryDataTableOrder{Column = 3, Ascending = false}); @@ -184,6 +184,24 @@ namespace WebsitePanel.WebDavPortal.Controllers return PartialView("_ResourseCollectionPartial", result); } + public ActionResult SearchFiles(string org, string pathPart, string searchValue) + { + if (string.IsNullOrEmpty(searchValue)) + { + return RedirectToRoute(FileSystemRouteNames.ShowContentPath); + } + + var model = new ModelForWebDav + { + UrlSuffix = pathPart, + Permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, pathPart), + UserSettings = _userSettingsManager.GetUserSettings(WspContext.User.AccountId), + SearchValue = searchValue + }; + + return View("ShowContentSearchResultTable", model); + } + [HttpGet] public ActionResult DownloadFile(string org, string pathPart) { @@ -329,17 +347,17 @@ namespace WebsitePanel.WebDavPortal.Controllers } #endregion - private void FillContentModel(IEnumerable items) + private void FillContentModel(IEnumerable items, string organizationId) { foreach (var item in items) { var opener = _openerManager[Path.GetExtension(item.DisplayName)]; + var pathPart = item.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/'); switch (opener) { case FileOpenerType.OfficeOnline: { - var pathPart = item.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/'); item.Url = string.Concat(Url.RouteUrl(FileSystemRouteNames.EditOfficeOnline, new {org = WspContext.User.OrganizationId, pathPart = ""}), pathPart); break; } @@ -350,6 +368,11 @@ namespace WebsitePanel.WebDavPortal.Controllers } } + var folderPath = Server.UrlDecode(_webdavManager.GetFileFolderPath(pathPart)); + + item.FolderUrlAbsoluteString = Server.UrlDecode(Url.RouteUrl(FileSystemRouteNames.ShowContentPath, new {org = organizationId, pathPart = folderPath}, Request.Url.Scheme)); + item.FolderUrlLocalString = Url.RouteUrl(FileSystemRouteNames.ShowContentPath, new { org = organizationId, pathPart = folderPath }); + if (Request.Browser.IsMobileDevice) { item.IsTargetBlank = false; diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs index cc712682..17d1b07e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs @@ -45,6 +45,7 @@ namespace WebsitePanel.WebDavPortal.Mapping.Profiles.Webdav .ForMember(ti => ti.LastModified, x => x.MapFrom(hi => hi.LastModified)) .ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString("dd/MM/yyyy hh:mm tt"))) + .ForMember(ti => ti.Summary, x => x.MapFrom(hi => hi.Summary)) .ForMember(ti => ti.IsRoot, x => x.MapFrom(hi => hi.IsRootItem)) .ForMember(ti => ti.Size, x => x.MapFrom(hi => hi.ContentLength)) .ForMember(ti => ti.Quota, x => x.MapFrom(hi => hi.AllocatedSpace)) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/FileSystem/ResourceTableItemModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/FileSystem/ResourceTableItemModel.cs index 2d2121cf..bc605c28 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/FileSystem/ResourceTableItemModel.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/FileSystem/ResourceTableItemModel.cs @@ -18,7 +18,10 @@ namespace WebsitePanel.WebDavPortal.Models.FileSystem public DateTime LastModified { get; set; } public string LastModifiedFormated { get; set; } public string IconHref { get; set; } - + public string FolderUrlAbsoluteString { get; set; } + public string FolderUrlLocalString { get; set; } + public string FolderName { get; set; } + public string Summary { get; set; } public override dynamic this[int index] { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs index e3836593..0aa9d823 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs @@ -150,6 +150,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to File. + /// + public static string File { + get { + return ResourceManager.GetString("File", resourceCulture); + } + } + /// /// Looks up a localized string similar to File Upload. /// @@ -168,6 +177,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Info. + /// + public static string Info { + get { + return ResourceManager.GetString("Info", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} items was removed.. /// @@ -258,6 +276,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Search Documents. + /// + public static string SearchDocuments { + get { + return ResourceManager.GetString("SearchDocuments", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Search Results. + /// + public static string SearchResults { + get { + return ResourceManager.GetString("SearchResults", resourceCulture); + } + } + /// /// Looks up a localized string similar to Select files to upload. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx index 5cb4b1a3..7d3fbf56 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx @@ -147,12 +147,18 @@ Error + + File + File Upload Gb + + Info + {0} items was removed. @@ -183,6 +189,12 @@ Search + + Search Documents + + + Search Results + Select files to upload diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/authentication.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/authentication.js index 3752ad1e..35a5b8ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/authentication.js +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/authentication.js @@ -1,18 +1,19 @@ -function CheckAuthenticationExpiration(authcookieName, logoutUrl) { - var c = $.cookie(authcookieName); - +function CheckAuthenticationExpiration(authTimeOutCookieName, authCookieName, logoutUrl) { + var c = $.cookie(authTimeOutCookieName); + if (c != null && c != "" && !isNaN(c)) { var now = new Date(); var ms = parseInt(c, 10); var expiration = new Date().setTime(ms); if (now > expiration) { + $.removeCookie(authTimeOutCookieName, { path: '/' }); window.location.replace(logoutUrl); } } } -function StartAuthExpirationCheckTimer(authcookieName, logoutUrl) { +function StartAuthExpirationCheckTimer(authTimeOutCookieName, authCookieName, logoutUrl) { setInterval(function() { - CheckAuthenticationExpiration(authcookieName, logoutUrl); + CheckAuthenticationExpiration(authTimeOutCookieName, authCookieName, logoutUrl); }, 20000); } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/fileBrowsing.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/fileBrowsing.js index ec557926..f14edab4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/fileBrowsing.js +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/fileBrowsing.js @@ -1,6 +1,12 @@ function WspFileBrowser() { - this.settings = { deletionBlockSelector: ".file-actions-menu .file-deletion", deletionUrl: "storage/files-group-action/delete" }; - this.table = null; + this.settings = { + deletionBlockSelector: ".file-actions-menu .file-deletion", + deletionUrl: "storage/files-group-action/delete", + textDateModified: "Date modified", + textSize: "Size" + }; + this.itemsTable = null; + this.searchTable = null; } WspFileBrowser.prototype = { @@ -34,7 +40,8 @@ WspFileBrowser.prototype = { }).get(); }, - deleteSelectedItems: function(e) { + deleteSelectedItems: function (e) { + $.ajax({ type: 'POST', url: wsp.fileBrowser.settings.deletionUrl, @@ -45,7 +52,7 @@ WspFileBrowser.prototype = { wsp.fileBrowser.clearDeletedItems(model.DeletedFiles); wsp.fileBrowser.refreshDeletionBlock(); - wsp.fileBrowser.refreshDataTable(); + wsp.fileBrowser.refreshDataTable(wsp.fileBrowser.itemsTable); wsp.dialogs.hideProcessDialog(); }, @@ -53,7 +60,7 @@ WspFileBrowser.prototype = { wsp.messages.addErrorMessage(errorThrown); wsp.fileBrowser.refreshDeletionBlock(); - wsp.fileBrowser.refreshDataTable(); + wsp.fileBrowser.refreshDataTable(wsp.fileBrowser.itemsTable); wsp.dialogs.hideProcessDialog(); } @@ -79,10 +86,11 @@ WspFileBrowser.prototype = { }, initDataTable: function (tableId, ajaxUrl) { - this.table = $(tableId).dataTable({ + this.itemsTable = $(tableId).dataTable({ "ajax": ajaxUrl, "processing": false, "serverSide": true, + "dom": 'rtlp', "columnDefs": [ { "render": function(data, type, row) { @@ -128,18 +136,87 @@ WspFileBrowser.prototype = { $(tableId).removeClass('dataTable'); - var oTable = this.table; - $(tableId+'_filter input').unbind(); - $(tableId+'_filter input').bind('keyup', function (e) { - if (e.keyCode == 13) { - oTable.fnFilter(this.value); - } - }); + //var oTable = this.table; + + //$(searchInputId).bind('keyup', function (e) { + // if (e.keyCode == 13) { + // oTable.fnFilter(this.value); + // } + //}); + + //$(searchInputId).keydown(function (event) { + // if (event.keyCode == 13) { + // event.preventDefault(); + // return false; + // } + + // return true; + //}); + }, - refreshDataTable: function () { - if (this.table != null) { - this.table.fnDraw(false); + initSearchDataTable: function (tableId, ajaxUrl, initSearch) { + + var settings = this.settings; + var classThis = this; + + this.searchTable = $(tableId).dataTable({ + "ajax": ajaxUrl, + "processing": false, + "serverSide": true, + "oSearch": { "sSearch": initSearch }, + "dom": 'rtlp', + "columnDefs": [ + { + "render": function (data, type, row) { + return '
' + + '' + + '
' + + '' + + row.DisplayName + + '' + + '
' + (row.Summary ? (row.Summary + '').substring(0, 500) + '...' : '') + '
' + + '' + + '
' + + '
'; + }, + "targets": 0 + }, + { + "render": function (data, type, row) { + return '
' +settings.textDateModified+': '+ row.LastModifiedFormated+ '
' + + '
' + settings.textSize + ': ' + classThis.bytesToSize(row.Size) + '
'; + }, + "orderable": false, + "width": "25%", + "targets": 1 + } + ], + "createdRow": function (row, data, index) { + $(row).addClass('element-container'); + }, + "fnPreDrawCallback": function () { + // gather info to compose a message + wsp.dialogs.showProcessDialog(); + return true; + }, + "fnDrawCallback": function () { + // in case your overlay needs to be put away automatically you can put it here + wsp.dialogs.hideProcessDialog(); + } + }); + + $(tableId).removeClass('dataTable'); + + }, + + refreshDataTable: function (table) { + if (table != null) { + table.fnDraw(false); } }, diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContent.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContent.cshtml index b36be144..af490ffc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContent.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContent.cshtml @@ -53,9 +53,3 @@ else } } - -@section popups -{ - @Html.Partial("_ProcessDialog", null) - @Html.Partial("_ConfirmDialog") -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContentSearchResultTable.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContentSearchResultTable.cshtml new file mode 100644 index 00000000..f75107fc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/ShowContentSearchResultTable.cshtml @@ -0,0 +1,28 @@ +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.ModelForWebDav + + +@Html.Partial("_ShowContentTopMenu", Model) + +
+ + + + + + + +
@UI.File@UI.Details
+
+ +@section scripts +{ + +} + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentBigIcons.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentBigIcons.cshtml index e87f9c2d..8591768f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentBigIcons.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentBigIcons.cshtml @@ -3,21 +3,6 @@ @using WebsitePanel.WebDavPortal.UI.Routes @model WebsitePanel.WebDavPortal.Models.ModelForWebDav -
- - -
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTable.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTable.cshtml index 8aed098b..a729ca02 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTable.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTable.cshtml @@ -15,8 +15,3 @@
-@section popups -{ - @Html.Partial("_ProcessDialog", null) - @Html.Partial("_ConfirmDialog") -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTopMenu.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTopMenu.cshtml index 4a6089ff..0a31a28c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTopMenu.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ShowContentTopMenu.cshtml @@ -10,42 +10,69 @@ @if (Model != null) { string header = WspContext.User.OrganizationId; - @header string[] elements = Model.UrlSuffix.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < elements.Length; i++) - { - / - @elements[i] - } - } - -
- @if (Model.Permissions.HasFlag(WebDavPermissions.Write)) - { -
+ @Html.Partial("_ProcessDialog", null) + @Html.Partial("_ConfirmDialog") + @RenderSection("popups", required: false)
@@ -62,9 +65,9 @@ @Scripts.Render("~/bundles/authScripts") } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj index 9327be8f..6ccbc782 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj @@ -459,6 +459,7 @@ +