From 68b2ef1e0c458efd1792c5afe6e8d2a48c62c512 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 23 Jan 2015 02:03:27 -0800 Subject: [PATCH] webdav portal fixes --- .../Content/Site.css | 10 +++++-- .../Controllers/FileSystemController.cs | 18 ++--------- .../Models/Common/BaseModel.cs | 10 +++++++ .../appScripts/recalculateResourseHeight.js | 4 +++ .../Views/FileSystem/_ResoursePartial.cshtml | 30 ++++++++++--------- 5 files changed, 41 insertions(+), 31 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css index 93f07e0f..3aa327b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css @@ -29,14 +29,20 @@ textarea { cursor: pointer; } -.selected-file { +.element-container .element { + position: relative; + text-align:center; +} + +.selected-file .element { + position: relative; box-sizing:border-box; -moz-box-sizing:border-box; -webkit-box-sizing:border-box; border: 1px solid rgb(80, 152, 249); } -.selected-file div.selected-element-overlay { +.selected-file .element div.selected-element-overlay { position:absolute; top:0px; left: 0px; diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs index 1d7f9187..65d352e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs @@ -133,11 +133,7 @@ namespace WebsitePanel.WebDavPortal.Controllers if (filePathes == null) { - model.Messages.Add(new Message - { - Type = MessageType.Error, - Value = Resources.NoFilesAreSelected - }); + model.AddMessage(MessageType.Error, Resources.NoFilesAreSelected); return Json(model); } @@ -152,21 +148,13 @@ namespace WebsitePanel.WebDavPortal.Controllers } catch (WebDavException exception) { - model.Messages.Add(new Message - { - Type = MessageType.Error, - Value = exception.Message - }); + model.AddMessage(MessageType.Error, exception.Message); } } if (model.DeletedFiles.Any()) { - model.Messages.Insert(0, new Message - { - Type = MessageType.Success, - Value = string.Format(Resources.ItemsWasRemovedFormat, model.DeletedFiles.Count) - }); + model.AddMessage(MessageType.Success, string.Format(Resources.ItemsWasRemovedFormat, model.DeletedFiles.Count)); } return Json(model); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs index 24c96da1..7622e201 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Web.Mvc; +using WebsitePanel.WebDavPortal.Models.Common.Enums; namespace WebsitePanel.WebDavPortal.Models.Common { @@ -11,5 +12,14 @@ namespace WebsitePanel.WebDavPortal.Models.Common } public List Messages { get; private set; } + + public void AddMessage(MessageType type, string value) + { + Messages.Add(new Message + { + Type =type, + Value = value + }); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/recalculateResourseHeight.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/recalculateResourseHeight.js index 907b7c83..3dada550 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/recalculateResourseHeight.js +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/recalculateResourseHeight.js @@ -6,6 +6,10 @@ maxHeight = Math.max.apply(null, heights); + if (maxHeight < 135) { + maxHeight = 135; + } + $(".element-container").height(maxHeight); }); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml index bb65d42c..d4085c01 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml @@ -39,22 +39,24 @@ }
- - - -

@name

-
+
+ - @if (showStatistic) - { -
-
-

@percent%

+ +

@name

+
+ + @if (showStatistic) + { +
+
+

@percent%

+
+

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

+ } + +
-

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

- } - -
\ No newline at end of file