hopefully done with files uploads

This commit is contained in:
Jon Lambson 2017-10-03 15:48:18 -06:00
parent 24907ece8d
commit 208c9db28f
4 changed files with 20 additions and 18 deletions

View File

@ -11,7 +11,10 @@ Clone and load the HTML. That's all.
npm install -g serve-https npm install -g serve-https
git clone git@git.daplie.com:Daplie/walnut_launchpad.git git clone git@git.daplie.com:Daplie/walnut_launchpad.git
pushd landing-page # install oauth3 to /assets/oauth3.org
pushd walnut_launchpad
bash ./install.sh
serve-https serve-https
``` ```

View File

@ -619,6 +619,16 @@ h2.ssb-title {
padding:0; padding:0;
text-transform: uppercase; text-transform: uppercase;
} }
.root { .folder-actions-list .root {
display: none; display: none;
} }
.folder-actions-list {
margin: 20px 0px;
-webkit-padding-start: 0px;
}
.folder-actions-list i {
color: #337ab7;
}
.folder-actions-list li {
padding: 5px 0px;
}

View File

@ -326,10 +326,9 @@ app.controller('websiteCtrl', [
}; };
vm.Sites.upload = function (r) { vm.Sites.upload = function (r) {
debugger;
if (r.uploadPath === undefined) { if (r.uploadPath === undefined) {
r.uploadPath = vm.autoPopulateWebPath; r.uploadPath = vm.autoPopulateWebPath;
}; }
var pkg = Auth.oauth3.pkg('www@daplie.com'); var pkg = Auth.oauth3.pkg('www@daplie.com');
//analyzeFile(r.newFile, r); //analyzeFile(r.newFile, r);
vm._uploadFile(pkg, r); vm._uploadFile(pkg, r);

View File

@ -1,7 +1,7 @@
<div class="text-left"> <div class="text-left">
<div class="row"> <div class="row">
<ul class="breadcrumb"> <ul class="breadcrumb">
<li ng-repeat="breadcrumb in vm.breadcrumbs track by $index" ng-click="vm.getDirectoriesFromBreadcrumbs(breadcrumb)" data="{{ breadcrumb }}" class="cp breadcrumbs-list"> <li ng-repeat="breadcrumb in vm.breadcrumbs track by $index" ng-click="vm.getDirectoriesFromBreadcrumbs(breadcrumb); vm.showUploadContainer = false; vm.showUploadFolderContainer = false; vm.showUploadFilesContainer = false; vm.showUploadButton = true;" data="{{ breadcrumb }}" class="cp breadcrumbs-list">
{{ breadcrumb | capitalize }} {{ breadcrumb | capitalize }}
</li> </li>
</ul> </ul>
@ -11,7 +11,7 @@
<ul class="tree ls-none"> <ul class="tree ls-none">
<li class="directories-go-here" ng-repeat="directory in vm.siteDirectories track by $index"> <li class="directories-go-here" ng-repeat="directory in vm.siteDirectories track by $index">
<input type="checkbox" id="{{ r.challenge }}{{ $index }}" /> <input type="checkbox" id="{{ r.challenge }}{{ $index }}" />
<label class="tree_label" for="{{ r.challenge }}{{ $index }}" ng-click="vm.getDirectories(directory); vm.showUploadContainer = false: vm.showUploadFolderContainer = false;" data="{{ directory }}">{{ directory }}</label><span class="pull-right"><button type="button" class="btn btn-danger btn-xs" ng-click="vm.deleteFilesFrom(r, directory)" data="{{ directory }}" data="{{ r }}"><i class="fa fa-trash"></i></button></span> <label class="tree_label" for="{{ r.challenge }}{{ $index }}" ng-click="vm.getDirectories(directory); vm.showUploadContainer = false; vm.showUploadFolderContainer = false; vm.showUploadFilesContainer = false;" data="{{ directory }}">{{ directory }}</label><span class="pull-right"><button type="button" class="btn btn-danger btn-xs" ng-click="vm.deleteFilesFrom(r, directory)" data="{{ directory }}" data="{{ r }}"><i class="fa fa-trash"></i></button></span>
</li> </li>
</ul> </ul>
<ul class="tree files-only ls-none"> <ul class="tree files-only ls-none">
@ -24,8 +24,8 @@
<div class=""> <div class="">
<button type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.showUploadFilesContainer = true; vm.autoPopulateFolderName(); vm.showUploadFolderContainer = false" ng-show="vm.showUploadButton">Upload files</button> <button type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.showUploadFilesContainer = true; vm.autoPopulateFolderName(); vm.showUploadFolderContainer = false" ng-show="vm.showUploadButton">Upload files</button>
<button type="button" name="button" class="btn btn-block btn-primary">Share folder</button> <button type="button" name="button" class="btn btn-block btn-primary">Share folder</button>
<ul class="ls-none"> <ul class="ls-none folder-actions-list">
<li class="{{ vm.currentFolder }}"><span><i class="fa fa-upload cp"></i> <a ng-click="vm.showUploadFilesContainer = true; vm.autoPopulateFolderName(); vm.showUploadFolderContainer = false;" class="cp">Upload files</a></span></li> <li class="{{ vm.currentFolder }}" ng-hide="vm.showUploadButton"><span><i class="fa fa-upload cp"></i> <a ng-click="vm.showUploadFilesContainer = true; vm.autoPopulateFolderName(); vm.showUploadFolderContainer = false;" class="cp">Upload files</a></span></li>
<li class=""><span><i class="fa fa-folder cp"></i> <a ng-click="vm.showUploadFolderContainer = true; vm.cleanPath(); vm.showUploadFilesContainer = false;" class="cp">New folder</a></span></li> <li class=""><span><i class="fa fa-folder cp"></i> <a ng-click="vm.showUploadFolderContainer = true; vm.cleanPath(); vm.showUploadFilesContainer = false;" class="cp">New folder</a></span></li>
<li class="{{ vm.currentFolder }}"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r)" data="{{ vm.currentFolder }}" data="{{ r }}" class="cp">Delete {{ vm.currentFolder | capitalize }} Folder</a></span></li> <li class="{{ vm.currentFolder }}"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r)" data="{{ vm.currentFolder }}" data="{{ r }}" class="cp">Delete {{ vm.currentFolder | capitalize }} Folder</a></span></li>
</ul> </ul>
@ -36,17 +36,11 @@
<hr> <hr>
<div> <div>
<input type="file" ng-model="r.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(r)" /> <input type="file" ng-model="r.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(r)" />
<div ng-if="r.isZip"><label><input type="checkbox" ng-model="r.unzip" /> Unpack .zip</label></div> <div ng-if="r.isZip"><label><input type="checkbox" ng-model="r.unzip" /> Unpack .zip</label></div>
<div ng-if="r.unzip"><label><input type="checkbox" ng-model="r.stripZip" /> Strip zip directory root</label></div> <div ng-if="r.unzip"><label><input type="checkbox" ng-model="r.stripZip" /> Strip zip directory root</label></div>
<div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></div> <div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></div>
<div ng-if="r.uploadTotal"><span ng-bind="r.uploadPercent">99</span>% | <span ng-bind="r.uploadProgress">1</span> MiB / <span ng-bind="r.uploadTotal">100</span> MiB</div> <div ng-if="r.uploadTotal"><span ng-bind="r.uploadPercent">99</span>% | <span ng-bind="r.uploadProgress">1</span> MiB / <span ng-bind="r.uploadTotal">100</span> MiB</div>
<input type="text" class="form-control hidden" ng-model="vm.autoPopulateWebPath" placeholder="/js/config/config.js" disabled/> <input type="text" class="form-control hidden" ng-model="vm.autoPopulateWebPath" placeholder="/js/config/config.js" disabled/>
<button ng-click="vm.Sites.upload(r)" type="button" name="button" class="btn btn-success" ng-show="vm.showCompleteFileUploadBtn">Add File</button> <button ng-click="vm.Sites.upload(r)" type="button" name="button" class="btn btn-success" ng-show="vm.showCompleteFileUploadBtn">Add File</button>
</div> </div>
</form> </form>
@ -54,7 +48,6 @@
<hr> <hr>
<ul class="ls-none"> <ul class="ls-none">
<li class="add-folder"> <li class="add-folder">
<!-- <span><i class="fa fa-folder"></i> <input type="text" class="form-control {{ vm.hideFolderInput }}" style="width: 85%;" ng-model="vm.newFolderPath" ng-blur="vm.createNewFolder(r)" data="{{ r }}"><label class="">{{ vm.newFolderAddedName }}</label></span> -->
<span> <span>
<i class="fa fa-folder"></i> <input type="text" class="form-control {{ vm.hideFolderInput }}" ng-model="vm.autoPopulateWebPath" ng-blur="vm.createNewFolder(r)" data="{{ r }}" style="width: 85%;"/> <i class="fa fa-folder"></i> <input type="text" class="form-control {{ vm.hideFolderInput }}" ng-model="vm.autoPopulateWebPath" ng-blur="vm.createNewFolder(r)" data="{{ r }}" style="width: 85%;"/>
<label ng-show="vm.showFileUploadBtn">{{ vm.autoPopulateWebPath }}</label> <label ng-show="vm.showFileUploadBtn">{{ vm.autoPopulateWebPath }}</label>
@ -63,11 +56,8 @@
<li class="text-center"> <li class="text-center">
<input type="file" ng-model="r.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(r)" ng-show="vm.showFileUploadBtn" /> <input type="file" ng-model="r.newFile" class="form-control" daplie-file-change="vm.Sites.setUpload(r)" ng-show="vm.showFileUploadBtn" />
<div ng-if="r.isZip"><label><input type="checkbox" ng-model="r.unzip" /> Unpack .zip</label></div> <div ng-if="r.isZip"><label><input type="checkbox" ng-model="r.unzip" /> Unpack .zip</label></div>
<div ng-if="r.unzip"><label><input type="checkbox" ng-model="r.stripZip" /> Strip zip directory root</label></div> <div ng-if="r.unzip"><label><input type="checkbox" ng-model="r.stripZip" /> Strip zip directory root</label></div>
<!-- div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></div --> <!-- div ng-if="vm.isZip" ><label>Unzip directory</label> <input type="text" ng-model="vm.unzipPath" /></div -->
<div ng-if="r.uploadTotal"><span ng-bind="r.uploadPercent">99</span>% | <span ng-bind="r.uploadProgress">1</span> MiB / <span ng-bind="r.uploadTotal">100</span> MiB</div> <div ng-if="r.uploadTotal"><span ng-bind="r.uploadPercent">99</span>% | <span ng-bind="r.uploadProgress">1</span> MiB / <span ng-bind="r.uploadTotal">100</span> MiB</div>
</li> </li>
<li> <li>