Merge
This commit is contained in:
commit
92ba95648f
38 changed files with 828 additions and 401 deletions
|
@ -383,7 +383,8 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
foreach (var item in items)
|
||||
{
|
||||
var opener = _openerManager[Path.GetExtension(item.DisplayName)];
|
||||
var pathPart = item.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||
//var pathPart = item.Href.ToString().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||
var pathPart = item.Href.ToStringPath().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||
|
||||
switch (opener)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace WebsitePanel.WebDavPortal.Helpers
|
||||
{
|
||||
public class ViewDataHelper
|
||||
{
|
||||
public static string BytesToSize(long bytes)
|
||||
{
|
||||
if (bytes == 0)
|
||||
{
|
||||
return string.Format("0 {0}", Resources.UI.Byte);
|
||||
}
|
||||
|
||||
var k = 1024;
|
||||
|
||||
var sizes = new[]
|
||||
{
|
||||
Resources.UI.Bytes,
|
||||
Resources.UI.KilobyteShort,
|
||||
Resources.UI.MegabyteShort,
|
||||
Resources.UI.GigabyteShort,
|
||||
Resources.UI.TerabyteShort,
|
||||
Resources.UI.PetabyteShort,
|
||||
Resources.UI.ExabyteShort
|
||||
};
|
||||
|
||||
var i = (int) Math.Floor(Math.Log(bytes)/Math.Log(k));
|
||||
return string.Format("{0} {1}", Math.Round(bytes/Math.Pow(k, i), 3), sizes[i]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -69,6 +69,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Byte.
|
||||
/// </summary>
|
||||
public static string Byte {
|
||||
get {
|
||||
return ResourceManager.GetString("Byte", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bytes.
|
||||
/// </summary>
|
||||
public static string Bytes {
|
||||
get {
|
||||
return ResourceManager.GetString("Bytes", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
|
@ -105,15 +123,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create.
|
||||
/// </summary>
|
||||
public static string Create {
|
||||
get {
|
||||
return ResourceManager.GetString("Create", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Delete.
|
||||
/// </summary>
|
||||
|
@ -150,15 +159,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Enter file name.
|
||||
/// </summary>
|
||||
public static string EnterFileName {
|
||||
get {
|
||||
return ResourceManager.GetString("EnterFileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error.
|
||||
/// </summary>
|
||||
|
@ -169,11 +169,11 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Excel workbook.
|
||||
/// Looks up a localized string similar to EB.
|
||||
/// </summary>
|
||||
public static string ExcelWorkbook {
|
||||
public static string ExabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("ExcelWorkbook", resourceCulture);
|
||||
return ResourceManager.GetString("ExabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -186,24 +186,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File name.
|
||||
/// </summary>
|
||||
public static string FileName {
|
||||
get {
|
||||
return ResourceManager.GetString("FileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File extension will be added automatically.
|
||||
/// </summary>
|
||||
public static string FileNameExtensionHint {
|
||||
get {
|
||||
return ResourceManager.GetString("FileNameExtensionHint", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File Upload.
|
||||
/// </summary>
|
||||
|
@ -231,15 +213,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File already exist.
|
||||
/// </summary>
|
||||
public static string ItemExist {
|
||||
get {
|
||||
return ResourceManager.GetString("ItemExist", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} items was removed..
|
||||
/// </summary>
|
||||
|
@ -249,6 +222,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to KB.
|
||||
/// </summary>
|
||||
public static string KilobyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("KilobyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to MB.
|
||||
/// </summary>
|
||||
public static string MegabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("MegabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Modified.
|
||||
/// </summary>
|
||||
|
@ -294,6 +285,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to PB.
|
||||
/// </summary>
|
||||
public static string PetabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("PetabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please wait....
|
||||
/// </summary>
|
||||
|
@ -303,15 +303,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Powerpoint presentation.
|
||||
/// </summary>
|
||||
public static string PowerPointPresentation {
|
||||
get {
|
||||
return ResourceManager.GetString("PowerPointPresentation", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Processing.
|
||||
/// </summary>
|
||||
|
@ -384,6 +375,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to TB.
|
||||
/// </summary>
|
||||
public static string TerabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("TerabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Type.
|
||||
/// </summary>
|
||||
|
@ -402,15 +402,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Word document.
|
||||
/// </summary>
|
||||
public static string WordDocument {
|
||||
get {
|
||||
return ResourceManager.GetString("WordDocument", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Yes.
|
||||
/// </summary>
|
||||
|
|
|
@ -120,6 +120,12 @@
|
|||
<data name="Actions" xml:space="preserve">
|
||||
<value>Actions</value>
|
||||
</data>
|
||||
<data name="Byte" xml:space="preserve">
|
||||
<value>Byte</value>
|
||||
</data>
|
||||
<data name="Bytes" xml:space="preserve">
|
||||
<value>Bytes</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
|
@ -132,9 +138,6 @@
|
|||
<data name="Confirm" xml:space="preserve">
|
||||
<value>Confirm</value>
|
||||
</data>
|
||||
<data name="Create" xml:space="preserve">
|
||||
<value>Create</value>
|
||||
</data>
|
||||
<data name="Delete" xml:space="preserve">
|
||||
<value>Delete</value>
|
||||
</data>
|
||||
|
@ -147,24 +150,15 @@
|
|||
<data name="DialogsContentConfrimFileDeletion" xml:space="preserve">
|
||||
<value>Are you sure you want to delete {0} item(s)?</value>
|
||||
</data>
|
||||
<data name="EnterFileName" xml:space="preserve">
|
||||
<value>Enter file name</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Error</value>
|
||||
</data>
|
||||
<data name="ExcelWorkbook" xml:space="preserve">
|
||||
<value>Excel workbook</value>
|
||||
<data name="ExabyteShort" xml:space="preserve">
|
||||
<value>EB</value>
|
||||
</data>
|
||||
<data name="File" xml:space="preserve">
|
||||
<value>File</value>
|
||||
</data>
|
||||
<data name="FileName" xml:space="preserve">
|
||||
<value>File name</value>
|
||||
</data>
|
||||
<data name="FileNameExtensionHint" xml:space="preserve">
|
||||
<value>File extension will be added automatically</value>
|
||||
</data>
|
||||
<data name="FileUpload" xml:space="preserve">
|
||||
<value>File Upload</value>
|
||||
</data>
|
||||
|
@ -174,12 +168,15 @@
|
|||
<data name="Info" xml:space="preserve">
|
||||
<value>Info</value>
|
||||
</data>
|
||||
<data name="ItemExist" xml:space="preserve">
|
||||
<value>File already exist</value>
|
||||
</data>
|
||||
<data name="ItemsWasRemovedFormat" xml:space="preserve">
|
||||
<value>{0} items was removed.</value>
|
||||
</data>
|
||||
<data name="KilobyteShort" xml:space="preserve">
|
||||
<value>KB</value>
|
||||
</data>
|
||||
<data name="MegabyteShort" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
</data>
|
||||
<data name="Modified" xml:space="preserve">
|
||||
<value>Modified</value>
|
||||
</data>
|
||||
|
@ -195,12 +192,12 @@
|
|||
<data name="OrDragAndDropFilesHere" xml:space="preserve">
|
||||
<value>or drag and drop files here.</value>
|
||||
</data>
|
||||
<data name="PetabyteShort" xml:space="preserve">
|
||||
<value>PB</value>
|
||||
</data>
|
||||
<data name="PleaseWaitWithDots" xml:space="preserve">
|
||||
<value>Please wait...</value>
|
||||
</data>
|
||||
<data name="PowerPointPresentation" xml:space="preserve">
|
||||
<value>Powerpoint presentation</value>
|
||||
</data>
|
||||
<data name="Processing" xml:space="preserve">
|
||||
<value>Processing</value>
|
||||
</data>
|
||||
|
@ -225,15 +222,15 @@
|
|||
<data name="Table" xml:space="preserve">
|
||||
<value>Table</value>
|
||||
</data>
|
||||
<data name="TerabyteShort" xml:space="preserve">
|
||||
<value>TB</value>
|
||||
</data>
|
||||
<data name="Type" xml:space="preserve">
|
||||
<value>Type</value>
|
||||
</data>
|
||||
<data name="Upload" xml:space="preserve">
|
||||
<value>Upload</value>
|
||||
</data>
|
||||
<data name="WordDocument" xml:space="preserve">
|
||||
<value>Word document</value>
|
||||
</data>
|
||||
<data name="Yes" xml:space="preserve">
|
||||
<value>Yes</value>
|
||||
</data>
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
@using WebsitePanel.WebDav.Core.Config
|
||||
@using WebsitePanel.WebDavPortal.FileOperations
|
||||
@using Ninject;
|
||||
@using WebsitePanel.WebDavPortal.Helpers
|
||||
@using WebsitePanel.WebDavPortal.Resources
|
||||
@using WebsitePanel.WebDavPortal.UI
|
||||
@using WebsitePanel.WebDavPortal.UI.Routes
|
||||
|
@ -63,7 +64,7 @@
|
|||
<p class="progress-text">@percent%</p>
|
||||
</div>
|
||||
</div>
|
||||
<p>@Math.Round(Convert.ToDecimal(resource.ContentLength) / 1024, 2) / @Math.Round(Convert.ToDecimal(resource.AllocatedSpace) / 1024, 2) @UI.GigabyteShort</p>
|
||||
<p>@ViewDataHelper.BytesToSize(resource.ContentLength) / @ViewDataHelper.BytesToSize(resource.AllocatedSpace)</p>
|
||||
}
|
||||
|
||||
<div class="selected-element-overlay">
|
||||
|
|
|
@ -183,6 +183,7 @@
|
|||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\DataTableHelper.cs" />
|
||||
<Compile Include="Helpers\ViewDataHelper.cs" />
|
||||
<Compile Include="HttpHandlers\AccessTokenHandler.cs" />
|
||||
<Compile Include="HttpHandlers\FileTransferRequestHandler.cs" />
|
||||
<Compile Include="Mapping\AutoMapperPortalConfiguration.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue