|
1 |
| -<div |
2 |
| - class="uk-height-1-1" |
3 |
| - uk-form-custom |
4 |
| - ...attributes |
5 |
| -> |
| 1 | +<div class="uk-height-1-1" uk-form-custom ...attributes> |
6 | 2 | <UkButton
|
7 | 3 | @color="primary"
|
8 | 4 | @size="small"
|
|
15 | 11 | </UkButton>
|
16 | 12 |
|
17 | 13 | {{#if @category}}
|
18 |
| - <input |
19 |
| - type="file" |
20 |
| - multiple="multiple" |
21 |
| - data-test-input |
22 |
| - aria-label="Category name" |
23 |
| - {{on "change" (perform this.upload @category)}} |
24 |
| - /> |
| 14 | + {{#if can "upload document" @category}} |
| 15 | + <input |
| 16 | + type="file" |
| 17 | + multiple="multiple" |
| 18 | + data-test-input |
| 19 | + aria-label="Category name" |
| 20 | + {{on "change" (perform this.upload @category)}} |
| 21 | + /> |
| 22 | + {{/if}} |
25 | 23 | {{else}}
|
26 | 24 | <Drop @width="uk-with-medium" as |Item|>
|
27 | 25 | {{#each this.categories.records as |category|}}
|
28 |
| - <Item uk-form-custom data-test-upload-category> |
29 |
| - <input |
30 |
| - type="file" |
31 |
| - multiple="multiple" |
32 |
| - data-test-input |
33 |
| - aria-label="file input" |
34 |
| - {{on "change" (perform this.upload category)}} |
35 |
| - /> |
36 |
| - <FaIcon |
37 |
| - @prefix="far" |
38 |
| - @icon="folder" |
39 |
| - @size="2x" |
40 |
| - class="uk-margin-small-right" |
41 |
| - data-test-folder-icon |
42 |
| - {{set-style color=category.color}} |
43 |
| - /> |
44 |
| - {{category.name}} |
45 |
| - </Item> |
46 |
| - {{#if category.children.length}} |
47 |
| - {{#each category.children as |child|}} |
48 |
| - <Item class="item--indent" uk-form-custom data-test-upload-category> |
49 |
| - <input |
50 |
| - type="file" |
51 |
| - multiple="multiple" |
52 |
| - data-test-input |
53 |
| - aria-label="file input" |
54 |
| - {{on "change" (perform this.upload child)}} |
55 |
| - /> |
56 |
| - <FaIcon |
57 |
| - @prefix="far" |
58 |
| - @icon="folder" |
59 |
| - @size="2x" |
60 |
| - class="uk-margin-small-right" |
61 |
| - data-test-folder-icon |
62 |
| - {{set-style color=child.color}} |
63 |
| - /> |
64 |
| - {{child.name}} |
65 |
| - </Item> |
66 |
| - {{/each}} |
| 26 | + {{#if can "upload to category" @category}} |
| 27 | + <Item uk-form-custom data-test-upload-category> |
| 28 | + <input |
| 29 | + type="file" |
| 30 | + multiple="multiple" |
| 31 | + data-test-input |
| 32 | + aria-label="file input" |
| 33 | + {{on "change" (perform this.upload category)}} |
| 34 | + /> |
| 35 | + <FaIcon |
| 36 | + @prefix="far" |
| 37 | + @icon="folder" |
| 38 | + @size="2x" |
| 39 | + class="uk-margin-small-right" |
| 40 | + data-test-folder-icon |
| 41 | + {{set-style color=category.color}} |
| 42 | + /> |
| 43 | + {{category.name}} |
| 44 | + </Item> |
| 45 | + {{#if category.children.length}} |
| 46 | + {{#each category.children as |child|}} |
| 47 | + {{#if can "upload to category" @category}} |
| 48 | + <Item |
| 49 | + class="item--indent" |
| 50 | + uk-form-custom |
| 51 | + data-test-upload-category |
| 52 | + > |
| 53 | + <input |
| 54 | + type="file" |
| 55 | + multiple="multiple" |
| 56 | + data-test-input |
| 57 | + aria-label="file input" |
| 58 | + {{on "change" (perform this.upload child)}} |
| 59 | + /> |
| 60 | + <FaIcon |
| 61 | + @prefix="far" |
| 62 | + @icon="folder" |
| 63 | + @size="2x" |
| 64 | + class="uk-margin-small-right" |
| 65 | + data-test-folder-icon |
| 66 | + {{set-style color=child.color}} |
| 67 | + /> |
| 68 | + {{child.name}} |
| 69 | + </Item> |
| 70 | + {{/if}} |
| 71 | + {{/each}} |
| 72 | + {{/if}} |
67 | 73 | {{/if}}
|
68 | 74 | {{else}}
|
69 | 75 | <span data-test-no-categories>
|
|
0 commit comments