Traverse directories

This commit is contained in:
Basti 2017-11-12 18:12:02 +01:00
parent 2bd918655d
commit 1f94c59261
2 changed files with 17 additions and 6 deletions

View File

@ -1,11 +1,20 @@
<ul class="listing">
{{#each items as |item|}}
<li>
{{#link-to "index"}}
<span class="icon">{{item-icon type=item.type}}</span>
<span class="name">{{item.name}}</span>
<span class="type">{{item.type}}</span>
{{/link-to}}
{{#if item.isFolder}}
{{#link-to "index" (query-params path=item.path)}}
<span class="icon">{{item-icon type=item.type}}</span>
<span class="name">{{item.name}}</span>
<span class="type">{{item.type}}</span>
{{/link-to}}
{{else}}
<!-- TODO link to item -->
{{#link-to "index"}}
<span class="icon">{{item-icon type=item.type}}</span>
<span class="name">{{item.name}}</span>
<span class="type">{{item.type}}</span>
{{/link-to}}
{{/if}}
</li>
{{/each}}
</ul>

View File

@ -97,7 +97,9 @@ export default Service.extend({
items.push(EmberObject.create({
name: name,
type: type,
size: item['Content-Length'] || null
isFolder: type === 'folder',
size: item['Content-Length'] || null,
path: path + name
}));
});