Add file type icons
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
<tbody>
|
||||
{{#each items as |item|}}
|
||||
<tr>
|
||||
<td class="icon">{{item-icon type=item.type}}</td>
|
||||
<td class="name">{{item.name}}</td>
|
||||
<td class="type">{{item.type}}</td>
|
||||
</tr>
|
||||
|
||||
9
app/components/item-icon/component.js
Normal file
9
app/components/item-icon/component.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import Component from '@ember/component';
|
||||
|
||||
export default Component.extend({
|
||||
|
||||
classNames: ['item-icon'],
|
||||
|
||||
type: null,
|
||||
|
||||
});
|
||||
1
app/components/item-icon/template.hbs
Normal file
1
app/components/item-icon/template.hbs
Normal file
@@ -0,0 +1 @@
|
||||
<img src="/img/file-icons/{{type}}.svg">
|
||||
@@ -11,4 +11,5 @@ body {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@import "components/directory_listing";
|
||||
@import "components/directory-listing";
|
||||
@import "components/item-icon";
|
||||
|
||||
@@ -18,6 +18,10 @@
|
||||
td {
|
||||
padding: 1rem 1.5rem;
|
||||
|
||||
&.icon {
|
||||
width: 1rem;
|
||||
padding-right: 0;
|
||||
}
|
||||
&.type {
|
||||
color: #aaa;
|
||||
}
|
||||
8
app/styles/components/_item-icon.scss
Normal file
8
app/styles/components/_item-icon.scss
Normal file
@@ -0,0 +1,8 @@
|
||||
.item-icon {
|
||||
|
||||
img {
|
||||
height: 1.2rem;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user