silverstripe-framework/javascript/UploadField_uploadtemplate.js
Naomi Guyer 9844328a06 BUGFIX: Fix error notification on files (fixes: 7295)
Add title text to all status messages
Make room for the error message details by expanding the name area in
the file details
Fix up changes status to work with selects
2012-05-11 14:43:17 +12:00

30 lines
1.8 KiB
JavaScript

window.tmpl.cache['ss-uploadfield-uploadtemplate'] = tmpl(
'{% for (var i=0, files=o.files, l=files.length, file=files[0]; i<l; file=files[++i]) { %}' +
'<li class="ss-uploadfield-item template-upload{% if (file.error) { %} ui-state-error{% } %}">' +
'<div class="ss-uploadfield-item-preview preview"><span></span></div>' +
'<div class="ss-uploadfield-item-info">' +
'<label class="ss-uploadfield-item-name">' +
'<span class="name" title="{% if (file.name) { %}{%=file.name%}{% } else { %}' + ss.i18n._t('UploadField.NOFILENAME', 'Untitled') + '{% } %}">' +
'{% if (file.name) { %}{%=file.name%}{% } else { %}' + ss.i18n._t('UploadField.NOFILENAME', 'Untitled') + '{% } %}</span> ' +
'{% if (!file.error) { %}' +
'<div class="ss-uploadfield-item-status">0%</div>' +
'{% } else { %}' +
'<div class="ss-uploadfield-item-status ui-state-error-text" title="{%=o.options.errorMessages[file.error] || file.error%}">{%=o.options.errorMessages[file.error] || file.error%}</div>' +
'{% } %}' +
'<div class="clear"><!-- --></div>' +
'</label>' +
'<div class="ss-uploadfield-item-actions">' +
'{% if (!file.error) { %}' +
'<div class="ss-uploadfield-item-progress"><div class="ss-uploadfield-item-progressbar"><div class="ss-uploadfield-item-progressbarvalue"></div></div></div>' +
'{% if (!o.options.autoUpload) { %}' +
'<div class="ss-uploadfield-item-start start"><button class="icon icon-16">' + ss.i18n._t('UploadField.START', 'Start') + '</button></div>' +
'{% } %}' +
'{% } %}' +
'<div class="ss-uploadfield-item-cancel cancel"><button class="icon icon-16">' + ss.i18n._t('UploadField.CANCEL', 'Cancel') + '</button></div>' +
'</div>' +
'</div>' +
'</li>' +
'{% } %}'
);