webdav portal upload added

This commit is contained in:
vfedosevich 2015-02-19 05:21:17 -08:00
parent 51d432fd2e
commit 38bde37b18
105 changed files with 21145 additions and 105 deletions

View file

@ -18,40 +18,39 @@
}
else
{
@Html.Partial("_ShowContentTopMenu", Model)
@Html.Partial("_ShowContentTopMenu", Model)
Html.RenderAction("ContentList", "FileSystem", new { viewType = Request.Browser.IsMobileDevice ? FolderViewTypes.BigIcons : Model.UserSettings.WebDavViewType });
@Html.Action("ContentList", "FileSystem", new { viewType = Request.Browser.IsMobileDevice ? FolderViewTypes.BigIcons : Model.UserSettings.WebDavViewType });
}
@section scripts{
<script>
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
</script>
@if (Model.UserSettings.WebDavViewType == FolderViewTypes.BigIcons)
{
@Scripts.Render("~/bundles/bigIconsScripts")
<script>
recalculateResourseHeight();
</script>
}
else
{
<script>
$(document).ready(function() {
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
wsp.fileBrowser.initDataTable('#webdav-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)');
});
</script>
}
}
@section popups
{
<div id="file-upload" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-file-upload-title" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="modal-file-upload-title">@UI.FileUpload</h4>
</div>
@using (Html.BeginRouteForm(FileSystemRouteNames.UploadFile, FormMethod.Post, new {enctype = "multipart/form-data"}))
{
<div class="modal-body">
<input type="file" name="file" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@UI.Close</button>
<button type="submit" class="btn btn-primary processing-dialog">@UI.Upload</button>
</div>
}
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
@Html.Partial("_ProcessDialog", null)
@Html.Partial("_ConfirmDialog")
}

View file

@ -0,0 +1,125 @@
@using WebsitePanel.WebDavPortal.Resources
@using WebsitePanel.WebDavPortal.UI.Routes
@model WebsitePanel.WebDavPortal.Models.ModelForWebDav
<div class="file-upload-menu">
@Html.Partial("_ShowContentTopMenu", Model)
</div>
@using(Html.BeginRouteForm(FileSystemRouteNames.UploadFile, FormMethod.Post, new { id="file-upload-form", enctype="multipart/form-data"}))
{
<div class="row fileupload-buttonbar">
<div class="col-lg-12">
<div class="drag-and-drop-area">
<span class="info-block">
<i class="glyphicon glyphicon-upload upload-block-icon"></i>
<span class="upload-block-text">
@UI.SelectFilesToUpload
</span>
<span class="upload-block-description">
@UI.OrDragAndDropFilesHere
</span>
</span>
<div class="upload-block">
<input type="file" tabindex="0" multiple>
</div>
</div>
</div>
<!-- The global file processing state -->
<span class="fileupload-process"></span>
<!-- The global progress state -->
<div class="col-lg-12 fileupload-progress fileupload-global-process fade">
<!-- The global progress bar -->
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
<div class="progress-bar progress-bar-success" style="width: 0%;"></div>
</div>
<!-- The extended global progress state -->
<div>
<div class="progress-extended">&nbsp;</div>
<div class="cancel-all">
<button type="reset" class="btn btn-default cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
<span>@UI.CancelAll</span>
</button>
</div>
</div>
</div>
</div>
<!-- The table listing the files available for upload/download -->
<table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
}
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<td class="column-name">
<p class="name">{%=file.name%}</p>
<strong class="error text-danger"></strong>
</td>
<td class="column-progress">
<div>
<div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0">
<div class="progress-bar progress-bar-success" style="width:0%;">
</div>
</div>
<p class="size"></p>
</div>
</td>
<td class="column-actions">
<div class="file-actions">
{% if (!i && !o.options.autoUpload) { %}
<span class="start" title="@UI.Upload" disabled>
<i class="glyphicon glyphicon-upload"></i>
</span>
{% } %}
{% if (!i) { %}
<span class="cancel" title="@UI.Cancel">
<i class="glyphicon glyphicon-ban-circle"></i>
</span>
{% } %}
</div>
</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
<td class="column-name">
<p class="name">
{% if (file.url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
{% } else { %}
<span>{%=file.name%}</span>
{% } %}
</p>
{% if (file.error) { %}
<div><span class="label label-danger">@UI.Error</span> {%=file.error%}</div>
{% } %}
</td>
<td class="column-progress">
<span class="size">{%=o.formatFileSize(file.size)%}</span>
</td>
<td class="column-actions">
<div class="file-actions">
<span class="cancel" title="@UI.Close">
<i class="glyphicon glyphicon-remove"></i>
</span>
</div>
</td>
</tr>
{% } %}
</script>
@section scripts{
@Scripts.Render("~/bundles/file-upload")
<script type="text/javascript">
wsp.fileBrowser.initFileUpload('#file-upload-form', '@Url.RouteUrl(FileSystemRouteNames.UploadFile)');
</script>
}

View file

@ -43,7 +43,7 @@
<div class="element">
<img class="icon-size" src="@Url.Content(actualPath)" />
<a href="@href" @Html.Raw(isTargetBlank ? "target=\"_blank\"" : string.Empty) class="file-link processing-dialog" title="@name">
<a href="@href" @Html.Raw(isTargetBlank ? "target=\"_blank\"" : string.Empty) class="file-link @(Model.ItemType == ItemType.Folder ? "processing-dialog" : "")" title="@name">
<p style="word-wrap: break-word;">@name</p>
</a>

View file

@ -2,6 +2,7 @@
@using WebsitePanel.WebDavPortal.UI.Routes
@model WebsitePanel.WebDavPortal.Models.ModelForWebDav
<div class="container">
<div class="row" id="resourcesDiv">
@ -14,11 +15,3 @@
}
</div>
</div>
@section scripts{
@Scripts.Render("~/bundles/appScripts/storage/bigIcons")
<script>
recalculateResourseHeight();
</script>
}

View file

@ -3,8 +3,8 @@
@model WebsitePanel.WebDavPortal.Models.ModelForWebDav
<div class="prevent-deselect">
<table id="webdav-items-table" class="display table table-striped table-bordered" cellspacing="0" width="100%">
<div class="prevent-deselect container">
<table id="webdav-items-table" class="display table table-striped table-bordered noselect" cellspacing="0" width="100%">
<thead>
<tr>
<th>@UI.Name</th>
@ -15,39 +15,8 @@
</table>
</div>
@section scripts{
<script>
$(document).ready(function () {
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
wsp.fileBrowser.initDataTable('#webdav-items-table','@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)');
});
</script>
}
@section popups
{
<div id="file-upload" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-file-upload-title" aria-hidden="true" style="display: none;">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="modal-file-upload-title">@UI.FileUpload</h4>
</div>
@using (Html.BeginRouteForm(FileSystemRouteNames.UploadFile, FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<div class="modal-body">
<input type="file" name="file" />
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@UI.Close</button>
<button type="submit" class="btn btn-primary processing-dialog">@UI.Upload</button>
</div>
}
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>
@Html.Partial("_ProcessDialog", null)
@Html.Partial("_ConfirmDialog")
}

View file

@ -44,7 +44,7 @@
@if (Model.Permissions.HasFlag(WebDavPermissions.Write))
{
<a id="upload-button" class="btn btn-success btn-sm active" data-toggle="modal" data-target="#file-upload" role="button">@UI.FileUpload</a>
<a id="upload-button" class="btn btn-success btn-sm active" href="@Url.RouteUrl(FileSystemRouteNames.UploadFile)" role="button">@UI.FileUpload</a>
}
</div>