Commit | Line | Data |
---|---|---|
f44610a1 TO |
1 | <div nv-file-drop nv-file-over uploader="att.uploader" class="crm-attachments"> |
2 | <table> | |
3 | <tbody> | |
4 | <!-- Files from DB --> | |
5 | <tr ng-repeat="file in att.files"> | |
6 | <td class="filename filename-existing"> | |
7 | <a ng-href="{{file.url}}" target="_blank">{{file.name}}</a> | |
8 | </td> | |
9 | <td> | |
f9c5f498 | 10 | <input ng-model="file.description" class="crm-form-text" placeholder="{{:: ts('Description') }}"/> |
f44610a1 TO |
11 | </td> |
12 | <td> | |
3e5e512f | 13 | <a |
77ec5a8d | 14 | crm-icon="fa-trash" |
b8603a6d | 15 | crm-confirm="{message: ts('Deleting an attachment will completely remove it from server.')}" on-yes="att.deleteFile(file)" |
f9c5f498 | 16 | title="{{:: ts('Delete attachment') }}" |
3e5e512f | 17 | class="crm-hover-button"> |
f44610a1 TO |
18 | </a> |
19 | </td> | |
20 | </tr> | |
21 | <!-- Newly selected files --> | |
22 | <!-- This is fairly minimal. For examples with progress-bars and file-sizes, see https://github.com/nervgh/angular-file-upload/blob/master/examples/simple/index.html --> | |
23 | <tr ng-repeat="item in att.uploader.queue" ng-class="{nvReady: item.isReady, nvUploading:item.isUploading, nvUploaded:item.isUploaded,nvSuccess:item.isSuccess,nvCancel:item.isCancel,nvError:item.isError}"> | |
24 | <td class="filename filename-new">{{item.file.name}}</td> | |
25 | <td> | |
f9c5f498 | 26 | <input ng-model="item.crmData.description" class="crm-form-text" placeholder="{{:: ts('Description') }}"/> |
f44610a1 TO |
27 | <!-- item.isReady item.isUploading item.isUploaded item.isSuccess item.isCancel item.isError --> |
28 | </td> | |
29 | <td> | |
f9c5f498 | 30 | <a crm-icon="fa-times" ng-click="item.remove()" class="crm-hover-button" title="{{:: ts('Remove unsaved attachment') }}"></a> |
f44610a1 TO |
31 | </td> |
32 | </tr> | |
33 | </tbody> | |
34 | </table> | |
35 | ||
36 | <!-- | |
37 | WISHLIST Improve styling of the 'Add file' / 'Browse' button | |
38 | e.g. http://www.quirksmode.org/dom/inputfile.html | |
39 | --> | |
40 | <div> | |
f9c5f498 | 41 | {{:: ts('Add file:') }} <input type="file" nv-file-select uploader="att.uploader" multiple/><br/> |
f44610a1 TO |
42 | </div> |
43 | <div> | |
f9c5f498 | 44 | {{:: ts('Alternatively, you may add new files using drag/drop.') }} |
080eefc3 JP |
45 | <span ng-if="max_size"> |
46 | {{ts('Each file must be less than %1M in size.', {1: max_size})}} | |
47 | </span> | |
f44610a1 TO |
48 | </div> |
49 | </div> |