mirror of
https://github.com/documize/community.git
synced 2025-07-25 08:09:43 +02:00
delete space, mov doc edge cases
This commit is contained in:
parent
5481de4e1c
commit
8d761da939
11 changed files with 117 additions and 125 deletions
|
@ -22,7 +22,7 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
},
|
||||
|
||||
model() {
|
||||
return this.get('folderService').getAll();
|
||||
return this.get('folderService').adminList();
|
||||
},
|
||||
|
||||
setupController(controller, model) {
|
||||
|
@ -30,33 +30,12 @@ export default Ember.Route.extend(AuthenticatedRouteMixin, {
|
|||
if (is.empty(nonPrivateFolders) || is.null(model) || is.undefined(model)) {
|
||||
nonPrivateFolders = [];
|
||||
}
|
||||
|
||||
controller.set('folders', nonPrivateFolders);
|
||||
|
||||
this.get('folderService').getProtectedFolderInfo().then((people) => {
|
||||
people.forEach((person) => {
|
||||
person.set('isEveryone', person.get('userId') === '');
|
||||
person.set('isOwner', false);
|
||||
});
|
||||
|
||||
nonPrivateFolders.forEach(function (folder) {
|
||||
let shared = people.filterBy('folderId', folder.get('id'));
|
||||
let person = shared.findBy('userId', folder.get('userId'));
|
||||
if (is.not.undefined(person)) {
|
||||
person.set('isOwner', true);
|
||||
}
|
||||
|
||||
folder.set('sharedWith', shared);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
activate() {
|
||||
document.title = "Spaces | Documize";
|
||||
},
|
||||
|
||||
actions: {
|
||||
onChangeOwner() {
|
||||
this.refresh();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -4,40 +4,16 @@
|
|||
<div class="title">{{folders.length}} shared {{label}}</div>
|
||||
<div class="tip">View and change shared space ownership</div>
|
||||
</div>
|
||||
<div class="input-control">
|
||||
<table class="basic-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="bordered">Space</th>
|
||||
<th class="bordered">Participants</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{#each folders as |folder|}}
|
||||
<tr>
|
||||
<td class="bordered">
|
||||
{{#link-to 'folder' folder.id folder.slug class="alt"}}{{folder.name}}{{/link-to}}
|
||||
</td>
|
||||
<td class="bordered">
|
||||
{{#each folder.sharedWith as |person|}}
|
||||
{{#if person.isEveryone}}
|
||||
Everyone
|
||||
{{else}}
|
||||
|
||||
{{#if person.isOwner}}
|
||||
<span class="bold">{{person.firstname}} {{person.lastname}} (owner)</span>
|
||||
{{else}}
|
||||
{{person.firstname}} {{person.lastname}}
|
||||
<a class="action-link" {{action "changeOwner" folder.id person.userId}}>make owner</a>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
<br/>
|
||||
{{/each}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="input-control manage-space-list">
|
||||
{{#each folders as |folder|}}
|
||||
<div class="space pull-left width-80">
|
||||
{{#link-to 'folder' folder.id folder.slug class="alt"}}{{folder.name}}{{/link-to}}
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
|
||||
</div>
|
||||
<div class="clearfix" />
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{else}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue