/
derivate-fileList.hbs
174 lines (173 loc) · 7.9 KB
/
derivate-fileList.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
<div id="collapse{{mycorederivate}}" class="body collapse in show">
<table class="table table-sm table-striped">
{{#isNot '/' path}}
<tr class="file_set d-flex">
<td class="file_preview col-1 text-center text-nowrap">
<span class="fas fa-folder" aria-hidden="true"></span>
</td>
<td class="file_name derivate_folder col-6">
<a data-path="{{getParent path}}/" href="#">..</a>
</td>
</tr>
{{/isNot}}
{{#each children}}
{{#is (concat '/' ../mainDoc) path}}
<tr class="file_set active_file d-flex">
{{else}}
<tr class="file_set d-flex" {{#if ../permWrite}} {{#is type "directory"}}
data-upload-object="{{../mycorederivate}}" data-upload-target="{{path}}" {{/is}}{{/if}} >
{{/is}}
<td class="file_preview col-1 text-center text-nowrap">
{{#is type "file"}}
{{#contains "pdf|ps" extension}}
<span class="fas {{getFileIcon extension}}" data-toggle="tooltip"
data-placement="right" data-html="true" data-title='<img src="{{../serverBaseURL}}img/pdfthumb/{{../mycorederivate}}{{path}}?centerThumb=no">'></span>
{{else}}
<span class="fas {{getFileIcon extension}}" title="{{getFileLabel extension}}" aria-hidden="true"></span>
{{/contains}}
{{else}}
<span class="fas fa-folder" aria-hidden="true"></span>
{{/is}}
</td>
{{#isNot type "directory"}}
{{#contains "mp4" extension}}
<td class="file_name file_video col-6">
<a data-deriid="{{../mycorederivate}}" data-name="{{name}}" href="{{href}}">
{{name}}
</a>
</td>
{{else}}
<td class="file_name col-6">
<a href="{{href}}">
{{name}}
</a>
</td>
{{/contains}}
{{else}}
<td class="file_name derivate_folder col-6">
<a data-path="{{path}}" href="#">
{{name}}
</a>
</td>
{{/isNot}}
<td class="file_date d-none d-sm-table-cell col-md-2 text-right">
{{#is type "file"}}
{{formatDate time.modified}}
{{/is}}
</td>
<td class="file_size d-none d-sm-table-cell col-md-2 text-right text-nowrap">
{{#isNot type "directory"}}
{{formatFileSize size}}
{{/isNot}}
</td>
<td class="d-sm-none col-4 text-right">
{{#is type "file"}}
{{formatDate time.modified}}<br>
{{/is}}
{{formatFileSize size}}
</td>
<td class="options col-1 text-right">
{{#isOr ../permWrite ../permDelete}}
{{#noDirOrURN type ../urn}}
<div class="btn-group">
<a href="#" class="btn btn-secondary dropdown-toggle" data-toggle="dropdown">
<i class="fas fa-cog"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu dropdown-menu-right">
{{#if ../permWrite}}
{{#isNot type "directory"}}
<li>
<a title="{{getI18n "IFS.mainFile"}}"
href="#"
data-derivateid="{{../mycorederivate}}"
data-objectid="{{../mycoreobject}}"
data-file="{{name}}"
data-path="{{urlPath}}"
class="option mir_mainfile dropdown-item">
<span class="fas fa-star"></span>
{{getI18n "IFS.mainFile"}}
</a>
</li>
{{/isNot}}
{{/if}}
{{#if ../permDelete}}
{{#is type "file"}}
<li>
<a href="{{../serverBaseURL}}servlets/MCRDerivateServlet?derivateid={{../mycorederivate}}&objectid={{../mycoreobject}}&todo=smovfile&file={{urlPath}}"
class="option rename dropdown-item"
title="{{getI18n (concat "IFS." type "Rename")}}">
<span class="fas fa-file-signature"></span>
{{getI18n (concat "IFS." type "Rename")}}
</a>
</li>
{{/is}}
<li>
<a href="{{../serverBaseURL}}servlets/MCRDerivateServlet?derivateid={{../mycorederivate}}&objectid={{../mycoreobject}}&todo=sdelfile&file={{urlPath}}"
class="option confirm_deletion dropdown-item"
data-text="{{getI18n (concat "mir.confirm." type ".text")}}"
title="{{getI18n (concat "IFS." type "Delete")}}">
<span class="fas fa-trash-alt"></span>
{{getI18n (concat "IFS." type "Delete")}}
</a>
</li>
{{/if}}
</ul>
</div>
{{/noDirOrURN}}
{{/isOr}}
</td>
</tr>
{{/each}}
</table>
{{#if permWrite}}
<div class="card bg-light text-center mir-file-upload-box" data-upload-object="{{mycorederivate}}" data-upload-target="{{path}}">
<div class="card-body">
<i class="fas fa-upload"></i>
{{{getI18n "mir.upload.drop.derivate"}}}
</div>
</div>
{{/if}}
{{#if pagination}}
<div class="file_box_pagination row">
<div class="col-md-6 d-xs-none pagination-info">
{{getI18n "mir.pagination.entriesInfo" pagination.start pagination.end pagination.total}}
</div>
<div class="col-12 col-md-6">
<ul class="pagination pagination-sm float-right">
{{#paginate pagination type="first"}}
<li class="page-item{{#if disabled}} disabled{{/if}}">
<a href="#" class="page-link" data-page="{{n}}" aria-label="First" {{#unless disabled}}title="{{getI18n "mir.pagination.first" n}}{{/unless}}">
<span aria-hidden="true">«</span>
</a>
</li>
{{/paginate}}
{{#paginate pagination type="previous"}}
<li class="page-item{{#if disabled}} disabled{{/if}}">
<a href="#" data-page="{{n}}" class="page-link" aria-label="Previous" {{#unless disabled}}title="{{getI18n "mir.pagination.previous" n}}{{/unless}}">
<span aria-hidden="true">‹</span>
</a>
</li>
{{/paginate}}
{{#paginate pagination type="middle" limit="5"}}
<li class="page-item{{#if active}} active{{/if}}"><a href="#" class="page-link" data-page="{{n}}">{{n}}</a></li>
{{/paginate}}
{{#paginate pagination type="next"}}
<li class="page-item{{#if disabled}} disabled{{/if}}">
<a href="#" class="page-link" data-page="{{n}}" aria-label="Next" {{#unless disabled}}title="{{getI18n "mir.pagination.next" n}}{{/unless}}">
<span aria-hidden="true">›</span>
</a>
</li>
{{/paginate}}
{{#paginate pagination type="last"}}
<li class="page-item{{#if disabled}} disabled{{/if}}">
<a href="#" class="page-link" data-page="{{n}}" aria-label="Last" {{#unless disabled}}title="{{getI18n "mir.pagination.last" n}}{{/unless}}">
<span aria-hidden="true">»</span>
</a>
</li>
{{/paginate}}
</ul>
</div>
</div>
{{/if}}
</div>