fixing incorrect paths with sharing

This commit is contained in:
Jon Lambson 2017-10-12 15:33:40 -06:00
parent 281ed9d1b2
commit 238d828a6f
2 changed files with 24 additions and 3 deletions

View File

@ -579,6 +579,7 @@ app.controller('websiteCtrl', [
if (result.data.error) { if (result.data.error) {
msg = result.data.error.message; msg = result.data.error.message;
} else { } else {
vm.displaySpinner = 'hidden';
msg = 'shared with ' + person; msg = 'shared with ' + person;
vm.showInviteContainer = false; vm.showInviteContainer = false;
vm.showSharesContainer = true; vm.showSharesContainer = true;
@ -838,3 +839,22 @@ app.filter('capitalize', function() {
return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : ''; return (!!input) ? input.charAt(0).toUpperCase() + input.substr(1).toLowerCase() : '';
}; };
}); });
app.filter('prettyShareMode', function() {
return function(input) {
var newArry = [];
var arry = input.split(',');
arry.forEach(function(action){
if (action.includes('w')) {
newArry.push('Write');
}
if (action.includes('r')) {
newArry.push('Read');
}
if (action.includes('x')) {
newArry.push('Invite');
}
});
return newArry.join(', ');
};
});

View File

@ -198,14 +198,15 @@
<div class="form-group"> <div class="form-group">
<label class="col-md-1 control-label" for="">To:</label> <label class="col-md-1 control-label" for="">To:</label>
<div class="col-md-8"> <div class="col-md-8">
<input type="text" ng-model="r.shareEmail" class="form-control" placeholder="ex: john@example.com" ng-change="showShareBtn = true"/> <input type="text" ng-model="r.shareEmail" class="form-control" placeholder="ex: john@example.com" />
<input type="hidden" ng-model="vm.autoPopulateWebPath" class="form-control" placeholder="/" disabled /> <input type="hidden" ng-model="vm.autoPopulateWebPath" class="form-control" placeholder="/" disabled />
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<multiselect class="input-xlarge" multiple="true" <multiselect class="input-xlarge" multiple="true"
ng-model="selectedAccess" ng-model="selectedAccess"
options="c.name for c in accessLevel" options="c.name for c in accessLevel"
change="selected()"> change="selected()"
ng-change="showShareBtn = true">
</multiselect> </multiselect>
</div> </div>
</div> </div>
@ -228,7 +229,7 @@
<div class="media-body"> <div class="media-body">
<h4 ng-bind="share.comment">friend@email.com</h4> <h4 ng-bind="share.comment">friend@email.com</h4>
<p><b>Share Path:</b> <span ng-bind="share.path" class="text-muted">/</span></p> <p><b>Share Path:</b> <span ng-bind="share.path" class="text-muted">/</span></p>
<p><b>Actions Allowed:</b> <span class="text-muted">{{ vm.prettyShareMode }}</span></p> <p><b>Actions Allowed:</b> <span ng-bind="share.mode | prettyShareMode" class="text-muted">wrx</span></p>
<p><b>Invite:</b> <em ng-if="share.pending" class="text-muted">pending</em></p> <p><b>Invite:</b> <em ng-if="share.pending" class="text-muted">pending</em></p>
</div> </div>
<div class="media-right align-self-center"> <div class="media-right align-self-center">