added a download btn which doesnt work

This commit is contained in:
Jon Lambson 2017-11-02 17:00:39 -06:00
parent d97c6ab369
commit 132c4e9f35
3 changed files with 16 additions and 6 deletions

View File

@ -249,8 +249,6 @@ app.controller('websiteCtrl', [
var path = vm.breadcrumbsPath.join('/');
cleanPathQuery(path);
vm.Sites.contents(vm.copyR, vm.cleanedPath);
}, function (err) {
console.log(err);
});
};
@ -363,6 +361,7 @@ app.controller('websiteCtrl', [
r.newFile = vm.newFile;
}
analyzeFile(r.newFile, r);
debugger;
console.log(r);
};
@ -528,6 +527,7 @@ app.controller('websiteCtrl', [
return;
}
var pkg = Auth.oauth3.pkg('www@daplie.com');
var removedPath = opts.path;
return pkg.remove({
hostname: r.domain
, domain: r.domain
@ -545,18 +545,27 @@ app.controller('websiteCtrl', [
cleanPathQuery(vm.breadcrumbsPath.join('/'));
vm.Sites.contents(vm.copyR, vm.cleanedPath);
}
var msg = 'Successfully deleted ' + "'" + removedPath + "'.";
vm.buildNotification(result, msg);
});
};
vm.Sites.archive = function (r) {
var pkg = Auth.oauth3.pkg('www@daplie.com');
var path;
if (vm.breadcrumbsPath === undefined && vm.breadcrumbs === undefined) {
path = r.shareAccess.path;
} else {
cleanPathQuery(vm.breadcrumbsPath.join('/'));
path = vm.cleanedPath;
}
return pkg.archive({
hostname: r.domain
, domain: r.domain
, tld: r.tld
, sld: r.sld
// , sub: vm.record.sub
//, path: vm.uploadPath
, path: r.domain + path
}).then(function (result) {
window.alert(JSON.stringify(result));
// TODO use iframe to initiate download?

View File

@ -240,7 +240,7 @@
<p><b>Invite:</b> <em ng-if="share.pending" class="text-muted">pending</em> <span ng-if="!share.pending" class="text-muted">Accepted</span></p>
</div>
<div class="media-right align-self-center">
<button class="btn btn-danger" ng-click="vm.Shares.remove(r, share)">Remove Access</button>
<button ng-if="r.shareAccess.invite" class="btn btn-danger" ng-click="vm.Shares.remove(r, share)">Remove Access</button>
</div>
</div>
</li>

View File

@ -26,10 +26,11 @@
<hr>
<div>
<button ng-if="r.shareAccess.invite" type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.showAction('invite');">Share folder</button>
<button type="button" name="button" class="btn btn-block btn-primary" ng-click="vm.Sites.archive(r)">Download folder</button>
<ul class="ls-none folder-actions-list">
<li ng-if="r.shareAccess.write"><span><i class="fa fa-upload cp"></i> <a ng-click="vm.autoPopulateFolderName(); vm.uploadFileContainer = true; vm.uploadFolderContainer = false; vm.cleanUploads(r);" class="cp">Upload files</a></span></li>
<li ng-if="r.shareAccess.write"><span><i class="fa fa-folder cp"></i> <a ng-click="vm.uploadFolderContainer = true; vm.uploadFileContainer = false; vm.cleanUploads(r);" class="cp">New folder</a></span></li>
<li ng-if="r.shareAccess.write"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r); vm.cleanUploads(r);" data="{{ vm.currentFolder }}" class="cp">Delete {{ vm.currentFolder | capitalize }} Folder</a></span></li>
<li ng-if="r.shareAccess.write"><span><i class="fa fa-trash cp"></i> <a ng-click="vm.triggerDeleteFolder(vm.currentFolder, r); vm.cleanUploads(r);" data="{{ vm.currentFolder }}" class="cp">Delete {{ vm.currentFolder | capitalize }} folder</a></span></li>
</ul>
</div>
</div>