silverstripe-framework/templates/UploadField.ss
Damian Mooyman c9b6e9bac0
API Update template lookup to late resolution for performance reasons
API Update behaviour of form fields to use standard template lookup mechanism
API Support custom "type" parameter to template lookup
2016-09-06 12:54:03 +12:00

72 lines
3.0 KiB
Scheme

<ul class="ss-uploadfield-files files">
<% if $CustomisedItems %>
<% loop $CustomisedItems %>
<li class="ss-uploadfield-item template-download" data-fileid="$ID">
<div class="ss-uploadfield-item-preview preview"><span>
<img alt="$hasRelation" src="$UploadFieldThumbnailURL" />
</span></div>
<div class="ss-uploadfield-item-info">
<input type='hidden' value='$ID' name='{$Top.Name}[Files][]' />
<label class="ss-uploadfield-item-name">
<span class="name">$Name.XML</span>
<span class="size">$Size</span>
<div class="clear"><!-- --></div>
</label>
<div class="ss-uploadfield-item-actions">
<% if $Top.isActive %>
$UploadFieldFileButtons
<% end_if %>
</div>
</div>
<div class="ss-uploadfield-item-editform includeParent">
<iframe frameborder="0" data-src="$UploadFieldEditLink" src="about:blank"></iframe>
</div>
</li>
<% end_loop %>
<% end_if %>
</ul>
<% if $canUpload || $canAttachExisting %>
<div class="ss-uploadfield-item ss-uploadfield-addfile<% if $CustomisedItems %> borderTop<% end_if %>">
<% if canUpload %>
<div class="ss-uploadfield-item-preview ss-uploadfield-dropzone ui-corner-all">
<% if $multiple %>
<%t UploadField.DROPFILES 'drop files' %>
<% else %>
<%t UploadField.DROPFILE 'drop a file' %>
<% end_if %>
</div>
<% end_if %>
<div class="ss-uploadfield-item-info">
<label class="ss-uploadfield-item-name">
<% if $multiple %>
<b><%t UploadField.ATTACHFILES 'Attach files' %></b>
<% else %>
<b><%t UploadField.ATTACHFILE 'Attach a file' %></b>
<% end_if %>
<% if $canPreviewFolder %>
<small>(<%t UploadField.UPLOADSINTO 'saves into /{path}' path=$FolderName %>)</small>
<% end_if %>
</label>
<% if $canUpload %>
<label class="ss-uploadfield-fromcomputer ss-ui-button ui-corner-all" title="<%t UploadField.FROMCOMPUTERINFO 'Upload from your computer' %>" data-icon="drive-upload">
<%t UploadField.FROMCOMPUTER 'From your computer' %>
<input id="$id" name="{$Name}[Uploads][]" class="$extraClass ss-uploadfield-fromcomputer-fileinput" data-config="$configString.ATT" type="file"<% if $multiple %> multiple="multiple"<% end_if %> />
</label>
<% else %>
<input id="$id" name="{$Name}[Uploads][]" class="$extraClass ss-uploadfield-fromcomputer-fileinput" data-config="$configString.ATT" type="hidden" />
<% end_if %>
<% if $canAttachExisting %>
<button type="button" class="ss-uploadfield-fromfiles ss-ui-button ui-corner-all" title="<%t UploadField.FROMCOMPUTERINFO 'Select from files' %>" data-icon="network-cloud"><%t UploadField.FROMFILES 'From files' %></button>
<% end_if %>
<% if $canUpload %>
<% if not $autoUpload %>
<button type="button" class="ss-uploadfield-startall ss-ui-button ui-corner-all" data-icon="navigation"><%t UploadField.STARTALL 'Start all' %></button>
<% end_if %>
<% end_if %>
<div class="clear"><!-- --></div>
</div>
<div class="clear"><!-- --></div>
</div>
<% end_if %>